bug 73339: Remove NS_ConvertToString (just another name for NS_ConvertASCIItoUCS2) from the tree. r=jst, sr=scc

This commit is contained in:
disttsc%bart.nl 2001-03-27 11:17:17 +00:00
Родитель 353a824cd2
Коммит f4edb65ad4
39 изменённых файлов: 127 добавлений и 177 удалений

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

@ -2899,7 +2899,7 @@ NS_IMETHODIMP nsDocViwerSelectionListener::NotifySelectionChanged(nsIDOMDocument
nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(scriptGlobalObject);
if (!domWindow) return NS_ERROR_FAILURE;
domWindow->UpdateCommands(NS_ConvertToString("select"));
domWindow->UpdateCommands(NS_LITERAL_STRING("select"));
mGotSelectionState = PR_TRUE;
mSelectionWasCollapsed = selectionCollapsed;
}

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

@ -52,11 +52,11 @@ static void AddRefTable()
gURIToIDTable = new nsHashtable();
gURIArray = new nsVoidArray();
nsString* xmlns = new nsString( NS_ConvertToString(kXMLNSNameSpaceURI) );
nsString* xml = new nsString( NS_ConvertToString(kXMLNameSpaceURI) );
nsString* xhtml = new nsString( NS_ConvertToString(kXHTMLNameSpaceURI) );
nsString* xlink = new nsString( NS_ConvertToString(kXLinkNameSpaceURI) );
nsString* html = new nsString( NS_ConvertToString(kHTMLNameSpaceURI) );
nsString* xmlns = new nsString( NS_ConvertASCIItoUCS2(kXMLNSNameSpaceURI) );
nsString* xml = new nsString( NS_ConvertASCIItoUCS2(kXMLNameSpaceURI) );
nsString* xhtml = new nsString( NS_ConvertASCIItoUCS2(kXHTMLNameSpaceURI) );
nsString* xlink = new nsString( NS_ConvertASCIItoUCS2(kXLinkNameSpaceURI) );
nsString* html = new nsString( NS_ConvertASCIItoUCS2(kHTMLNameSpaceURI) );
gURIArray->AppendElement(xmlns); // ordering here needs to match IDs
gURIArray->AppendElement(xml);
gURIArray->AppendElement(xhtml);

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

