This commit is contained in:
akkana%netscape.com 1999-06-15 23:56:44 +00:00
Родитель d4c285bfc3
Коммит d00f0fc008
4 изменённых файлов: 18 добавлений и 20 удалений

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

@ -432,13 +432,12 @@ void nsHTMLContentSinkStream::EnsureBufferSize(PRInt32 aNewSize)
* Entities are represented in the dom as single elements.
* Substitute them back into entity for (e.g. ´) here.
*/
void nsHTMLContentSinkStream::UnicodeToHTMLString(nsString& aSrc)
void nsHTMLContentSinkStream::UnicodeToHTMLString(const nsString& aSrc,
nsString& aDst)
{
PRInt32 length = aSrc.Length();
PRUnichar ch;
const char* entity = nsnull;
nsAutoString data;
if (mUnicodeEncoder == nsnull)
InitEncoder("");
@ -458,23 +457,23 @@ void nsHTMLContentSinkStream::UnicodeToHTMLString(nsString& aSrc)
nsAutoString temp(entity);
temp.ToLowerCase();
data.Append('&');
data.Append(temp);
data.Append(';');
aDst.Append('&');
aDst.Append(temp);
aDst.Append(';');
}
else
{
data.Append(ch);
aDst.Append(ch);
}
}
aSrc = data;
}
}
void nsHTMLContentSinkStream::EncodeToBuffer(const nsString& aSrc)
{
UnicodeToHTMLString(aSrc);
nsString unicode;
UnicodeToHTMLString(aSrc, unicode);
NS_VERIFY(mUnicodeEncoder != nsnull,"The unicode encoder needs to be initialized");
if (mUnicodeEncoder == nsnull)

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

@ -135,7 +135,7 @@ protected:
nsresult InitEncoder(const nsString& aCharset);
void UnicodeToHTMLString(nsString& aString);
void UnicodeToHTMLString(const nsString& aSrc, nsString& aDst);
void EncodeToBuffer(const nsString& aString);
void Write(const nsString& aString);

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

@ -432,13 +432,12 @@ void nsHTMLContentSinkStream::EnsureBufferSize(PRInt32 aNewSize)
* Entities are represented in the dom as single elements.
* Substitute them back into entity for (e.g. ´) here.
*/
void nsHTMLContentSinkStream::UnicodeToHTMLString(nsString& aSrc)
void nsHTMLContentSinkStream::UnicodeToHTMLString(const nsString& aSrc,
nsString& aDst)
{
PRInt32 length = aSrc.Length();
PRUnichar ch;
const char* entity = nsnull;
nsAutoString data;
if (mUnicodeEncoder == nsnull)
InitEncoder("");
@ -458,23 +457,23 @@ void nsHTMLContentSinkStream::UnicodeToHTMLString(nsString& aSrc)
nsAutoString temp(entity);
temp.ToLowerCase();
data.Append('&');
data.Append(temp);
data.Append(';');
aDst.Append('&');
aDst.Append(temp);
aDst.Append(';');
}
else
{
data.Append(ch);
aDst.Append(ch);
}
}
aSrc = data;
}
}
void nsHTMLContentSinkStream::EncodeToBuffer(const nsString& aSrc)
{
UnicodeToHTMLString(aSrc);
nsString unicode;
UnicodeToHTMLString(aSrc, unicode);
NS_VERIFY(mUnicodeEncoder != nsnull,"The unicode encoder needs to be initialized");
if (mUnicodeEncoder == nsnull)

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

@ -135,7 +135,7 @@ protected:
nsresult InitEncoder(const nsString& aCharset);
void UnicodeToHTMLString(nsString& aString);
void UnicodeToHTMLString(const nsString& aSrc, nsString& aDst);
void EncodeToBuffer(const nsString& aString);
void Write(const nsString& aString);