From 5ba5e9d53a7c78656b1760faa0d09559700598ef Mon Sep 17 00:00:00 2001 From: "shanjian%netscape.com" Date: Mon, 3 Jun 2002 21:09:22 +0000 Subject: [PATCH] #140234 Japanese auto-detection marks ISO-8859-15 page as Windows-1252 Don't update chatset for document if existing one is of higher priority. r=yokoyama, sr=jst git-svn-id: svn://10.0.0.236/trunk@122584 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/intl/chardet/src/nsDetectionAdaptor.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mozilla/intl/chardet/src/nsDetectionAdaptor.cpp b/mozilla/intl/chardet/src/nsDetectionAdaptor.cpp index 8b0c474f2f1..e609f7a8bda 100644 --- a/mozilla/intl/chardet/src/nsDetectionAdaptor.cpp +++ b/mozilla/intl/chardet/src/nsDetectionAdaptor.cpp @@ -58,16 +58,16 @@ NS_IMETHODIMP nsMyObserver::Notify( rv = mWebShellSvc->StopDocumentLoad(); rv = mWebShellSvc->ReloadDocument(aCharset, kCharsetFromAutoDetection); } else { + nsAutoString existingCharset; + PRInt32 existingSource; nsAutoString newcharset; newcharset.AssignWithConversion(aCharset); - if(mWeakRefDocument) { - mWeakRefDocument->SetDocumentCharacterSet(newcharset); - } if(mWeakRefParser) { - nsAutoString existingCharset; - PRInt32 existingSource; mWeakRefParser->GetDocumentCharset(existingCharset, existingSource); - if (existingSource < kCharsetFromAutoDetection) + if (existingSource < kCharsetFromAutoDetection) { mWeakRefParser->SetDocumentCharset(newcharset, kCharsetFromAutoDetection); + if(mWeakRefDocument) + mWeakRefDocument->SetDocumentCharacterSet(newcharset); + } } } }