@ -135,7 +135,7 @@ ContentScriptNameSet::AddNameSet(nsIScriptContext* aScriptContext)
result = aScriptContext->GetNameSpaceManager(&manager);
if (NS_OK == result) {
result = manager->RegisterGlobalName(NS_ConvertToString("HTMLImageElement"),
result = manager->RegisterGlobalName(NS_LITERAL_STRING("HTMLImageElement"),
NS_GET_IID(nsIScriptObjectOwner),
kHTMLImageElementCID,
PR_TRUE);
@ -144,7 +144,7 @@ ContentScriptNameSet::AddNameSet(nsIScriptContext* aScriptContext)
return result;
}
result = manager->RegisterGlobalName(NS_ConvertToString("HTMLOptionElement"),
result = manager->RegisterGlobalName(NS_LITERAL_STRING("HTMLOptionElement"),
NS_GET_IID(nsIScriptObjectOwner),
kHTMLOptionElementCID,
PR_TRUE);

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

@ -54,7 +54,7 @@ public:
* a constructor. PR_FALSE if it is a global object.
* @result NS_OK if successful
*/
NS_IMETHOD RegisterGlobalName(const nsString& aName,
NS_IMETHOD RegisterGlobalName(const nsAReadableString& aName,
const nsIID& aIID,
const nsIID& aCID,
PRBool aIsConstructor) = 0;
@ -65,7 +65,7 @@ public:
* @param aName the name to remove
* @result NS_OK if successful
*/
NS_IMETHOD UnregisterGlobalName(const nsString& aName) = 0;
NS_IMETHOD UnregisterGlobalName(const nsAReadableString& aName) = 0;
/**
* Used to look up the manager using a name as a key. The
@ -83,7 +83,7 @@ public:
* @result NS_OK if the lookup succeeded. NS_ERROR_INVALID_ARG
* if the lookup failed.
*/
NS_IMETHOD LookupName(const nsString& aName,
NS_IMETHOD LookupName(const nsAReadableString& aName,
PRBool& aIsConstructor,
nsIID& aIID,
nsIID& aCID) = 0;

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

@ -22,6 +22,7 @@
#include "nsScriptNameSpaceManager.h"
#include "prmem.h"
#include "nsReadableUtils.h"
typedef struct {
nsIID mIID;
@ -56,12 +57,10 @@ nsScriptNameSpaceManager::~nsScriptNameSpaceManager()
}
}
static NS_DEFINE_IID(kIScriptNameSpaceManagerIID, NS_ISCRIPTNAMESPACEMANAGER_IID);
NS_IMPL_ISUPPORTS(nsScriptNameSpaceManager, kIScriptNameSpaceManagerIID);
NS_IMPL_ISUPPORTS1(nsScriptNameSpaceManager, nsIScriptNameSpaceManager);
NS_IMETHODIMP
nsScriptNameSpaceManager::RegisterGlobalName(const nsString& aName,
nsScriptNameSpaceManager::RegisterGlobalName(const nsAReadableString& aName,
const nsIID& aIID,
const nsIID& aCID,
PRBool aIsConstructor)
@ -71,7 +70,6 @@ nsScriptNameSpaceManager::RegisterGlobalName(const nsString& aName,
PL_CompareValues, nsnull, nsnull);
}
char* name = aName.ToNewCString();
nsGlobalNameStruct* gn = (nsGlobalNameStruct*)PR_NEW(nsGlobalNameStruct);
if (nsnull == gn) {
return NS_ERROR_OUT_OF_MEMORY;
@ -80,16 +78,17 @@ nsScriptNameSpaceManager::RegisterGlobalName(const nsString& aName,
gn->mCID = aCID;
gn->mIsConstructor = aIsConstructor;
char* name = ToNewCString(aName);
PL_HashTableAdd(mGlobalNames, name, (void *)gn);
return NS_OK;
}
NS_IMETHODIMP
nsScriptNameSpaceManager::UnregisterGlobalName(const nsString& aName)
nsScriptNameSpaceManager::UnregisterGlobalName(const nsAReadableString& aName)
{
if (nsnull != mGlobalNames) {
char* name = aName.ToNewCString();
char* name = ToNewCString(aName);
PLHashNumber hn = PL_HashString(name);
PLHashEntry** hep = PL_HashTableRawLookup(mGlobalNames,
hn,
@ -98,7 +97,7 @@ nsScriptNameSpaceManager::UnregisterGlobalName(const nsString& aName)
if (nsnull != entry) {
nsGlobalNameStruct* gn = (nsGlobalNameStruct*)entry->value;
char* hname = (char*)entry->key;;
char* hname = (char*)entry->key;
delete gn;
PL_HashTableRemove(mGlobalNames, name);
@ -112,13 +111,13 @@ nsScriptNameSpaceManager::UnregisterGlobalName(const nsString& aName)
}
NS_IMETHODIMP
nsScriptNameSpaceManager::LookupName(const nsString& aName,
nsScriptNameSpaceManager::LookupName(const nsAReadableString& aName,
PRBool& aIsConstructor,
nsIID& aIID,
nsIID& aCID)
{
if (nsnull != mGlobalNames) {
char* name = aName.ToNewCString();
char* name = ToNewCString(aName);
nsGlobalNameStruct* gn = (nsGlobalNameStruct*)PL_HashTableLookup(mGlobalNames, name);
nsCRT::free(name);
@ -148,7 +147,6 @@ NS_NewScriptNameSpaceManager(nsIScriptNameSpaceManager** aInstancePtr)
return NS_ERROR_OUT_OF_MEMORY;
}
return manager->QueryInterface(kIScriptNameSpaceManagerIID, (void **)aInstancePtr);
return manager->QueryInterface(NS_GET_IID(nsIScriptNameSpaceManager), (void **)aInstancePtr);
}

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

@ -46,12 +46,12 @@ class nsScriptNameSpaceManager : public nsIScriptNameSpaceManager {
NS_DECL_ISUPPORTS
NS_IMETHOD RegisterGlobalName(const nsString& aName,
NS_IMETHOD RegisterGlobalName(const nsAReadableString& aName,
const nsIID& aIID,
const nsIID& aCID,
PRBool aIsConstructor);
NS_IMETHOD UnregisterGlobalName(const nsString& aName);
NS_IMETHOD LookupName(const nsString& aName,
NS_IMETHOD UnregisterGlobalName(const nsAReadableString& aName);
NS_IMETHOD LookupName(const nsAReadableString& aName,
PRBool& aIsConstructor,
nsIID& aIID,
nsIID& aCID);

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

@ -22,6 +22,7 @@
#include "nsScriptNameSpaceManager.h"
#include "prmem.h"
#include "nsReadableUtils.h"
typedef struct {
nsIID mIID;
@ -56,12 +57,10 @@ nsScriptNameSpaceManager::~nsScriptNameSpaceManager()
}
}
static NS_DEFINE_IID(kIScriptNameSpaceManagerIID, NS_ISCRIPTNAMESPACEMANAGER_IID);
NS_IMPL_ISUPPORTS(nsScriptNameSpaceManager, kIScriptNameSpaceManagerIID);
NS_IMPL_ISUPPORTS1(nsScriptNameSpaceManager, nsIScriptNameSpaceManager);
NS_IMETHODIMP
nsScriptNameSpaceManager::RegisterGlobalName(const nsString& aName,
nsScriptNameSpaceManager::RegisterGlobalName(const nsAReadableString& aName,
const nsIID& aIID,
const nsIID& aCID,
PRBool aIsConstructor)
@ -71,7 +70,6 @@ nsScriptNameSpaceManager::RegisterGlobalName(const nsString& aName,
PL_CompareValues, nsnull, nsnull);
}
char* name = aName.ToNewCString();
nsGlobalNameStruct* gn = (nsGlobalNameStruct*)PR_NEW(nsGlobalNameStruct);
if (nsnull == gn) {
return NS_ERROR_OUT_OF_MEMORY;
@ -80,16 +78,17 @@ nsScriptNameSpaceManager::RegisterGlobalName(const nsString& aName,
gn->mCID = aCID;
gn->mIsConstructor = aIsConstructor;
char* name = ToNewCString(aName);
PL_HashTableAdd(mGlobalNames, name, (void *)gn);
return NS_OK;
}
NS_IMETHODIMP
nsScriptNameSpaceManager::UnregisterGlobalName(const nsString& aName)
nsScriptNameSpaceManager::UnregisterGlobalName(const nsAReadableString& aName)
{
if (nsnull != mGlobalNames) {
char* name = aName.ToNewCString();
char* name = ToNewCString(aName);
PLHashNumber hn = PL_HashString(name);
PLHashEntry** hep = PL_HashTableRawLookup(mGlobalNames,
hn,
@ -98,7 +97,7 @@ nsScriptNameSpaceManager::UnregisterGlobalName(const nsString& aName)
if (nsnull != entry) {
nsGlobalNameStruct* gn = (nsGlobalNameStruct*)entry->value;
char* hname = (char*)entry->key;;
char* hname = (char*)entry->key;
delete gn;
PL_HashTableRemove(mGlobalNames, name);
@ -112,13 +111,13 @@ nsScriptNameSpaceManager::UnregisterGlobalName(const nsString& aName)
}
NS_IMETHODIMP
nsScriptNameSpaceManager::LookupName(const nsString& aName,
nsScriptNameSpaceManager::LookupName(const nsAReadableString& aName,
PRBool& aIsConstructor,
nsIID& aIID,
nsIID& aCID)
{
if (nsnull != mGlobalNames) {
char* name = aName.ToNewCString();
char* name = ToNewCString(aName);
nsGlobalNameStruct* gn = (nsGlobalNameStruct*)PL_HashTableLookup(mGlobalNames, name);
nsCRT::free(name);
@ -148,7 +147,6 @@ NS_NewScriptNameSpaceManager(nsIScriptNameSpaceManager** aInstancePtr)
return NS_ERROR_OUT_OF_MEMORY;
}
return manager->QueryInterface(kIScriptNameSpaceManagerIID, (void **)aInstancePtr);
return manager->QueryInterface(NS_GET_IID(nsIScriptNameSpaceManager), (void **)aInstancePtr);
}

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

@ -46,12 +46,12 @@ class nsScriptNameSpaceManager : public nsIScriptNameSpaceManager {
NS_DECL_ISUPPORTS
NS_IMETHOD RegisterGlobalName(const nsString& aName,
NS_IMETHOD RegisterGlobalName(const nsAReadableString& aName,
const nsIID& aIID,
const nsIID& aCID,
PRBool aIsConstructor);
NS_IMETHOD UnregisterGlobalName(const nsString& aName);
NS_IMETHOD LookupName(const nsString& aName,
NS_IMETHOD UnregisterGlobalName(const nsAReadableString& aName);
NS_IMETHOD LookupName(const nsAReadableString& aName,
PRBool& aIsConstructor,
nsIID& aIID,
nsIID& aCID);

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

@ -115,11 +115,11 @@ void nsUnicodeMappingUtil::InitGenericFontMapping()
// We probabaly should put the following info into resource ....
// smRoman
mGenericFontMapping[smRoman][kSerif] = new nsAutoString( NS_ConvertToString("Times") );
mGenericFontMapping[smRoman][kSansSerif] = new nsAutoString( NS_ConvertToString("Helvetica") ); // note: MRJ use Geneva for Sans-Serif
mGenericFontMapping[smRoman][kMonospace] = new nsAutoString( NS_ConvertToString("Courier") );
mGenericFontMapping[smRoman][kCursive] = new nsAutoString( NS_ConvertToString("Zapf Chancery") );
mGenericFontMapping[smRoman][kFantasy] = new nsAutoString( NS_ConvertToString("New Century Schlbk") );
mGenericFontMapping[smRoman][kSerif] = new nsAutoString( NS_LITERAL_STRING("Times") );
mGenericFontMapping[smRoman][kSansSerif] = new nsAutoString( NS_LITERAL_STRING("Helvetica") ); // note: MRJ use Geneva for Sans-Serif
mGenericFontMapping[smRoman][kMonospace] = new nsAutoString( NS_LITERAL_STRING("Courier") );
mGenericFontMapping[smRoman][kCursive] = new nsAutoString( NS_LITERAL_STRING("Zapf Chancery") );
mGenericFontMapping[smRoman][kFantasy] = new nsAutoString( NS_LITERAL_STRING("New Century Schlbk") );
// smJapanese
static PRUnichar jfontname1[] = {
@ -137,14 +137,14 @@ void nsUnicodeMappingUtil::InitGenericFontMapping()
mGenericFontMapping[smJapanese][kMonospace] = new nsAutoString(jfontname3);
// smTradChinese
mGenericFontMapping[smTradChinese][kSerif] = new nsAutoString( NS_ConvertToString("Apple LiSung Light") );
mGenericFontMapping[smTradChinese][kSansSerif] = new nsAutoString( NS_ConvertToString("Apple LiGothic Medium") );
mGenericFontMapping[smTradChinese][kMonospace] = new nsAutoString( NS_ConvertToString("Apple LiGothic Medium") );
mGenericFontMapping[smTradChinese][kSerif] = new nsAutoString( NS_LITERAL_STRING("Apple LiSung Light") );
mGenericFontMapping[smTradChinese][kSansSerif] = new nsAutoString( NS_LITERAL_STRING("Apple LiGothic Medium") );
mGenericFontMapping[smTradChinese][kMonospace] = new nsAutoString( NS_LITERAL_STRING("Apple LiGothic Medium") );
// smKorean
mGenericFontMapping[smKorean][kSerif] = new nsAutoString( NS_ConvertToString("AppleMyungjo") );
mGenericFontMapping[smKorean][kSansSerif] = new nsAutoString( NS_ConvertToString("AppleGothic") );
mGenericFontMapping[smKorean][kMonospace] = new nsAutoString( NS_ConvertToString("AppleGothic") );
mGenericFontMapping[smKorean][kSerif] = new nsAutoString( NS_LITERAL_STRING("AppleMyungjo") );
mGenericFontMapping[smKorean][kSansSerif] = new nsAutoString( NS_LITERAL_STRING("AppleGothic") );
mGenericFontMapping[smKorean][kMonospace] = new nsAutoString( NS_LITERAL_STRING("AppleGothic") );
// smArabic
static PRUnichar afontname1[] = {
@ -173,40 +173,39 @@ void nsUnicodeMappingUtil::InitGenericFontMapping()
mGenericFontMapping[smHebrew][kMonospace] = new nsAutoString(hfontname2);
// smCyrillic
mGenericFontMapping[smCyrillic][kSerif] = new nsAutoString( NS_ConvertToString("Latinski") );
mGenericFontMapping[smCyrillic][kSansSerif] = new nsAutoString( NS_ConvertToString("Pryamoy Prop") );
mGenericFontMapping[smCyrillic][kMonospace] = new nsAutoString( NS_ConvertToString("APC Courier") );
mGenericFontMapping[smCyrillic][kSerif] = new nsAutoString( NS_LITERAL_STRING("Latinski") );
mGenericFontMapping[smCyrillic][kSansSerif] = new nsAutoString( NS_LITERAL_STRING("Pryamoy Prop") );
mGenericFontMapping[smCyrillic][kMonospace] = new nsAutoString( NS_LITERAL_STRING("APC Courier") );
// smDevanagari
mGenericFontMapping[smDevanagari][kSerif] = new nsAutoString( NS_ConvertToString("Devanagari MT") );
mGenericFontMapping[smDevanagari][kSansSerif] = new nsAutoString( NS_ConvertToString("Devanagari MT") );
mGenericFontMapping[smDevanagari][kMonospace] = new nsAutoString( NS_ConvertToString("Devanagari MT") );
mGenericFontMapping[smDevanagari][kSerif] = new nsAutoString( NS_LITERAL_STRING("Devanagari MT") );
mGenericFontMapping[smDevanagari][kSansSerif] = new nsAutoString( NS_LITERAL_STRING("Devanagari MT") );
mGenericFontMapping[smDevanagari][kMonospace] = new nsAutoString( NS_LITERAL_STRING("Devanagari MT") );
// smGurmukhi
static nsAutoString gurukhiMT_str( NS_ConvertToString("Gurmukhi MT") );
mGenericFontMapping[smGurmukhi][kSerif] = new nsAutoString( NS_ConvertToString("Gurmukhi MT") );
mGenericFontMapping[smGurmukhi][kSansSerif] = new nsAutoString( NS_ConvertToString("Gurmukhi MT") );
mGenericFontMapping[smGurmukhi][kMonospace] = new nsAutoString( NS_ConvertToString("Gurmukhi MT") );
mGenericFontMapping[smGurmukhi][kSerif] = new nsAutoString( NS_LITERAL_STRING("Gurmukhi MT") );
mGenericFontMapping[smGurmukhi][kSansSerif] = new nsAutoString( NS_LITERAL_STRING("Gurmukhi MT") );
mGenericFontMapping[smGurmukhi][kMonospace] = new nsAutoString( NS_LITERAL_STRING("Gurmukhi MT") );
// smGujarati
mGenericFontMapping[smGujarati][kSerif] = new nsAutoString( NS_ConvertToString("Gujarati MT") );
mGenericFontMapping[smGujarati][kSansSerif] = new nsAutoString( NS_ConvertToString("Gujarati MT") );
mGenericFontMapping[smGujarati][kMonospace] = new nsAutoString( NS_ConvertToString("Gujarati MT") );
mGenericFontMapping[smGujarati][kSerif] = new nsAutoString( NS_LITERAL_STRING("Gujarati MT") );
mGenericFontMapping[smGujarati][kSansSerif] = new nsAutoString( NS_LITERAL_STRING("Gujarati MT") );
mGenericFontMapping[smGujarati][kMonospace] = new nsAutoString( NS_LITERAL_STRING("Gujarati MT") );
// smThai
mGenericFontMapping[smThai][kSerif] = new nsAutoString( NS_ConvertToString("Thonburi") );
mGenericFontMapping[smThai][kSansSerif] = new nsAutoString( NS_ConvertToString("Krungthep") );
mGenericFontMapping[smThai][kMonospace] = new nsAutoString( NS_ConvertToString("Ayuthaya") );
mGenericFontMapping[smThai][kSerif] = new nsAutoString( NS_LITERAL_STRING("Thonburi") );
mGenericFontMapping[smThai][kSansSerif] = new nsAutoString( NS_LITERAL_STRING("Krungthep") );
mGenericFontMapping[smThai][kMonospace] = new nsAutoString( NS_LITERAL_STRING("Ayuthaya") );
// smSimpChinese
mGenericFontMapping[smSimpChinese][kSerif] = new nsAutoString( NS_ConvertToString("Song") );
mGenericFontMapping[smSimpChinese][kSansSerif] = new nsAutoString( NS_ConvertToString("Hei") );
mGenericFontMapping[smSimpChinese][kMonospace] = new nsAutoString( NS_ConvertToString("Hei") );
mGenericFontMapping[smSimpChinese][kSerif] = new nsAutoString( NS_LITERAL_STRING("Song") );
mGenericFontMapping[smSimpChinese][kSansSerif] = new nsAutoString( NS_LITERAL_STRING("Hei") );
mGenericFontMapping[smSimpChinese][kMonospace] = new nsAutoString( NS_LITERAL_STRING("Hei") );
// smCentralEuroRoman
mGenericFontMapping[smCentralEuroRoman][kSerif] = new nsAutoString( NS_ConvertToString("Times CE") );
mGenericFontMapping[smCentralEuroRoman][kSansSerif] = new nsAutoString( NS_ConvertToString("Helvetica CE") );
mGenericFontMapping[smCentralEuroRoman][kMonospace] = new nsAutoString( NS_ConvertToString("Courier CE") );
mGenericFontMapping[smCentralEuroRoman][kSerif] = new nsAutoString( NS_LITERAL_STRING("Times CE") );
mGenericFontMapping[smCentralEuroRoman][kSansSerif] = new nsAutoString( NS_LITERAL_STRING("Helvetica CE") );
mGenericFontMapping[smCentralEuroRoman][kMonospace] = new nsAutoString( NS_LITERAL_STRING("Courier CE") );
}
//--------------------------------------------------------------------------

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

@ -494,7 +494,7 @@ nsresult CNavDTD::BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsIToke
}
}
//if the content model is empty, then begin by opening <html>...
theToken=NS_STATIC_CAST(CStartToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_html,NS_ConvertToString("html")));
theToken=NS_STATIC_CAST(CStartToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_html,NS_LITERAL_STRING("html")));
if(theToken) {
mTokenizer->PushTokenFront(theToken); //this token should get pushed on the context stack.
}
@ -547,7 +547,7 @@ nsresult CNavDTD::DidBuildModel(nsresult anErrorCode,PRBool aNotifySink,nsIParse
mSkipTarget=eHTMLTag_unknown; //clear this in case we were searching earlier.
CStartToken *theToken=NS_STATIC_CAST(CStartToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_body,NS_ConvertToString("body")));
CStartToken *theToken=NS_STATIC_CAST(CStartToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_body,NS_LITERAL_STRING("body")));
mTokenizer->PushTokenFront(theToken); //this token should get pushed on the context stack, don't recycle it
result=BuildModel(aParser,mTokenizer,0,aSink);
}
@ -788,7 +788,7 @@ nsresult CNavDTD::HandleToken(CToken* aToken,nsIParser* aParser){
//However, in quirks mode, a few tags request, ambiguosly, for a BODY. - Bugs 18928, 24204.-
mMisplacedContent.Push(aToken);
if(mDTDMode==eDTDMode_quirks && (gHTMLElements[theTag].HasSpecialProperty(kRequiresBody))) {
CToken* theBodyToken=NS_STATIC_CAST(CToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_body,NS_ConvertToString("body")));
CToken* theBodyToken=NS_STATIC_CAST(CToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_body,NS_LITERAL_STRING("body")));
result=HandleToken(theBodyToken,aParser);
}
return result;

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

@ -317,7 +317,7 @@ eAutoDetectResult COtherDTD::CanParse(CParserContext& aParserContext,nsString& a
if(BufferContainsHTML(aBuffer,theBufHasXML)){
result = eValidDetect ;
if(0==aParserContext.mMimeType.Length()) {
aParserContext.SetMimeType(NS_ConvertToString(kHTMLTextContentType));
aParserContext.SetMimeType(NS_ConvertASCIItoUCS2(kHTMLTextContentType));
if(!theBufHasXML) {
switch(aParserContext.mDTDMode) {
case eDTDMode_strict:
@ -417,7 +417,7 @@ nsresult COtherDTD::BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsITo
if(!mBodyContext->GetCount()) {
//if the content model is empty, then begin by opening <html>...
CStartToken *theToken=(CStartToken*)mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_html,NS_ConvertToString("html"));
CStartToken *theToken=(CStartToken*)mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_html,NS_LITERAL_STRING("html"));
HandleStartToken(theToken); //this token should get pushed on the context stack, don't recycle it.
}
@ -668,7 +668,7 @@ nsresult COtherDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsIParserNo
CObserverService* theService=mParser->GetObserverService();
if(theService) {
const nsISupportsParserBundle* bundle=mParser->GetParserBundle();
result=theService->Notify(aTag,aNode,(void*)bundle, NS_ConvertToString(kHTMLTextContentType), mParser);
result=theService->Notify(aTag,aNode,(void*)bundle, NS_ConvertASCIItoUCS2(kHTMLTextContentType), mParser);
}
}

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

@ -757,7 +757,7 @@ nsresult CRtfDTD::HandleControlWord(CToken* aToken){
break;
case eRTFCtrl_tab:
{
CTextToken theToken2( NS_ConvertToString(" ") );
CTextToken theToken2( NS_LITERAL_STRING(" ") );
result=HandleContent(&theToken2);
}
break;

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

@ -180,7 +180,7 @@ eAutoDetectResult nsExpatDTD::CanParse(CParserContext& aParserContext,nsString&
else {
if(-1<aBuffer.Find("<?xml ")) {
if(0==aParserContext.mMimeType.Length()) {
aParserContext.SetMimeType( NS_ConvertToString(kXMLTextContentType) );
aParserContext.SetMimeType( NS_ConvertASCIItoUCS2(kXMLTextContentType) );
}
result=eValidDetect;
}

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

@ -56,7 +56,7 @@ static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID);
const int gTabSize=2;
static const nsString gMozDirty = NS_ConvertToString("_moz_dirty");
static const NS_NAMED_LITERAL_STRING(gMozDirty, "_moz_dirty");
/**
* This method gets called as part of our COM-like interfaces.

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

@ -226,7 +226,7 @@ public:
}
// Make sure we don't find things that aren't there
value = nsHTMLEntities::EntityToUnicode(NS_ConvertToString("@"));
value = nsHTMLEntities::EntityToUnicode(nsCAutoString("@"));
NS_ASSERTION(value == -1, "found @");
value = nsHTMLEntities::EntityToUnicode(nsCAutoString("zzzzz"));
NS_ASSERTION(value == -1, "found zzzzz");

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

@ -527,7 +527,7 @@ PRInt32 CTextToken::GetTextLength(void) {
* @return error result
*/
nsresult CTextToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aMode) {;
static nsString theTerminals = NS_ConvertToString("\n\r&<",4);
static nsString theTerminals = NS_LITERAL_STRING("\n\r&<");
nsresult result=NS_OK;
PRBool done=PR_FALSE;
nsReadingIterator<PRUnichar> origin, start, end;
@ -897,7 +897,7 @@ PRInt32 CMarkupDeclToken::GetTokenType(void) {
* @return error result
*/
nsresult CMarkupDeclToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aMode) {
static nsString theTerminals = NS_ConvertToString("\n\r'\">",5);
static nsString theTerminals = NS_LITERAL_STRING("\n\r'\">");
nsresult result=NS_OK;
PRBool done=PR_FALSE;
PRUnichar quote=0;
@ -1521,7 +1521,7 @@ nsresult ConsumeQuotedString(PRUnichar aChar,nsString& aString,nsScanner& aScann
*/
static
nsresult ConsumeAttributeValueText(PRUnichar,nsString& aString,nsScanner& aScanner){
static nsString theTerminals = NS_ConvertToString("\b\t\n\r >",6);
static nsString theTerminals = NS_LITERAL_STRING("\b\t\n\r >");
nsresult result=aScanner.ReadUntil(aString,theTerminals,PR_FALSE);
//Let's force quotes if either the first or last char is quoted.
@ -1570,7 +1570,7 @@ nsresult CAttributeToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 a
}
else {
//If you're here, handle an unquoted key.
static nsAutoString theTerminals = NS_ConvertToString("\b\t\n\r \"=>",8);
static nsAutoString theTerminals = NS_LITERAL_STRING("\b\t\n\r \"=>");
result=aScanner.ReadUntil(start,end,theTerminals,PR_FALSE);
}
if (!aRetainWhitespace) {

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

@ -2121,7 +2121,7 @@ nsresult nsParser::OnStartRequest(nsIRequest *request, nsISupports* aContext) {
rv = channel->GetContentType(&contentType);
if (NS_SUCCEEDED(rv))
{
mParserContext->SetMimeType( NS_ConvertToString(contentType) );
mParserContext->SetMimeType( NS_ConvertASCIItoUCS2(contentType) );
nsCRT::free(contentType);
}
else

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

@ -516,10 +516,10 @@ NS_IMETHODIMP CViewSourceHTML::BuildModel(nsIParser* aParser,nsITokenizer* aToke
nsTokenAllocator* theAllocator=mTokenizer->GetTokenAllocator();
if(theAllocator) {
#ifdef VIEW_SOURCE_HTML
theAttr=(CAttributeToken*)theAllocator->CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,NS_ConvertToString(kPreStyle));
theAttr=(CAttributeToken*)theAllocator->CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,NS_ConvertASCIItoUCS2(kPreStyle));
theAttr->SetKey(NS_LITERAL_STRING("style"));
#else
theAttr=(CAttributeToken*)theAllocator->CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,NS_ConvertToString("http://www.mozilla.org/viewsource"));
theAttr=(CAttributeToken*)theAllocator->CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,NS_LITERAL_STRING("http://www.mozilla.org/viewsource"));
theAttr->SetKey(NS_LITERAL_STRING("xmlns"));
#endif // VIEW_SOURCE_HTML
}
@ -904,7 +904,7 @@ nsresult CViewSourceHTML::WriteTag(nsString &theXMLTagName,const nsAReadableStri
#ifdef VIEW_SOURCE_HTML
nsTokenAllocator* theAllocator=mTokenizer->GetTokenAllocator();
if(theAllocator) {
CAttributeToken* theAttr=(CAttributeToken*)theAllocator->CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,NS_ConvertToString(kElementStyles[aTagType]));
CAttributeToken* theAttr=(CAttributeToken*)theAllocator->CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,NS_ConvertASCIItoUCS2(kElementStyles[aTagType]));
theAttr->SetKey(NS_LITERAL_STRING("style"));
theContext.mStartNode.AddAttribute(theAttr);
}

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

@ -187,7 +187,7 @@ eAutoDetectResult CWellFormedDTD::CanParse(CParserContext& aParserContext,nsStri
else {
if(-1<aBuffer.Find("<?xml ")) {
if(0==aParserContext.mMimeType.Length()) {
aParserContext.SetMimeType( NS_ConvertToString(kXMLTextContentType) );
aParserContext.SetMimeType( NS_ConvertASCIItoUCS2(kXMLTextContentType) );
}
result=eValidDetect;
}

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

@ -27,6 +27,7 @@
#include "nsLocale.h"
#include "nsLocaleCID.h"
#include "nsIComponentManager.h"
#include "nsReadableUtils.h"
#include <ctype.h>
@ -502,7 +503,7 @@ nsLocaleService::GetLocaleFromAcceptLanguage(const char *acceptLanguage, nsILoca
//
result = NS_ERROR_FAILURE;
if (countLang>0) {
PRUnichar* localeName = NS_ConvertToString(acceptLanguageList[0]).ToNewUnicode();
PRUnichar* localeName = ToNewUnicode(nsLiteralCString(acceptLanguageList[0]));
result = NewLocale(localeName,_retval);
delete localeName;
}

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

@ -2899,7 +2899,7 @@ NS_IMETHODIMP nsDocViwerSelectionListener::NotifySelectionChanged(nsIDOMDocument
nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(scriptGlobalObject);
if (!domWindow) return NS_ERROR_FAILURE;
domWindow->UpdateCommands(NS_ConvertToString("select"));
domWindow->UpdateCommands(NS_LITERAL_STRING("select"));
mGotSelectionState = PR_TRUE;
mSelectionWasCollapsed = selectionCollapsed;
}

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

@ -145,7 +145,7 @@ LayoutScriptNameSet::AddNameSet(nsIScriptContext* aScriptContext)
result = aScriptContext->GetNameSpaceManager(&manager);
if (NS_OK == result) {
result = manager->RegisterGlobalName(NS_ConvertToString("HTMLImageElement"),
result = manager->RegisterGlobalName(NS_LITERAL_STRING("HTMLImageElement"),
NS_GET_IID(nsIScriptObjectOwner),
kHTMLImageElementCID,
PR_TRUE);
@ -154,7 +154,7 @@ LayoutScriptNameSet::AddNameSet(nsIScriptContext* aScriptContext)
return result;
}
result = manager->RegisterGlobalName(NS_ConvertToString("HTMLOptionElement"),
result = manager->RegisterGlobalName(NS_LITERAL_STRING("HTMLOptionElement"),
NS_GET_IID(nsIScriptObjectOwner),
kHTMLOptionElementCID,
PR_TRUE);

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

@ -414,10 +414,10 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
nsCOMPtr<nsIContent> content;
elementFactory->CreateInstanceByTag(nodeInfo, getter_AddRefs(content));
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align,
NS_ConvertToString("horizontal"), PR_FALSE);
NS_LITERAL_STRING("horizontal"), PR_FALSE);
content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed,
NS_ConvertToString("true"), PR_FALSE);
NS_LITERAL_STRING("true"), PR_FALSE);
aAnonymousChildren.AppendElement(content);
@ -425,10 +425,10 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
content = nsnull;
elementFactory->CreateInstanceByTag(nodeInfo, getter_AddRefs(content));
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align,
NS_ConvertToString("vertical"), PR_FALSE);
NS_LITERAL_STRING("vertical"), PR_FALSE);
content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed,
NS_ConvertToString("true"), PR_FALSE);
NS_LITERAL_STRING("true"), PR_FALSE);
aAnonymousChildren.AppendElement(content);
@ -1400,7 +1400,7 @@ nsGfxScrollFrameInner::SetScrollbarVisibility(nsIBox* aScrollbar, PRBool aVisibl
return;
if (!aVisible)
content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, NS_ConvertToString("true"), PR_TRUE);
content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, NS_LITERAL_STRING("true"), PR_TRUE);
else
content->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, PR_TRUE);

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

@ -414,10 +414,10 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
nsCOMPtr<nsIContent> content;
elementFactory->CreateInstanceByTag(nodeInfo, getter_AddRefs(content));
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align,
NS_ConvertToString("horizontal"), PR_FALSE);
NS_LITERAL_STRING("horizontal"), PR_FALSE);
content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed,
NS_ConvertToString("true"), PR_FALSE);
NS_LITERAL_STRING("true"), PR_FALSE);
aAnonymousChildren.AppendElement(content);
@ -425,10 +425,10 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
content = nsnull;
elementFactory->CreateInstanceByTag(nodeInfo, getter_AddRefs(content));
content->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::align,
NS_ConvertToString("vertical"), PR_FALSE);
NS_LITERAL_STRING("vertical"), PR_FALSE);
content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed,
NS_ConvertToString("true"), PR_FALSE);
NS_LITERAL_STRING("true"), PR_FALSE);
aAnonymousChildren.AppendElement(content);
@ -1400,7 +1400,7 @@ nsGfxScrollFrameInner::SetScrollbarVisibility(nsIBox* aScrollbar, PRBool aVisibl
return;
if (!aVisible)
content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, NS_ConvertToString("true"), PR_TRUE);
content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, NS_LITERAL_STRING("true"), PR_TRUE);
else
content->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, PR_TRUE);

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

@ -1778,7 +1778,7 @@ nsGfxTextControlFrame2::CreateAnonymousContent(nsIPresContext* aPresContext,
// Set the neccessary style attributes on the text control.
if (IsSingleLineTextControl())
rv = divContent->SetAttribute(kNameSpaceID_None,nsHTMLAtoms::style, NS_ConvertToString(DIV_STRING_SINGLELINE), PR_FALSE);
rv = divContent->SetAttribute(kNameSpaceID_None,nsHTMLAtoms::style, NS_ConvertASCIItoUCS2(DIV_STRING_SINGLELINE), PR_FALSE);
else {
nsAutoString divStr; divStr.AssignWithConversion(DIV_STRING);
const nsStyleDisplay* disp = (const nsStyleDisplay*)
@ -1794,7 +1794,7 @@ nsGfxTextControlFrame2::CreateAnonymousContent(nsIPresContext* aPresContext,
if (NS_FAILED(rv))
return rv;
// rv = divContent->SetAttribute(kNameSpaceID_None,nsXULAtoms::debug, NS_ConvertToString("true"), PR_FALSE);
// rv = divContent->SetAttribute(kNameSpaceID_None,nsXULAtoms::debug, NS_LITERAL_STRING("true"), PR_FALSE);
rv = aChildList.AppendElement(divContent);
if (NS_FAILED(rv))

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

@ -714,7 +714,7 @@ nsMsgIncomingServer::GetPasswordWithUI(const PRUnichar * aPromptMessage, const
rv = GetServerURI(getter_Copies(serverUri));
if (NS_FAILED(rv)) return rv;
rv = dialog->PromptPassword(aPromptTitle, aPromptMessage,
NS_ConvertToString(serverUri).GetUnicode(), nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
NS_ConvertASCIItoUCS2(serverUri).get(), nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
getter_Copies(uniPassword), okayValue);
if (NS_FAILED(rv)) return rv;

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

@ -206,7 +206,7 @@ nsSmtpServer::GetPasswordWithUI(const PRUnichar * aPromptMessage, const
rv = GetServerURI(getter_Copies(serverUri));
if (NS_FAILED(rv)) return rv;
rv = aDialog->PromptPassword(aPromptTitle, aPromptMessage,
NS_ConvertToString(serverUri).GetUnicode(), nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
NS_ConvertASCIItoUCS2(serverUri).get(), nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
getter_Copies(uniPassword), &okayValue);
if (NS_FAILED(rv)) return rv;
@ -253,7 +253,7 @@ nsSmtpServer::GetUsernamePasswordWithUI(const PRUnichar * aPromptMessage, const
rv = GetServerURI(getter_Copies(serverUri));
if (NS_FAILED(rv)) return rv;
rv = aDialog->PromptUsernameAndPassword(aPromptTitle, aPromptMessage,
NS_ConvertToString(serverUri).GetUnicode(), nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
NS_ConvertASCIItoUCS2(serverUri).get(), nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
getter_Copies(uniUsername), getter_Copies(uniPassword), &okayValue);
if (NS_FAILED(rv)) return rv;

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

@ -494,7 +494,7 @@ nsresult CNavDTD::BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsIToke
}
}
//if the content model is empty, then begin by opening <html>...
theToken=NS_STATIC_CAST(CStartToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_html,NS_ConvertToString("html")));
theToken=NS_STATIC_CAST(CStartToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_html,NS_LITERAL_STRING("html")));
if(theToken) {
mTokenizer->PushTokenFront(theToken); //this token should get pushed on the context stack.
}
@ -547,7 +547,7 @@ nsresult CNavDTD::DidBuildModel(nsresult anErrorCode,PRBool aNotifySink,nsIParse
mSkipTarget=eHTMLTag_unknown; //clear this in case we were searching earlier.
CStartToken *theToken=NS_STATIC_CAST(CStartToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_body,NS_ConvertToString("body")));
CStartToken *theToken=NS_STATIC_CAST(CStartToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_body,NS_LITERAL_STRING("body")));
mTokenizer->PushTokenFront(theToken); //this token should get pushed on the context stack, don't recycle it
result=BuildModel(aParser,mTokenizer,0,aSink);
}
@ -788,7 +788,7 @@ nsresult CNavDTD::HandleToken(CToken* aToken,nsIParser* aParser){
//However, in quirks mode, a few tags request, ambiguosly, for a BODY. - Bugs 18928, 24204.-
mMisplacedContent.Push(aToken);
if(mDTDMode==eDTDMode_quirks && (gHTMLElements[theTag].HasSpecialProperty(kRequiresBody))) {
CToken* theBodyToken=NS_STATIC_CAST(CToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_body,NS_ConvertToString("body")));
CToken* theBodyToken=NS_STATIC_CAST(CToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_body,NS_LITERAL_STRING("body")));
result=HandleToken(theBodyToken,aParser);
}
return result;

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

