зеркало из https://github.com/mozilla/pjs.git
replaced calls to deprecated string API
This commit is contained in:
Родитель
285b2eab0d
Коммит
bcf302cec2
|
@ -939,7 +939,7 @@ void nsMsgCompose::HackToGetBody(PRInt32 what)
|
|||
offset = lowerMsgBody.Find("<body");
|
||||
if (offset != -1)
|
||||
{
|
||||
offset = lowerMsgBody.Find('>', offset);
|
||||
offset = lowerMsgBody.FindChar('>', PR_FALSE,offset);
|
||||
if (offset != -1)
|
||||
{
|
||||
startBodyOffset = offset + 1;
|
||||
|
|
|
@ -508,7 +508,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateSubfolder(const char *folderName)
|
|||
nsAutoString leafName (folderName, eOneByte);
|
||||
nsString folderNameStr;
|
||||
nsString parentName = leafName;
|
||||
PRInt32 folderStart = leafName.Find('/');
|
||||
PRInt32 folderStart = leafName.FindChar('/');
|
||||
if (folderStart > 0)
|
||||
{
|
||||
NS_WITH_SERVICE(nsIRDFService, rdf, kRDFServiceCID, &rv);
|
||||
|
@ -775,7 +775,7 @@ NS_IMETHODIMP nsImapMailFolder::GetUsername(char** userName)
|
|||
aName.Cut(0, PL_strlen(kImapRootURI));
|
||||
while (aName[0] == '/')
|
||||
aName.Cut(0, 1);
|
||||
PRInt32 userEnd = aName.Find('@');
|
||||
PRInt32 userEnd = aName.FindChar('@');
|
||||
if (userEnd < 1)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
|
@ -814,11 +814,11 @@ NS_IMETHODIMP nsImapMailFolder::GetHostname(char** hostName)
|
|||
while (aName[0] == '/')
|
||||
aName.Cut(0, 1);
|
||||
// cut out user name ### alec, when you clean up url parsing, please get this too!
|
||||
PRInt32 userNameEnd = aName.Find('@');
|
||||
PRInt32 userNameEnd = aName.FindChar('@');
|
||||
if (userNameEnd > 0)
|
||||
aName.Cut(0, userNameEnd + 1);
|
||||
|
||||
PRInt32 hostEnd = aName.Find('/');
|
||||
PRInt32 hostEnd = aName.FindChar('/');
|
||||
if (hostEnd > 0) // must have at least one valid charater
|
||||
aName.SetLength(hostEnd);
|
||||
char *tmpCString = aName.ToNewCString();
|
||||
|
|
|
@ -234,7 +234,7 @@ nsImapMoveCopyMsgTxn::UndoMailboxDelete()
|
|||
rv = m_srcFolder->GetURI(&uri);
|
||||
nsString2 protocolType(uri, eOneByte);
|
||||
PR_FREEIF(uri);
|
||||
protocolType.SetLength(protocolType.Find(':'));
|
||||
protocolType.SetLength(protocolType.FindChar(':'));
|
||||
// ** jt -- only do this for mailbox protocol
|
||||
if (protocolType.EqualsIgnoreCase("mailbox"))
|
||||
{
|
||||
|
@ -283,7 +283,7 @@ nsImapMoveCopyMsgTxn::RedoMailboxDelete()
|
|||
rv = m_srcFolder->GetURI(&uri);
|
||||
nsString2 protocolType(uri, eOneByte);
|
||||
PR_FREEIF(uri);
|
||||
protocolType.SetLength(protocolType.Find(':'));
|
||||
protocolType.SetLength(protocolType.FindChar(':'));
|
||||
// ** jt -- only do this for mailbox protocol
|
||||
if (protocolType.EqualsIgnoreCase("mailbox"))
|
||||
{
|
||||
|
|
|
@ -84,7 +84,7 @@ nsImapURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult)
|
|||
// the server name is the first component of the path, so extract it out
|
||||
PRInt32 hostStart;
|
||||
|
||||
hostStart = uri.Find('/');
|
||||
hostStart = uri.FindChar('/');
|
||||
if (hostStart <= 0) return NS_ERROR_FAILURE;
|
||||
|
||||
// skip past all //
|
||||
|
@ -96,7 +96,7 @@ nsImapURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult)
|
|||
|
||||
nsAutoString username("");
|
||||
|
||||
PRInt32 atPos = hostname.Find('@');
|
||||
PRInt32 atPos = hostname.FindChar('@');
|
||||
if (atPos != -1) {
|
||||
hostname.Left(username, atPos);
|
||||
hostname.Cut(0, atPos+1);
|
||||
|
@ -108,7 +108,7 @@ nsImapURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult)
|
|||
|
||||
// cut off first '/' and everything following it
|
||||
// hostname/folder -> hostname
|
||||
PRInt32 hostEnd = hostname.Find('/');
|
||||
PRInt32 hostEnd = hostname.FindChar('/');
|
||||
if (hostEnd > 0)
|
||||
{
|
||||
hostname.Right(folder, hostname.Length() - hostEnd - 1);
|
||||
|
@ -150,7 +150,7 @@ nsImapURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult)
|
|||
{
|
||||
nsAutoString parentName = folder;
|
||||
nsAutoString leafName = folder;
|
||||
PRInt32 dirEnd = parentName.Find('/');
|
||||
PRInt32 dirEnd = parentName.FindChar('/');
|
||||
|
||||
while(dirEnd > 0)
|
||||
{
|
||||
|
@ -160,7 +160,7 @@ nsImapURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult)
|
|||
parentName += sbdSep;
|
||||
pathResult += parentName;
|
||||
parentName = leafName;
|
||||
dirEnd = parentName.Find('/');
|
||||
dirEnd = parentName.FindChar('/');
|
||||
}
|
||||
if (leafName != "") {
|
||||
NS_MsgHashIfNecessary(leafName);
|
||||
|
@ -194,7 +194,7 @@ nsImapURI2FullName(const char* rootURI, const char* hostname, char* uriStr,
|
|||
if (hostStart <= 0) return NS_ERROR_FAILURE;
|
||||
uri.Right(fullName, uri.Length() - hostStart);
|
||||
uri = fullName;
|
||||
PRInt32 hostEnd = uri.Find('/');
|
||||
PRInt32 hostEnd = uri.FindChar('/');
|
||||
if (hostEnd <= 0) return NS_ERROR_FAILURE;
|
||||
uri.Right(fullName, uri.Length() - hostEnd - 1);
|
||||
if (fullName == "") return NS_ERROR_FAILURE;
|
||||
|
@ -211,7 +211,7 @@ nsImapURI2UserName(const char* rootURI, const char* uriStr,
|
|||
PRInt32 userStart = PL_strlen(rootURI);
|
||||
while (uri[userStart] == '/') userStart++;
|
||||
uri.Cut(0, userStart);
|
||||
PRInt32 userEnd = uri.Find('@');
|
||||
PRInt32 userEnd = uri.FindChar('@');
|
||||
if (userEnd < 1)
|
||||
return NS_ERROR_FAILURE;
|
||||
uri.SetLength(userEnd);
|
||||
|
@ -228,10 +228,10 @@ nsImapURI2HostName(const char* rootURI, const char* uriStr,
|
|||
PRInt32 hostStart = PL_strlen(rootURI);
|
||||
while (uri[hostStart] == '/') hostStart++;
|
||||
uri.Cut(0, hostStart);
|
||||
hostStart = uri.Find('@'); // skip username
|
||||
hostStart = uri.FindChar('@'); // skip username
|
||||
if (hostStart > 0)
|
||||
uri.Cut(0, hostStart+1);
|
||||
PRInt32 hostEnd = uri.Find('/');
|
||||
PRInt32 hostEnd = uri.FindChar('/');
|
||||
if (hostEnd > 0)
|
||||
uri.SetLength(hostEnd);
|
||||
hostname = uri;
|
||||
|
@ -242,7 +242,7 @@ nsresult
|
|||
nsURI2ProtocolType(const char* uriStr, nsString& type)
|
||||
{
|
||||
nsAutoString uri = uriStr;
|
||||
PRInt32 typeEnd = uri.Find(':');
|
||||
PRInt32 typeEnd = uri.FindChar(':');
|
||||
if (typeEnd < 1)
|
||||
return NS_ERROR_FAILURE;
|
||||
uri.SetLength(typeEnd);
|
||||
|
@ -257,7 +257,7 @@ nsresult nsParseImapMessageURI(const char* uri, nsString& folderURI, PRUint32 *k
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsAutoString uriStr = uri;
|
||||
PRInt32 keySeparator = uriStr.Find('#');
|
||||
PRInt32 keySeparator = uriStr.FindChar('#');
|
||||
if(keySeparator != -1)
|
||||
{
|
||||
nsAutoString folderPath;
|
||||
|
|
|
@ -279,7 +279,7 @@ nsInstallVersion::StringToVersionNumbers(const nsString& version, PRInt32 *aMajo
|
|||
{
|
||||
PRInt32 errorCode;
|
||||
|
||||
int dot = version.Find('.', 0);
|
||||
int dot = version.FindChar('.', PR_FALSE,0);
|
||||
|
||||
if ( dot == -1 )
|
||||
{
|
||||
|
@ -292,7 +292,7 @@ nsInstallVersion::StringToVersionNumbers(const nsString& version, PRInt32 *aMajo
|
|||
*aMajor = majorStr.ToInteger(&errorCode);
|
||||
|
||||
int prev = dot+1;
|
||||
dot = version.Find('.',prev);
|
||||
dot = version.FindChar('.',PR_FALSE,prev);
|
||||
if ( dot == -1 )
|
||||
{
|
||||
nsString minorStr;
|
||||
|
@ -306,7 +306,7 @@ nsInstallVersion::StringToVersionNumbers(const nsString& version, PRInt32 *aMajo
|
|||
*aMinor = minorStr.ToInteger(&errorCode);
|
||||
|
||||
prev = dot+1;
|
||||
dot = version.Find('.',prev);
|
||||
dot = version.FindChar('.',PR_FALSE,prev);
|
||||
if ( dot == -1 )
|
||||
{
|
||||
nsString releaseStr;
|
||||
|
|
|
@ -42,7 +42,7 @@ nsXPITriggerItem::nsXPITriggerItem( const PRUnichar* aName,
|
|||
{
|
||||
nsString URL(aURL);
|
||||
|
||||
PRInt32 pos = URL.Find('?');
|
||||
PRInt32 pos = URL.FindChar('?');
|
||||
if ( pos == -1 ) {
|
||||
// no arguments
|
||||
mURL = URL;
|
||||
|
|
Загрузка…
Ссылка в новой задаче