change SetDocumentCharset method to call webshell

This commit is contained in:
ftang%netscape.com 1999-03-23 20:01:41 +00:00
Родитель df986f26de
Коммит b93193063a
1 изменённых файлов: 13 добавлений и 13 удалений

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

@ -213,20 +213,20 @@ nsBrowserAppCore::Init(const nsString& aId)
NS_IMETHODIMP
nsBrowserAppCore::SetDocumentCharset(const nsString& aCharset)
{
nsresult res = NS_OK;
if (nsnull != mContentWindow) {
nsCOMPtr<nsIDOMDocument> domDoc;
if (NS_SUCCEEDED(res = mContentWindow->GetDocument(getter_AddRefs(domDoc)))) {
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc, &res));
if (NS_SUCCEEDED(res)) {
nsString *aNewCharset = new nsString(aCharset);
if (nsnull != aNewCharset) {
doc->SetDocumentCharacterSet(aNewCharset);
nsCOMPtr<nsIScriptGlobalObject> globalObj( do_QueryInterface(mContentWindow) );
if (!globalObj) {
return NS_ERROR_FAILURE;
}
nsIWebShell * webShell;
globalObj->GetWebShell(&webShell);
if (nsnull != webShell) {
webShell->SetDefaultCharacterSet( aCharset);
NS_RELEASE(webShell);
}
}
}
return res;
return NS_OK;
}
NS_IMETHODIMP