Replace instances of nsTextFormater with nsTextFormatter, r=jst@citec.fi

This commit is contained in:
sford3%swbell.net 2000-01-17 22:32:13 +00:00
parent 746335ea97
commit b2c319eae7
18 changed files with 71 additions and 71 deletions

View File

@ -37,7 +37,7 @@
#include "nsIPref.h"
#include "prefapi.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
extern "C" {
#include "prmon.h"
@ -1487,16 +1487,16 @@ cookie_SetCookieString(char * curURL, char * setCookieHeader, time_t timeToExpir
PRUnichar * message;
if (prev_cookie) {
message = cookie_Localize("PermissionToModifyCookie");
new_string = nsTextFormater::smprintf(message, host_from_header ? host_from_header : "");
new_string = nsTextFormatter::smprintf(message, host_from_header ? host_from_header : "");
} else if (count>1) {
message = cookie_Localize("PermissionToSetAnotherCookie");
new_string = nsTextFormater::smprintf(message, host_from_header ? host_from_header : "", count);
new_string = nsTextFormatter::smprintf(message, host_from_header ? host_from_header : "", count);
} else if (count==1){
message = cookie_Localize("PermissionToSetSecondCookie");
new_string = nsTextFormater::smprintf(message, host_from_header ? host_from_header : "");
new_string = nsTextFormatter::smprintf(message, host_from_header ? host_from_header : "");
} else {
message = cookie_Localize("PermissionToSetACookie");
new_string = nsTextFormater::smprintf(message, host_from_header ? host_from_header : "");
new_string = nsTextFormatter::smprintf(message, host_from_header ? host_from_header : "");
}
Recycle(message);
@ -2295,7 +2295,7 @@ COOKIE_GetCookieListForViewer(nsString& aCookieList) {
buffer[0] = '\0';
g = 0;
g += nsTextFormater::snprintf(buffer+g, BUFLEN2-g,
g += nsTextFormatter::snprintf(buffer+g, BUFLEN2-g,
nsString("%c%d%c%s%c%s%c%S%c%s%c%s%c%S%c%S").GetUnicode(),
BREAK, cookieNum,
BREAK, fixed_name,

View File

@ -21,7 +21,7 @@
*/
#include "nsIPref.h"
#include "nsIServiceManager.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "nsUnicodeMappingUtil.h"
#include "nsUnicodeFontMappingCache.h"
#include "nsDeviceContextMac.h"
@ -264,7 +264,7 @@ PrefEnumCallback(const char* aName, void* aClosure)
}
PRUnichar valueInUCS2[FACESIZE]= { 0 };
PRUnichar format[] = { '%', 's', 0 };
PRUint32 n = nsTextFormater::snprintf(valueInUCS2, FACESIZE, format, valueInUTF8);
PRUint32 n = nsTextFormatter::snprintf(valueInUCS2, FACESIZE, format, valueInUTF8);
Recycle(valueInUTF8);
if(n == 0)
return;

View File

@ -25,7 +25,7 @@
#include "nsIServiceManager.h"
#include "nsFontMetricsWin.h"
#include "nsQuickSort.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "prmem.h"
#include "plhash.h"
@ -1512,7 +1512,7 @@ nsFontMetricsWin::LoadGenericFont(HDC aDC, PRUnichar aChar, char** aName)
}
PRUnichar name[LF_FACESIZE] = { 0 };
PRUnichar format[] = { '%', 's', 0 };
PRUint32 n = nsTextFormater::snprintf(name, LF_FACESIZE, format, *aName);
PRUint32 n = nsTextFormatter::snprintf(name, LF_FACESIZE, format, *aName);
nsAllocator::Free(*aName);
*aName = nsnull;
if (n && (n != (PRUint32) -1)) {
@ -3065,7 +3065,7 @@ nsFontMetricsWinA::LoadGenericFont(HDC aDC, PRUnichar aChar, char** aName)
}
PRUnichar name[LF_FACESIZE] = { 0 };
PRUnichar format[] = { '%', 's', 0 };
PRUint32 n = nsTextFormater::snprintf(name, LF_FACESIZE, format, *aName);
PRUint32 n = nsTextFormatter::snprintf(name, LF_FACESIZE, format, *aName);
nsAllocator::Free(*aName);
*aName = nsnull;
if (n && (n != (PRUint32) -1)) {

View File

@ -45,7 +45,7 @@
#include "nsMsgPrompts.h"
#include "nsMimeTypes.h"
#include "nsICharsetConverterManager.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "nsIEditor.h"
#include "nsIHTMLEditor.h"
#include "nsIDOMSelection.h"
@ -1247,7 +1247,7 @@ NS_IMETHODIMP QuotingOutputStreamListener::OnDataAvailable(nsIChannel * /* aChan
PRUnichar *u = nsnull;
nsAutoString fmt("%s");
u = nsTextFormater::smprintf(fmt.GetUnicode(), newBuf); // this converts UTF-8 to UCS-2
u = nsTextFormatter::smprintf(fmt.GetUnicode(), newBuf); // this converts UTF-8 to UCS-2
if (u)
{
mMsgBody.Append(u);

View File

@ -33,7 +33,7 @@
#include "nsINetSupportDialogService.h"
#include "nsIPrompt.h"
#include "nsString.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "nsIMsgIdentity.h"
#include "prtime.h"
@ -97,19 +97,19 @@ nsresult nsExplainErrorDetails(int code, ...)
case NS_ERROR_SENDING_DATA_COMMAND:
case NS_ERROR_SENDING_MESSAGE:
eMsg = ComposeGetStringByID(code);
msg = nsTextFormater::vsmprintf(eMsg, args);
msg = nsTextFormatter::vsmprintf(eMsg, args);
nsCRT::free(eMsg);
break;
default:
eMsg = ComposeGetStringByID(NS_ERROR_COMMUNICATIONS_ERROR);
msg = nsTextFormater::smprintf(eMsg, code);
msg = nsTextFormatter::smprintf(eMsg, code);
nsCRT::free(eMsg);
break;
}
if (msg) {
rv = dialog->Alert(msg);
nsTextFormater::smprintf_free(msg);
nsTextFormatter::smprintf_free(msg);
}
va_end (args);

View File

@ -37,7 +37,7 @@
#include "nsImapStringBundle.h"
#include "nsIPref.h"
#include "nsMsgFolderFlags.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "prmem.h"
#include "plstr.h"
#include "nsXPIDLString.h"
@ -1322,9 +1322,9 @@ NS_IMETHODIMP nsImapIncomingServer::PromptForPassword(char ** aPassword)
GetHostName(getter_Copies(hostName));
GetUsername(getter_Copies(userName));
passwordText = nsTextFormater::smprintf(passwordTemplate, (const char *) userName, (const char *) hostName);
passwordText = nsTextFormatter::smprintf(passwordTemplate, (const char *) userName, (const char *) hostName);
nsresult rv = GetPasswordWithUI(passwordText, passwordTitle, aPassword);
nsTextFormater::smprintf_free(passwordText);
nsTextFormatter::smprintf_free(passwordText);
nsCRT::free(passwordTemplate);
nsCRT::free(passwordTitle);
return rv;

View File

@ -40,7 +40,7 @@
#include "nsIImportFieldMap.h"
#include "nsIOutputStream.h"
#include "nsIAddrDatabase.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "nsEudoraStringBundle.h"
#include "nsEudoraSettings.h"
@ -397,9 +397,9 @@ void ImportMailImpl::ReportSuccess( nsString& name, PRInt32 count, nsString *pSt
return;
// load the success string
PRUnichar *pFmt = nsEudoraStringBundle::GetStringByID( EUDORAIMPORT_MAILBOX_SUCCESS);
PRUnichar *pText = nsTextFormater::smprintf( pFmt, name.GetUnicode(), count);
PRUnichar *pText = nsTextFormatter::smprintf( pFmt, name.GetUnicode(), count);
pStream->Append( pText);
nsTextFormater::smprintf_free( pText);
nsTextFormatter::smprintf_free( pText);
nsEudoraStringBundle::FreeString( pFmt);
AddLinebreak( pStream);
}
@ -410,10 +410,10 @@ void ImportMailImpl::ReportError( PRInt32 errorNum, nsString& name, nsString *pS
return;
// load the error string
PRUnichar *pFmt = nsEudoraStringBundle::GetStringByID( errorNum);
PRUnichar *pText = nsTextFormater::smprintf( pFmt, name.GetUnicode());
PRUnichar *pText = nsTextFormatter::smprintf( pFmt, name.GetUnicode());
pStream->Append( pText);
IMPORT_LOG1( "%S\n", pText);
nsTextFormater::smprintf_free( pText);
nsTextFormatter::smprintf_free( pText);
nsEudoraStringBundle::FreeString( pFmt);
AddLinebreak( pStream);
}

View File

@ -48,7 +48,7 @@
#include "nsOE5File.h"
#include "nsIAddrDatabase.h"
#include "nsOESettings.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "nsOEStringBundle.h"
#include "OEDebugLog.h"
@ -374,9 +374,9 @@ void ImportMailImpl::ReportSuccess( nsString& name, PRInt32 count, nsString *pSt
return;
// load the success string
PRUnichar *pFmt = nsOEStringBundle::GetStringByID( OEIMPORT_MAILBOX_SUCCESS);
PRUnichar *pText = nsTextFormater::smprintf( pFmt, name.GetUnicode(), count);
PRUnichar *pText = nsTextFormatter::smprintf( pFmt, name.GetUnicode(), count);
pStream->Append( pText);
nsTextFormater::smprintf_free( pText);
nsTextFormatter::smprintf_free( pText);
nsOEStringBundle::FreeString( pFmt);
AddLinebreak( pStream);
}
@ -387,9 +387,9 @@ void ImportMailImpl::ReportError( PRInt32 errorNum, nsString& name, nsString *pS
return;
// load the error string
PRUnichar *pFmt = nsOEStringBundle::GetStringByID( errorNum);
PRUnichar *pText = nsTextFormater::smprintf( pFmt, name.GetUnicode());
PRUnichar *pText = nsTextFormatter::smprintf( pFmt, name.GetUnicode());
pStream->Append( pText);
nsTextFormater::smprintf_free( pText);
nsTextFormatter::smprintf_free( pText);
nsOEStringBundle::FreeString( pFmt);
AddLinebreak( pStream);
}

View File

@ -44,7 +44,7 @@
#include "nsIOutputStream.h"
#include "nsIAddrDatabase.h"
#include "nsOutlookSettings.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "nsOutlookStringBundle.h"
#include "OutlookDebugLog.h"
@ -383,9 +383,9 @@ void ImportMailImpl::ReportSuccess( nsString& name, PRInt32 count, nsString *pSt
return;
// load the success string
PRUnichar *pFmt = nsOutlookStringBundle::GetStringByID( OUTLOOKIMPORT_MAILBOX_SUCCESS);
PRUnichar *pText = nsTextFormater::smprintf( pFmt, name.GetUnicode(), count);
PRUnichar *pText = nsTextFormatter::smprintf( pFmt, name.GetUnicode(), count);
pStream->Append( pText);
nsTextFormater::smprintf_free( pText);
nsTextFormatter::smprintf_free( pText);
nsOutlookStringBundle::FreeString( pFmt);
AddLinebreak( pStream);
}
@ -396,9 +396,9 @@ void ImportMailImpl::ReportError( PRInt32 errorNum, nsString& name, nsString *pS
return;
// load the error string
PRUnichar *pFmt = nsOutlookStringBundle::GetStringByID( errorNum);
PRUnichar *pText = nsTextFormater::smprintf( pFmt, name.GetUnicode());
PRUnichar *pText = nsTextFormatter::smprintf( pFmt, name.GetUnicode());
pStream->Append( pText);
nsTextFormater::smprintf_free( pText);
nsTextFormatter::smprintf_free( pText);
nsOutlookStringBundle::FreeString( pFmt);
AddLinebreak( pStream);
}

View File

@ -46,7 +46,7 @@
#include "nsAbBaseCID.h"
#include "nsIAbDirectory.h"
#include "nsImportStringBundle.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "ImportDebug.h"
static NS_DEFINE_CID(kImportServiceCID, NS_IMPORTSERVICE_CID);
@ -879,9 +879,9 @@ void nsImportGenericAddressBooks::ReportError( PRUnichar *pName, nsString *pStre
return;
// load the error string
PRUnichar *pFmt = nsImportStringBundle::GetStringByID( IMPORT_ERROR_GETABOOK);
PRUnichar *pText = nsTextFormater::smprintf( pFmt, pName);
PRUnichar *pText = nsTextFormatter::smprintf( pFmt, pName);
pStream->Append( pText);
nsTextFormater::smprintf_free( pText);
nsTextFormatter::smprintf_free( pText);
nsImportStringBundle::FreeString( pFmt);
pStream->Append( NS_LINEBREAK);
}

View File

@ -68,7 +68,7 @@
#include "nsIProfile.h"
#include "nsIMsgFolder.h"
#include "nsImportStringBundle.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "ImportDebug.h"
@ -600,9 +600,9 @@ void nsImportGenericMail::ReportError( PRInt32 id, const PRUnichar *pName, nsStr
return;
// load the error string
PRUnichar *pFmt = nsImportStringBundle::GetStringByID( id);
PRUnichar *pText = nsTextFormater::smprintf( pFmt, pName);
PRUnichar *pText = nsTextFormatter::smprintf( pFmt, pName);
pStream->Append( pText);
nsTextFormater::smprintf_free( pText);
nsTextFormatter::smprintf_free( pText);
nsImportStringBundle::FreeString( pFmt);
pStream->Append( NS_LINEBREAK);
}

View File

@ -36,7 +36,7 @@
#include "nsIImportFieldMap.h"
#include "nsIOutputStream.h"
#include "nsIAddrDatabase.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "nsTextStringBundle.h"
#include "nsTextAddress.h"
@ -400,9 +400,9 @@ void ImportAddressImpl::ReportError( PRInt32 errorNum, nsString& name, nsString
return;
// load the error string
PRUnichar *pFmt = nsTextStringBundle::GetStringByID( errorNum);
PRUnichar *pText = nsTextFormater::smprintf( pFmt, name.GetUnicode());
PRUnichar *pText = nsTextFormatter::smprintf( pFmt, name.GetUnicode());
pStream->Append( pText);
nsTextFormater::smprintf_free( pText);
nsTextFormatter::smprintf_free( pText);
nsTextStringBundle::FreeString( pFmt);
pStream->Append( NS_LINEBREAK);
}

View File

@ -38,7 +38,7 @@
#include "nsIPrompt.h"
#include "nsIMsgIncomingServer.h"
#include "nsLocalStringBundle.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "nsCOMPtr.h"
#include "nsIPref.h"
@ -533,18 +533,18 @@ nsresult nsPop3Protocol::GetPassword(char ** aPassword)
{
PRUnichar *passwordTemplate = LocalGetStringByID(POP3_PREVIOUSLY_ENTERED_PASSWORD_IS_INVALID_ETC);
if (m_commandResponse.Length())
passwordPromptString = nsTextFormater::smprintf(passwordTemplate, m_commandResponse.GetBuffer(), (const char *) userName, (const char *) hostName);
passwordPromptString = nsTextFormatter::smprintf(passwordTemplate, m_commandResponse.GetBuffer(), (const char *) userName, (const char *) hostName);
else
{
PRUnichar * noAnswerText = LocalGetStringByID(POP3_NO_ANSWER);
passwordPromptString = nsTextFormater::smprintf(passwordTemplate, noAnswerText, (const char *) userName, (const char *) hostName);
passwordPromptString = nsTextFormatter::smprintf(passwordTemplate, noAnswerText, (const char *) userName, (const char *) hostName);
nsCRT::free(noAnswerText);
}
} // otherwise this is the first time we've asked about the server's password so show a first time prompt
else
{
PRUnichar * passwordTemplate = LocalGetStringByID(POP3_ENTER_PASSWORD_PROMPT);
passwordPromptString = nsTextFormater::smprintf(passwordTemplate, (const char *) userName, (const char *) hostName);
passwordPromptString = nsTextFormatter::smprintf(passwordTemplate, (const char *) userName, (const char *) hostName);
nsCRT::free(passwordTemplate);
}
@ -552,7 +552,7 @@ nsresult nsPop3Protocol::GetPassword(char ** aPassword)
PRUnichar * passwordTitle = LocalGetStringByID(POP3_ENTER_PASSWORD_PROMPT_TITLE);
rv = server->GetPasswordWithUI(passwordPromptString, passwordTitle, aPassword);
nsCRT::free(passwordTitle);
nsTextFormater::smprintf_free(passwordPromptString);
nsTextFormatter::smprintf_free(passwordPromptString);
ClearFlag(POP3_PASSWORD_FAILED);
} // if we have a server
@ -1290,11 +1290,11 @@ PRInt32 nsPop3Protocol::GetFakeUidlTop(nsIInputStream* inputStream,
m_url->GetHost(getter_Copies(hostName));
if (hostName)
statusString = nsTextFormater::smprintf(statusTemplate, (const char *) hostName);
statusString = nsTextFormatter::smprintf(statusTemplate, (const char *) hostName);
else
statusString = nsTextFormater::smprintf(statusTemplate, "(null)");
statusString = nsTextFormatter::smprintf(statusTemplate, "(null)");
UpdateStatusWithString(statusString);
nsTextFormater::smprintf_free(statusString);
nsTextFormatter::smprintf_free(statusString);
nsCRT::free(statusTemplate);
}
@ -2182,11 +2182,11 @@ nsPop3Protocol::TopResponse(nsIInputStream* inputStream, PRUint32 length)
m_url->GetHost(getter_Copies(hostName));
if (hostName)
statusString = nsTextFormater::smprintf(statusTemplate, (const char *) hostName);
statusString = nsTextFormatter::smprintf(statusTemplate, (const char *) hostName);
else
statusString = nsTextFormater::smprintf(statusTemplate, "(null)");
statusString = nsTextFormatter::smprintf(statusTemplate, "(null)");
UpdateStatusWithString(statusString);
nsTextFormater::smprintf_free(statusString);
nsTextFormatter::smprintf_free(statusString);
nsCRT::free(statusTemplate);
}
@ -2683,11 +2683,11 @@ nsresult nsPop3Protocol::ProcessProtocolState(nsIURI * url, nsIInputStream * aIn
PRUnichar * statusTemplate = LocalGetStringByID(POP3_DOWNLOAD_COUNT);
if (statusTemplate)
{
PRUnichar * statusString = nsTextFormater::smprintf(statusTemplate,
PRUnichar * statusString = nsTextFormatter::smprintf(statusTemplate,
m_pop3ConData->real_new_counter - 1,
m_pop3ConData->really_new_messages);
UpdateStatusWithString(statusString);
nsTextFormater::smprintf_free(statusString);
nsTextFormatter::smprintf_free(statusString);
nsCRT::free(statusTemplate);
}
@ -2767,11 +2767,11 @@ nsresult nsPop3Protocol::ProcessProtocolState(nsIURI * url, nsIInputStream * aIn
PRUnichar * statusTemplate = LocalGetStringByID(POP3_DOWNLOAD_COUNT);
if (statusTemplate)
{
PRUnichar * statusString = nsTextFormater::smprintf(statusTemplate,
PRUnichar * statusString = nsTextFormatter::smprintf(statusTemplate,
m_pop3ConData->real_new_counter - 1,
m_pop3ConData->really_new_messages);
UpdateStatusWithString(statusString);
nsTextFormater::smprintf_free(statusString);
nsTextFormatter::smprintf_free(statusString);
nsCRT::free(statusTemplate);
}

View File

@ -41,7 +41,7 @@
#include "nsIStringCharsetDetector.h"
#include "nsIPref.h"
#include "mimebuf.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "nsMsgI18N.h"
#include "nsMimeTypes.h"
@ -767,7 +767,7 @@ convert_and_encode:
nsAutoString fmt("%s");
char aChar = begin[len];
begin[len] = '\0';
u = nsTextFormater::smprintf(fmt.GetUnicode(), begin);
u = nsTextFormatter::smprintf(fmt.GetUnicode(), begin);
begin[len] = aChar;
if (NULL == u) {
PR_FREEIF(srcbuf);
@ -777,7 +777,7 @@ convert_and_encode:
nsresult rv = nsMsgI18NSaveAsCharset(TEXT_PLAIN,
!nsCRT::strcasecmp(charset, "us-ascii") ? "ISO-8859-1" : charset,
u, &buf1);
nsTextFormater::smprintf_free(u);
nsTextFormatter::smprintf_free(u);
if (NS_FAILED(rv) || NULL == buf1) {
PR_FREEIF(srcbuf);
PR_FREEIF(retbuf);

View File

@ -43,7 +43,7 @@
#include "nsIProfile.h"
#include "nsQuickSort.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "plhash.h"
#include "prmem.h"
@ -717,13 +717,13 @@ NS_IMETHODIMP nsPref::CopyUnicharPref(const char *pref, PRUnichar ** return_buf)
// convert to PRUnichar using nsTextFormatter
// this is so ugly, it allocates memory at least 4 times :(
PRUnichar *unicodeString =
nsTextFormater::smprintf(unicodeFormatter, utf8String);
nsTextFormatter::smprintf(unicodeFormatter, utf8String);
PL_strfree(utf8String);
if (!unicodeString) return NS_ERROR_OUT_OF_MEMORY;
// use the right allocator
*return_buf = nsCRT::strdup(unicodeString);
nsTextFormater::smprintf_free(unicodeString);
nsTextFormatter::smprintf_free(unicodeString);
if (!*return_buf) return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;

View File

@ -53,7 +53,7 @@
#include "nsCWeakReference.h"
#include "nsWeakReference.h"
#include "nsISizeOfHandler.h"
#include "nsTextFormater.h"
#include "nsTextFormatter.h"
#include "nsStorageStream.h"
#include "nsLinebreakConverter.h"
#include "nsIBinaryInputStream.h"
@ -77,7 +77,7 @@ TestSegmentedBuffer();
void XXXNeverCalled()
{
nsTextFormater::snprintf(nsnull,0,nsnull);
nsTextFormatter::snprintf(nsnull,0,nsnull);
dummyComparitor dummy;
nsVoidArray();
nsAVLTree(dummy, nsnull);

View File

@ -64,7 +64,7 @@ CPPSRCS = \
nsUnicharBuffer.cpp \
nsVoidArray.cpp \
nsXPIDLString.cpp \
nsTextFormater.cpp \
nsTextFormatter.cpp \
$(NULL)
EXPORTS = \
@ -95,7 +95,7 @@ EXPORTS = \
nsVoidArray.h \
nsXPIDLString.h \
plvector.h \
nsTextFormater.h \
nsTextFormatter.h \
$(NULL)
XPIDLSRCS = \

View File

@ -28,7 +28,7 @@ MODULE = xpcom
## exports
EXPORTS = \
nsTextFormater.h \
nsTextFormatter.h \
nsAVLTree.h \
nsCppSharedAllocator.h \
nsCRT.h \
@ -85,7 +85,7 @@ LINCS = \
LCFLAGS = -D_IMPL_NS_COM -D_IMPL_NS_BASE -DWIN32_LEAN_AND_MEAN
CPP_OBJS = \
.\$(OBJDIR)\nsTextFormater.obj \
.\$(OBJDIR)\nsTextFormatter.obj \
.\$(OBJDIR)\nsArena.obj \
.\$(OBJDIR)\nsAtomTable.obj \
.\$(OBJDIR)\nsAVLTree.obj \