зеркало из https://github.com/mozilla/gecko-dev.git
fixed ABW in nsTagStack and updated to string2 API
This commit is contained in:
Родитель
4cbcbd57f8
Коммит
ec29bbf96e
|
@ -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))
|
||||
|
|
Загрузка…
Ссылка в новой задаче