replaced call to deprecated nsString API
git-svn-id: svn://10.0.0.236/trunk@41080 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
e7466985c1
commit
b95059cd8b
@ -2855,7 +2855,7 @@ SI_FindValueInArgs(nsAutoString results, char* name) {
|
|||||||
return nsAutoString("").ToNewCString();
|
return nsAutoString("").ToNewCString();
|
||||||
}
|
}
|
||||||
start += PL_strlen(name); /* get passed the |name| part */
|
start += PL_strlen(name); /* get passed the |name| part */
|
||||||
length = results.Find('|', start) - start;
|
length = results.FindChar('|', PR_FALSE,start) - start;
|
||||||
results.Mid(value, start, length);
|
results.Mid(value, start, length);
|
||||||
return value.ToNewCString();
|
return value.ToNewCString();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@ peqWithParameter(nsIRDFResource *r1, nsIRDFResource *r2, PRBool *isParameter, co
|
|||||||
nsAllocator::Free(r1Str);
|
nsAllocator::Free(r1Str);
|
||||||
|
|
||||||
//Look to see if there are any parameters
|
//Look to see if there are any parameters
|
||||||
PRInt32 paramStart = r2nsStr.Find('?');
|
PRInt32 paramStart = r2nsStr.FindChar('?');
|
||||||
//If not, then just return whether or not the strings are equal.
|
//If not, then just return whether or not the strings are equal.
|
||||||
if(paramStart == -1)
|
if(paramStart == -1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -33,7 +33,7 @@ nsresult GetMessageServiceProgIDForURI(const char *uri, nsString &progID)
|
|||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
//Find protocol
|
//Find protocol
|
||||||
nsString uriStr = uri;
|
nsString uriStr = uri;
|
||||||
PRInt32 pos = uriStr.Find(':');
|
PRInt32 pos = uriStr.FindChar(':');
|
||||||
if(pos == -1)
|
if(pos == -1)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
nsString protocol;
|
nsString protocol;
|
||||||
|
|||||||
@ -1292,7 +1292,7 @@ nsMsgLocalMailFolder::CopyMessages(nsIMsgFolder* srcFolder, nsISupportsArray*
|
|||||||
rv = srcFolder->GetURI(&uri);
|
rv = srcFolder->GetURI(&uri);
|
||||||
nsString2 protocolType(uri, eOneByte);
|
nsString2 protocolType(uri, eOneByte);
|
||||||
PR_FREEIF(uri);
|
PR_FREEIF(uri);
|
||||||
protocolType.SetLength(protocolType.Find(':'));
|
protocolType.SetLength(protocolType.FindChar(':'));
|
||||||
|
|
||||||
if (!protocolType.EqualsIgnoreCase("mailbox"))
|
if (!protocolType.EqualsIgnoreCase("mailbox"))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -131,7 +131,7 @@ nsLocalMoveCopyMsgTxn::UndoImapDeleteFlag(nsIMsgFolder* folder,
|
|||||||
rv = folder->GetURI(&uri);
|
rv = folder->GetURI(&uri);
|
||||||
nsString2 protocolType(uri, eOneByte);
|
nsString2 protocolType(uri, eOneByte);
|
||||||
PR_FREEIF(uri);
|
PR_FREEIF(uri);
|
||||||
protocolType.SetLength(protocolType.Find(':'));
|
protocolType.SetLength(protocolType.FindChar(':'));
|
||||||
if (protocolType.EqualsIgnoreCase("imap"))
|
if (protocolType.EqualsIgnoreCase("imap"))
|
||||||
{
|
{
|
||||||
NS_WITH_SERVICE(nsIImapService, imapService, kCImapService, &rv);
|
NS_WITH_SERVICE(nsIImapService, imapService, kCImapService, &rv);
|
||||||
|
|||||||
@ -238,7 +238,7 @@ nsresult nsParseLocalMessageURI(const char* uri,
|
|||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
|
||||||
nsAutoString uriStr = uri;
|
nsAutoString uriStr = uri;
|
||||||
PRInt32 keySeparator = uriStr.Find('#');
|
PRInt32 keySeparator = uriStr.FindChar('#');
|
||||||
if(keySeparator != -1)
|
if(keySeparator != -1)
|
||||||
{
|
{
|
||||||
nsAutoString folderPath;
|
nsAutoString folderPath;
|
||||||
|
|||||||
@ -2282,7 +2282,7 @@ PRInt32 nsNNTPProtocol::ReadArticle(nsIInputStream * inputStream, PRUint32 lengt
|
|||||||
void nsNNTPProtocol::ParseHeaderForCancel(char *buf)
|
void nsNNTPProtocol::ParseHeaderForCancel(char *buf)
|
||||||
{
|
{
|
||||||
nsString header(buf, eOneByte);
|
nsString header(buf, eOneByte);
|
||||||
PRInt32 colon = header.Find(':');
|
PRInt32 colon = header.FindChar(':');
|
||||||
if (!colon)
|
if (!colon)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@ -780,7 +780,7 @@ nsresult nsMsgNewsFolder::AbbreviatePrettyName(PRUnichar ** prettyName, PRInt32
|
|||||||
// get the total no. of words
|
// get the total no. of words
|
||||||
for (PRInt32 pos = 0;
|
for (PRInt32 pos = 0;
|
||||||
(pos++) != name.Length();
|
(pos++) != name.Length();
|
||||||
pos = name.Find('.', pos))
|
pos = name.FindChar('.', PR_FALSE,pos))
|
||||||
totalwords ++;
|
totalwords ++;
|
||||||
|
|
||||||
// get the no. of words to abbreviate
|
// get the no. of words to abbreviate
|
||||||
|
|||||||
@ -116,7 +116,7 @@ nsNewsURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult)
|
|||||||
// the server name is the first component of the path, so extract it out
|
// the server name is the first component of the path, so extract it out
|
||||||
PRInt32 hostStart = 0;
|
PRInt32 hostStart = 0;
|
||||||
|
|
||||||
hostStart = uri.Find('/');
|
hostStart = uri.FindChar('/');
|
||||||
if (hostStart <= 0) return NS_ERROR_FAILURE;
|
if (hostStart <= 0) return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
// skip past all //
|
// skip past all //
|
||||||
@ -126,9 +126,9 @@ nsNewsURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult)
|
|||||||
nsAutoString hostname (eOneByte);
|
nsAutoString hostname (eOneByte);
|
||||||
uri.Right(hostname, uri.Length() - hostStart);
|
uri.Right(hostname, uri.Length() - hostStart);
|
||||||
|
|
||||||
PRInt32 hostEnd = hostname.Find('/');
|
PRInt32 hostEnd = hostname.FindChar('/');
|
||||||
|
|
||||||
PRInt32 atPos = hostname.Find('@');
|
PRInt32 atPos = hostname.FindChar('@');
|
||||||
nsAutoString username(eOneByte);
|
nsAutoString username(eOneByte);
|
||||||
|
|
||||||
username = "";
|
username = "";
|
||||||
@ -140,7 +140,7 @@ nsNewsURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult)
|
|||||||
|
|
||||||
username = "";
|
username = "";
|
||||||
|
|
||||||
hostEnd = hostname.Find('/');
|
hostEnd = hostname.FindChar('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
// newsgroup comes after the hostname, after the '/'
|
// newsgroup comes after the hostname, after the '/'
|
||||||
@ -209,7 +209,7 @@ nsParseNewsMessageURI(const char* uri, nsString& messageUriWithoutKey, PRUint32
|
|||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
|
||||||
nsAutoString uriStr = uri;
|
nsAutoString uriStr = uri;
|
||||||
PRInt32 keySeparator = uriStr.Find('#');
|
PRInt32 keySeparator = uriStr.FindChar('#');
|
||||||
if(keySeparator != -1)
|
if(keySeparator != -1)
|
||||||
{
|
{
|
||||||
uriStr.Left(messageUriWithoutKey, keySeparator);
|
uriStr.Left(messageUriWithoutKey, keySeparator);
|
||||||
|
|||||||
@ -187,7 +187,7 @@ nsresult nsNntpService::ConvertNewsMessageURI2NewsURI(const char *messageURI, ns
|
|||||||
// take news.mcom.com/mcom.linux (in hostname) and put
|
// take news.mcom.com/mcom.linux (in hostname) and put
|
||||||
// "mcom.linux" into newsgroupName and truncate to leave
|
// "mcom.linux" into newsgroupName and truncate to leave
|
||||||
// "news.mcom.com" in hostname
|
// "news.mcom.com" in hostname
|
||||||
PRInt32 hostEnd = hostname.Find('/');
|
PRInt32 hostEnd = hostname.FindChar('/');
|
||||||
if (hostEnd > 0) {
|
if (hostEnd > 0) {
|
||||||
hostname.Right(newsgroupName, hostname.Length() - hostEnd - 1);
|
hostname.Right(newsgroupName, hostname.Length() - hostEnd - 1);
|
||||||
hostname.Truncate(hostEnd);
|
hostname.Truncate(hostEnd);
|
||||||
@ -379,7 +379,7 @@ nsresult nsNntpService::DetermineHostForPosting(nsString &host, const char *news
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// theRest is "group" or "host/group"
|
// theRest is "group" or "host/group"
|
||||||
PRInt32 slashpos = theRest.Find('/');
|
PRInt32 slashpos = theRest.FindChar('/');
|
||||||
if (slashpos > 0 ) {
|
if (slashpos > 0 ) {
|
||||||
// theRest is "host/group"
|
// theRest is "host/group"
|
||||||
theRest.Left(currentHost, slashpos);
|
theRest.Left(currentHost, slashpos);
|
||||||
@ -490,7 +490,7 @@ nsresult nsNntpService::ConvertNewsgroupsString(const char *newsgroupsNames, cha
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// theRest is "group" or "host/group"
|
// theRest is "group" or "host/group"
|
||||||
PRInt32 slashpos = theRest.Find('/');
|
PRInt32 slashpos = theRest.FindChar('/');
|
||||||
if (slashpos > 0 ) {
|
if (slashpos > 0 ) {
|
||||||
nsString currentGroup("",eOneByte);
|
nsString currentGroup("",eOneByte);
|
||||||
|
|
||||||
|
|||||||
@ -235,7 +235,7 @@ static PRBool CheckAndStrip(
|
|||||||
static PRInt16 CheckOrdinalAndStrip(nsString& ioString, PRInt16& outOrdinal)
|
static PRInt16 CheckOrdinalAndStrip(nsString& ioString, PRInt16& outOrdinal)
|
||||||
//----------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
PRInt32 colonPos = ioString.Find(':');
|
PRInt32 colonPos = ioString.FindChar(':');
|
||||||
if (colonPos <= 0)
|
if (colonPos <= 0)
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
char* intString = ioString.ToNewCString();
|
char* intString = ioString.ToNewCString();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user