fixed ABW in nsTagStack and updated to string2 API

This commit is contained in:
rickg%netscape.com 1999-05-02 00:37:25 +00:00
Родитель 4cbcbd57f8
Коммит ec29bbf96e
6 изменённых файлов: 14 добавлений и 20 удалений

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

@ -61,17 +61,14 @@ void nsTagStack::Empty(void) {
*/
void nsTagStack::Push(eHTMLTags aTag) {
if(mCount==mCapacity){
nsTagEntry* temp=new nsTagEntry[mCapacity+50];
if(mCapacity){
PRUint32 index=0;
for(index=0;index<mCount;index++) {
temp[index]=mEntries[index];
}
delete [] mEntries;
nsTagEntry* temp=new nsTagEntry[mCapacity+=50];
PRUint32 index=0;
for(index=0;index<mCount;index++) {
temp[index]=mEntries[index];
}
delete [] mEntries;
mEntries=temp;
}
mCapacity+=50;
mEntries[mCount].mTag=aTag;
mEntries[mCount].mBankIndex=-1;
mEntries[mCount++].mStyleIndex=-1;

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

@ -542,7 +542,7 @@ void nsHTMLContentSinkStream::UnicodeToHTMLString(const nsString& aSrc)
PRInt32 bufferLength = mBufferSize;
mUnicodeEncoder->Reset();
nsresult result = mUnicodeEncoder->Convert(data, &length, mBuffer, &bufferLength);
nsresult result = mUnicodeEncoder->Convert(data.GetUnicode(), &length, mBuffer, &bufferLength);
mBuffer[bufferLength] = 0;
PRInt32 temp = bufferLength;
if (NS_SUCCEEDED(result))

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

@ -487,7 +487,7 @@ void nsHTMLToTXTSinkStream::UnicodeToTXTString(const nsString& aSrc)
bufferLength = mBufferSize;
mUnicodeEncoder->Reset();
result = mUnicodeEncoder->Convert(aSrc, &length, mBuffer, &bufferLength);
result = mUnicodeEncoder->Convert(aSrc.GetUnicode(), &length, mBuffer, &bufferLength);
mBuffer[bufferLength] = 0;
PRInt32 temp = bufferLength;
if (NS_SUCCEEDED(result))

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

@ -61,17 +61,14 @@ void nsTagStack::Empty(void) {
*/
void nsTagStack::Push(eHTMLTags aTag) {
if(mCount==mCapacity){
nsTagEntry* temp=new nsTagEntry[mCapacity+50];
if(mCapacity){
PRUint32 index=0;
for(index=0;index<mCount;index++) {
temp[index]=mEntries[index];
}
delete [] mEntries;
nsTagEntry* temp=new nsTagEntry[mCapacity+=50];
PRUint32 index=0;
for(index=0;index<mCount;index++) {
temp[index]=mEntries[index];
}
delete [] mEntries;
mEntries=temp;
}
mCapacity+=50;
mEntries[mCount].mTag=aTag;
mEntries[mCount].mBankIndex=-1;
mEntries[mCount++].mStyleIndex=-1;

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

@ -542,7 +542,7 @@ void nsHTMLContentSinkStream::UnicodeToHTMLString(const nsString& aSrc)
PRInt32 bufferLength = mBufferSize;
mUnicodeEncoder->Reset();
nsresult result = mUnicodeEncoder->Convert(data, &length, mBuffer, &bufferLength);
nsresult result = mUnicodeEncoder->Convert(data.GetUnicode(), &length, mBuffer, &bufferLength);
mBuffer[bufferLength] = 0;
PRInt32 temp = bufferLength;
if (NS_SUCCEEDED(result))

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

@ -487,7 +487,7 @@ void nsHTMLToTXTSinkStream::UnicodeToTXTString(const nsString& aSrc)
bufferLength = mBufferSize;
mUnicodeEncoder->Reset();
result = mUnicodeEncoder->Convert(aSrc, &length, mBuffer, &bufferLength);
result = mUnicodeEncoder->Convert(aSrc.GetUnicode(), &length, mBuffer, &bufferLength);
mBuffer[bufferLength] = 0;
PRInt32 temp = bufferLength;
if (NS_SUCCEEDED(result))