fix 222203 . r = harishd move the scanner set character set code into the set charset function with if statement

This commit is contained in:
ftang%netscape.com 2000-02-15 09:13:27 +00:00
Родитель 98143b5de2
Коммит 8a8c3a7676
2 изменённых файлов: 4 добавлений и 2 удалений

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

@ -327,6 +327,8 @@ void nsParser::SetCommand(const char* aCommand){
void nsParser::SetDocumentCharset(nsString& aCharset, nsCharsetSource aCharsetSource){ void nsParser::SetDocumentCharset(nsString& aCharset, nsCharsetSource aCharsetSource){
mCharset = aCharset; mCharset = aCharset;
mCharsetSource = aCharsetSource; mCharsetSource = aCharsetSource;
if(mParserContext && mParserContext->mScanner)
mParserContext->mScanner->SetDocumentCharset(aCharset, aCharsetSource);
} }
/** /**
@ -1344,7 +1346,6 @@ nsresult nsParser::OnDataAvailable(nsIChannel* channel, nsISupports* aContext,
printf("xmlencoding detect- %s\n", guess.ToNewCString()); printf("xmlencoding detect- %s\n", guess.ToNewCString());
#endif #endif
this->SetDocumentCharset(guess, guessSource); this->SetDocumentCharset(guess, guessSource);
mParserContext->mScanner->SetDocumentCharset(guess, guessSource);
} }
} }
theTotalRead+=theNumRead; theTotalRead+=theNumRead;

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

@ -327,6 +327,8 @@ void nsParser::SetCommand(const char* aCommand){
void nsParser::SetDocumentCharset(nsString& aCharset, nsCharsetSource aCharsetSource){ void nsParser::SetDocumentCharset(nsString& aCharset, nsCharsetSource aCharsetSource){
mCharset = aCharset; mCharset = aCharset;
mCharsetSource = aCharsetSource; mCharsetSource = aCharsetSource;
if(mParserContext && mParserContext->mScanner)
mParserContext->mScanner->SetDocumentCharset(aCharset, aCharsetSource);
} }
/** /**
@ -1344,7 +1346,6 @@ nsresult nsParser::OnDataAvailable(nsIChannel* channel, nsISupports* aContext,
printf("xmlencoding detect- %s\n", guess.ToNewCString()); printf("xmlencoding detect- %s\n", guess.ToNewCString());
#endif #endif
this->SetDocumentCharset(guess, guessSource); this->SetDocumentCharset(guess, guessSource);
mParserContext->mScanner->SetDocumentCharset(guess, guessSource);
} }
} }
theTotalRead+=theNumRead; theTotalRead+=theNumRead;