@ -317,7 +317,7 @@ eAutoDetectResult COtherDTD::CanParse(CParserContext& aParserContext,nsString& a
if(BufferContainsHTML(aBuffer,theBufHasXML)){
result = eValidDetect ;
if(0==aParserContext.mMimeType.Length()) {
aParserContext.SetMimeType(NS_ConvertToString(kHTMLTextContentType));
aParserContext.SetMimeType(NS_ConvertASCIItoUCS2(kHTMLTextContentType));
if(!theBufHasXML) {
switch(aParserContext.mDTDMode) {
case eDTDMode_strict:
@ -417,7 +417,7 @@ nsresult COtherDTD::BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsITo
if(!mBodyContext->GetCount()) {
//if the content model is empty, then begin by opening <html>...
CStartToken *theToken=(CStartToken*)mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_html,NS_ConvertToString("html"));
CStartToken *theToken=(CStartToken*)mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_html,NS_LITERAL_STRING("html"));
HandleStartToken(theToken); //this token should get pushed on the context stack, don't recycle it.
}
@ -668,7 +668,7 @@ nsresult COtherDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsIParserNo
CObserverService* theService=mParser->GetObserverService();
if(theService) {
const nsISupportsParserBundle* bundle=mParser->GetParserBundle();
result=theService->Notify(aTag,aNode,(void*)bundle, NS_ConvertToString(kHTMLTextContentType), mParser);
result=theService->Notify(aTag,aNode,(void*)bundle, NS_ConvertASCIItoUCS2(kHTMLTextContentType), mParser);
}
}

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

@ -757,7 +757,7 @@ nsresult CRtfDTD::HandleControlWord(CToken* aToken){
break;
case eRTFCtrl_tab:
{
CTextToken theToken2( NS_ConvertToString(" ") );
CTextToken theToken2( NS_LITERAL_STRING(" ") );
result=HandleContent(&theToken2);
}
break;

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

@ -180,7 +180,7 @@ eAutoDetectResult nsExpatDTD::CanParse(CParserContext& aParserContext,nsString&
else {
if(-1<aBuffer.Find("<?xml ")) {
if(0==aParserContext.mMimeType.Length()) {
aParserContext.SetMimeType( NS_ConvertToString(kXMLTextContentType) );
aParserContext.SetMimeType( NS_ConvertASCIItoUCS2(kXMLTextContentType) );
}
result=eValidDetect;
}

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

@ -56,7 +56,7 @@ static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID);
const int gTabSize=2;
static const nsString gMozDirty = NS_ConvertToString("_moz_dirty");
static const NS_NAMED_LITERAL_STRING(gMozDirty, "_moz_dirty");
/**
* This method gets called as part of our COM-like interfaces.

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

@ -226,7 +226,7 @@ public:
}
// Make sure we don't find things that aren't there
value = nsHTMLEntities::EntityToUnicode(NS_ConvertToString("@"));
value = nsHTMLEntities::EntityToUnicode(nsCAutoString("@"));
NS_ASSERTION(value == -1, "found @");
value = nsHTMLEntities::EntityToUnicode(nsCAutoString("zzzzz"));
NS_ASSERTION(value == -1, "found zzzzz");

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

@ -527,7 +527,7 @@ PRInt32 CTextToken::GetTextLength(void) {
* @return error result
*/
nsresult CTextToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aMode) {;
static nsString theTerminals = NS_ConvertToString("\n\r&<",4);
static nsString theTerminals = NS_LITERAL_STRING("\n\r&<");
nsresult result=NS_OK;
PRBool done=PR_FALSE;
nsReadingIterator<PRUnichar> origin, start, end;
@ -897,7 +897,7 @@ PRInt32 CMarkupDeclToken::GetTokenType(void) {
* @return error result
*/
nsresult CMarkupDeclToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aMode) {
static nsString theTerminals = NS_ConvertToString("\n\r'\">",5);
static nsString theTerminals = NS_LITERAL_STRING("\n\r'\">");
nsresult result=NS_OK;
PRBool done=PR_FALSE;
PRUnichar quote=0;
@ -1521,7 +1521,7 @@ nsresult ConsumeQuotedString(PRUnichar aChar,nsString& aString,nsScanner& aScann
*/
static
nsresult ConsumeAttributeValueText(PRUnichar,nsString& aString,nsScanner& aScanner){
static nsString theTerminals = NS_ConvertToString("\b\t\n\r >",6);
static nsString theTerminals = NS_LITERAL_STRING("\b\t\n\r >");
nsresult result=aScanner.ReadUntil(aString,theTerminals,PR_FALSE);
//Let's force quotes if either the first or last char is quoted.
@ -1570,7 +1570,7 @@ nsresult CAttributeToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 a
}
else {
//If you're here, handle an unquoted key.
static nsAutoString theTerminals = NS_ConvertToString("\b\t\n\r \"=>",8);
static nsAutoString theTerminals = NS_LITERAL_STRING("\b\t\n\r \"=>");
result=aScanner.ReadUntil(start,end,theTerminals,PR_FALSE);
}
if (!aRetainWhitespace) {

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

@ -2121,7 +2121,7 @@ nsresult nsParser::OnStartRequest(nsIRequest *request, nsISupports* aContext) {
rv = channel->GetContentType(&contentType);
if (NS_SUCCEEDED(rv))
{
mParserContext->SetMimeType( NS_ConvertToString(contentType) );
mParserContext->SetMimeType( NS_ConvertASCIItoUCS2(contentType) );
nsCRT::free(contentType);
}
else

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

@ -516,10 +516,10 @@ NS_IMETHODIMP CViewSourceHTML::BuildModel(nsIParser* aParser,nsITokenizer* aToke
nsTokenAllocator* theAllocator=mTokenizer->GetTokenAllocator();
if(theAllocator) {
#ifdef VIEW_SOURCE_HTML
theAttr=(CAttributeToken*)theAllocator->CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,NS_ConvertToString(kPreStyle));
theAttr=(CAttributeToken*)theAllocator->CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,NS_ConvertASCIItoUCS2(kPreStyle));
theAttr->SetKey(NS_LITERAL_STRING("style"));
#else
theAttr=(CAttributeToken*)theAllocator->CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,NS_ConvertToString("http://www.mozilla.org/viewsource"));
theAttr=(CAttributeToken*)theAllocator->CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,NS_LITERAL_STRING("http://www.mozilla.org/viewsource"));
theAttr->SetKey(NS_LITERAL_STRING("xmlns"));
#endif // VIEW_SOURCE_HTML
}
@ -904,7 +904,7 @@ nsresult CViewSourceHTML::WriteTag(nsString &theXMLTagName,const nsAReadableStri
#ifdef VIEW_SOURCE_HTML
nsTokenAllocator* theAllocator=mTokenizer->GetTokenAllocator();
if(theAllocator) {
CAttributeToken* theAttr=(CAttributeToken*)theAllocator->CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,NS_ConvertToString(kElementStyles[aTagType]));
CAttributeToken* theAttr=(CAttributeToken*)theAllocator->CreateTokenOfType(eToken_attribute,eHTMLTag_unknown,NS_ConvertASCIItoUCS2(kElementStyles[aTagType]));
theAttr->SetKey(NS_LITERAL_STRING("style"));
theContext.mStartNode.AddAttribute(theAttr);
}

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

@ -187,7 +187,7 @@ eAutoDetectResult CWellFormedDTD::CanParse(CParserContext& aParserContext,nsStri
else {
if(-1<aBuffer.Find("<?xml ")) {
if(0==aParserContext.mMimeType.Length()) {
aParserContext.SetMimeType( NS_ConvertToString(kXMLTextContentType) );
aParserContext.SetMimeType( NS_ConvertASCIItoUCS2(kXMLTextContentType) );
}
result=eValidDetect;
}

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

@ -599,29 +599,6 @@ class NS_COM NS_ConvertASCIItoUCS2
NS_ConvertASCIItoUCS2( PRUnichar );
};
#define NS_ConvertToString NS_ConvertASCIItoUCS2
#if 0
inline
nsAutoString
NS_ConvertToString( const char* aCString )
{
nsAutoString result;
result.AssignWithConversion(aCString);
return result;
}
inline
nsAutoString
NS_ConvertToString( const char* aCString, PRUint32 aLength )
{
nsAutoString result;
result.AssignWithConversion(aCString, aLength);
return result;
}
#endif
class NS_COM NS_ConvertUTF8toUCS2
: public nsAutoString
{

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

@ -599,29 +599,6 @@ class NS_COM NS_ConvertASCIItoUCS2
NS_ConvertASCIItoUCS2( PRUnichar );
};
#define NS_ConvertToString NS_ConvertASCIItoUCS2
#if 0
inline
nsAutoString
NS_ConvertToString( const char* aCString )
{
nsAutoString result;
result.AssignWithConversion(aCString);
return result;
}
inline
nsAutoString
NS_ConvertToString( const char* aCString, PRUint32 aLength )
{
nsAutoString result;
result.AssignWithConversion(aCString, aLength);
return result;
}
#endif
class NS_COM NS_ConvertUTF8toUCS2
: public nsAutoString
{