зеркало из https://github.com/mozilla/gecko-dev.git
removed nsStr references
This commit is contained in:
Родитель
ffe78e83e5
Коммит
8c4b91906f
|
@ -173,6 +173,32 @@ nsHTMLEntities::EntityToUnicode(const nsString& aEntity)
|
|||
return -1;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsHTMLEntities::EntityToUnicode(const nsCString& aEntity)
|
||||
{
|
||||
NS_ASSERTION(gEntityToCodeTree, "no lookup table, needs addref");
|
||||
if (gEntityToCodeTree) {
|
||||
|
||||
//this little piece of code exists because entities may or may not have the terminating ';'.
|
||||
//if we see it, strip if off for this test...
|
||||
|
||||
PRUnichar theLastChar=GetCharAt(aEntity,aEntity.mLength-1);
|
||||
if(';'==theLastChar) {
|
||||
nsCAutoString temp(aEntity);
|
||||
temp.Truncate(aEntity.mLength-1);
|
||||
return EntityToUnicode(temp);
|
||||
}
|
||||
|
||||
|
||||
EntityNode node(aEntity);
|
||||
EntityNode* found = (EntityNode*)gEntityToCodeTree->FindItem(&node);
|
||||
if (found) {
|
||||
NS_ASSERTION(found->mStr.Equals(aEntity.mUStr,PR_FALSE,aEntity.mLength), "bad tree");
|
||||
return found->mUnicode;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
const nsCString&
|
||||
nsHTMLEntities::UnicodeToEntity(PRInt32 aUnicode)
|
||||
|
|
|
@ -38,6 +38,7 @@ public:
|
|||
* in it.
|
||||
*/
|
||||
static PRInt32 EntityToUnicode(const nsString& aEntity);
|
||||
static PRInt32 EntityToUnicode(const nsCString& aEntity);
|
||||
|
||||
/**
|
||||
* Translate an entity string into it's unicode value. This call
|
||||
|
|
|
@ -173,6 +173,32 @@ nsHTMLEntities::EntityToUnicode(const nsString& aEntity)
|
|||
return -1;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsHTMLEntities::EntityToUnicode(const nsCString& aEntity)
|
||||
{
|
||||
NS_ASSERTION(gEntityToCodeTree, "no lookup table, needs addref");
|
||||
if (gEntityToCodeTree) {
|
||||
|
||||
//this little piece of code exists because entities may or may not have the terminating ';'.
|
||||
//if we see it, strip if off for this test...
|
||||
|
||||
PRUnichar theLastChar=GetCharAt(aEntity,aEntity.mLength-1);
|
||||
if(';'==theLastChar) {
|
||||
nsCAutoString temp(aEntity);
|
||||
temp.Truncate(aEntity.mLength-1);
|
||||
return EntityToUnicode(temp);
|
||||
}
|
||||
|
||||
|
||||
EntityNode node(aEntity);
|
||||
EntityNode* found = (EntityNode*)gEntityToCodeTree->FindItem(&node);
|
||||
if (found) {
|
||||
NS_ASSERTION(found->mStr.Equals(aEntity.mUStr,PR_FALSE,aEntity.mLength), "bad tree");
|
||||
return found->mUnicode;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
const nsCString&
|
||||
nsHTMLEntities::UnicodeToEntity(PRInt32 aUnicode)
|
||||
|
|
|
@ -38,6 +38,7 @@ public:
|
|||
* in it.
|
||||
*/
|
||||
static PRInt32 EntityToUnicode(const nsString& aEntity);
|
||||
static PRInt32 EntityToUnicode(const nsCString& aEntity);
|
||||
|
||||
/**
|
||||
* Translate an entity string into it's unicode value. This call
|
||||
|
|
Загрузка…
Ссылка в новой задаче