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