Bug 100476: Convert uses of member functions ToNewUnicode, ToNewCString and ToNewUTF8String to their global versions and remove support from nsCString and nsString. r=dbaron, rs=scc

This commit is contained in:
jaggernaut%netscape.com 2006-05-17 02:33:40 +00:00
Родитель 6b58674128
Коммит 1e4af0ee84
2 изменённых файлов: 12 добавлений и 10 удалений

Просмотреть файл

@ -40,6 +40,7 @@
#include "nsIComponentManager.h"
#include "nsVoidArray.h"
#include "nsReadableUtils.h"
///////////////////////////////////////////////////////////////////////////////
@ -146,9 +147,9 @@ inCSSValueSearch::GetStringResultAt(PRInt32 aIndex, PRUnichar **_retval)
{
if (mHoldResults) {
nsAutoString* result = (nsAutoString*)mResults->ElementAt(aIndex);
*_retval = result->ToNewUnicode();
*_retval = ToNewUnicode(*result);
} else if (aIndex == mResultCount-1) {
*_retval = mLastResult->ToNewUnicode();
*_retval = ToNewUnicode(*mLastResult);
} else {
return NS_ERROR_FAILURE;
}
@ -188,7 +189,7 @@ inCSSValueSearch::SetDocument(nsIDOMDocument* aDocument)
NS_IMETHODIMP
inCSSValueSearch::GetBaseURL(PRUnichar** aBaseURL)
{
*aBaseURL = mBaseURL->ToNewUnicode();
*aBaseURL = ToNewUnicode(*mBaseURL);
return NS_OK;
}
@ -243,7 +244,7 @@ inCSSValueSearch::AddPropertyCriteria(const PRUnichar *aPropName)
NS_IMETHODIMP
inCSSValueSearch::GetTextCriteria(PRUnichar** aTextCriteria)
{
*aTextCriteria = mTextCriteria->ToNewUnicode();
*aTextCriteria = ToNewUnicode(*mTextCriteria);
return NS_OK;
}
@ -352,7 +353,7 @@ inCSSValueSearch::EqualizeURL(nsAutoString* aURL)
if (aURL->Find("chrome://", PR_FALSE, 0, 1) >= 0) {
PRUint32 len = aURL->Length();
char* result = new char[len-8];
char* buffer = aURL->ToNewCString();
char* buffer = ToNewCString(*aURL);
PRUint32 i = 9;
PRUint32 milestone = 0;
PRUint32 s = 0;

Просмотреть файл

@ -40,6 +40,7 @@
#include "nsCOMPtr.h"
#include "nsString.h"
#include "nsReadableUtils.h"
///////////////////////////////////////////////////////////////////////////////
@ -125,7 +126,7 @@ inFileSearch::SearchAsync(inISearchObserver *aObserver)
} else {
nsAutoString msg;
msg.AssignWithConversion("No search path has been provided");
mObserver->OnSearchError(this, msg.ToNewUnicode());
mObserver->OnSearchError(this, ToNewUnicode(msg));
KillSearch(inISearchObserver::ERROR);
}
@ -176,7 +177,7 @@ inFileSearch::GetStringResultAt(PRInt32 aIndex, PRUnichar **_retval)
path.AssignWithConversion(temp);
if (mReturnRelativePaths)
MakePathRelative(&path);
*_retval = path.ToNewUnicode();
*_retval = ToNewUnicode(path);
} else {
return NS_ERROR_FAILURE;
}
@ -203,7 +204,7 @@ NS_IMETHODIMP
inFileSearch::GetBasePath(PRUnichar** aBasePath)
{
if (mBasePath) {
*aBasePath = mBasePath->ToNewUnicode();
*aBasePath = ToNewUnicode(*mBasePath);
} else {
return NS_ERROR_FAILURE;
}
@ -282,7 +283,7 @@ inFileSearch::SetFilenameCriteria(const PRUnichar* aFilenameCriteria)
NS_IMETHODIMP
inFileSearch::GetTextCriteria(PRUnichar** aTextCriteria)
{
*aTextCriteria = mTextCriteria->ToNewUnicode();
*aTextCriteria = ToNewUnicode(*mTextCriteria);
return NS_OK;
}
@ -550,7 +551,7 @@ inFileSearch::MatchFile(nsIFile* aFile)
nsAutoString temp;
temp.AssignWithConversion(fileName);
PRUnichar* fileNameUnicode = temp.ToNewUnicode();
PRUnichar* fileNameUnicode = ToNewUnicode(temp);
PRBool match;