diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2003-10-28 02:43:45 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2003-10-28 02:43:45 +0800 |
commit | 6c94575f7a9971a6784905e8634fabec5683a53e (patch) | |
tree | 74dee813d75820a5939aed78b43c6dcb267a903c /embed/mozilla | |
parent | e7226bd132c37ef89eb37f8a31b47c31b71ede8e (diff) | |
download | gsoc2013-epiphany-6c94575f7a9971a6784905e8634fabec5683a53e.tar gsoc2013-epiphany-6c94575f7a9971a6784905e8634fabec5683a53e.tar.gz gsoc2013-epiphany-6c94575f7a9971a6784905e8634fabec5683a53e.tar.bz2 gsoc2013-epiphany-6c94575f7a9971a6784905e8634fabec5683a53e.tar.lz gsoc2013-epiphany-6c94575f7a9971a6784905e8634fabec5683a53e.tar.xz gsoc2013-epiphany-6c94575f7a9971a6784905e8634fabec5683a53e.tar.zst gsoc2013-epiphany-6c94575f7a9971a6784905e8634fabec5683a53e.zip |
We need to force the encoding to be able to unset it.
2003-10-27 Marco Pesenti Gritti <marco@gnome.org>
* embed/mozilla/EphyBrowser.cpp:
We need to force the encoding to be able
to unset it.
Diffstat (limited to 'embed/mozilla')
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index 812ba9b53..f01965381 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -30,7 +30,6 @@ #include <gtkmozembed_internal.h> #include <unistd.h> -#include "nsIDocCharset.h" #include "nsICommandManager.h" #include "nsIContentViewer.h" #include "nsIGlobalHistory.h" @@ -372,6 +371,8 @@ nsresult EphyBrowser::GetDocument (nsIDOMDocument **aDOMDocument) { NS_ENSURE_ARG_POINTER(aDOMDocument); NS_IF_ADDREF(*aDOMDocument = mDOMDocument); + + return NS_OK; } nsresult EphyBrowser::GetTargetDocument (nsIDOMDocument **aDOMDocument) @@ -574,16 +575,18 @@ nsresult EphyBrowser::ForceEncoding (const char *encoding) { nsresult result; - g_return_val_if_fail (mWebBrowser, NS_ERROR_FAILURE); - - nsCOMPtr<nsIDocShell> docShell; - docShell = do_GetInterface (mWebBrowser); - if (!docShell) return NS_ERROR_FAILURE; + nsCOMPtr<nsIContentViewer> contentViewer; + result = GetContentViewer (getter_AddRefs(contentViewer)); + if (!NS_SUCCEEDED (result) || !contentViewer) return NS_ERROR_FAILURE; - nsCOMPtr<nsIDocCharset> docCharset; - docCharset = do_QueryInterface (docShell); + nsCOMPtr<nsIMarkupDocumentViewer> mdv = do_QueryInterface(contentViewer); + if (!mdv) return NS_ERROR_FAILURE; - result = docCharset->SetCharset (encoding); + #if MOZILLA_SNAPSHOT > 9 + result = mdv->SetForceCharacterSet (nsDependentCString(encoding)); + #else + result = mdv->SetForceCharacterSet (NS_ConvertUTF8toUCS2(encoding).get()); + #endif return result; } |