aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/EventContext.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-12-15 00:19:40 +0800
committerChristian Persch <chpe@src.gnome.org>2003-12-15 00:19:40 +0800
commitdeab0d1c914913ae0615eec1cd1dc170255275a5 (patch)
treeda652af5a61920e256db92e2aa8a1d22bfebac7d /embed/mozilla/EventContext.cpp
parentf21911f22afd1bb0838010ac61fe3c3297657098 (diff)
downloadgsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.tar
gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.tar.gz
gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.tar.bz2
gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.tar.lz
gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.tar.xz
gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.tar.zst
gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.zip
Adapt to changed mozilla APIs for 1.6. (Ported from HEAD).
2003-12-14 Christian Persch <chpe@cvs.gnome.org> * NEWS: * configure.in: * embed/mozilla/EphyEventListener.cpp: * embed/mozilla/EphyWrapper.cpp: * embed/mozilla/EventContext.cpp: * embed/mozilla/ExternalProtocolService.cpp: * embed/mozilla/MozRegisterComponents.cpp: * embed/mozilla/mozilla-embed-persist.cpp: * embed/mozilla/mozilla-embed-single.cpp: * src/ephy-window.c: (show_embed_popup): Adapt to changed mozilla APIs for 1.6. (Ported from HEAD).
Diffstat (limited to 'embed/mozilla/EventContext.cpp')
-rw-r--r--embed/mozilla/EventContext.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp
index 50539a8d7..dc7e4a415 100644
--- a/embed/mozilla/EventContext.cpp
+++ b/embed/mozilla/EventContext.cpp
@@ -14,6 +14,8 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
*/
#include "EventContext.h"
@@ -139,13 +141,19 @@ nsresult EventContext::GatherTextUnder (nsIDOMNode* aNode, nsString& aResult)
nsresult EventContext::ResolveBaseURL (nsIDocument *doc, const nsAString &relurl, nsACString &url)
{
nsresult rv;
+#if MOZILLA_SNAPSHOT > 11
+ nsIURI *base;
+ base = doc->GetBaseURL ();
+ if (!base) return NS_ERROR_FAILURE;
+#elif MOZILLA_SNAPSHOT > 9
nsCOMPtr<nsIURI> base;
-#if MOZILLA_SNAPSHOT > 9
rv = doc->GetBaseURL (getter_AddRefs(base));
+ if (NS_FAILED(rv)) return rv;
#else
+ nsCOMPtr<nsIURI> base;
rv = doc->GetBaseURL (*getter_AddRefs(base));
-#endif
if (NS_FAILED(rv)) return rv;
+#endif
return base->Resolve (NS_ConvertUCS2toUTF8(relurl), url);
}
@@ -153,9 +161,15 @@ nsresult EventContext::ResolveBaseURL (nsIDocument *doc, const nsAString &relurl
nsresult EventContext::ResolveDocumentURL (nsIDocument *doc, const nsAString &relurl, nsACString &url)
{
nsresult rv;
+#if MOZILLA_SNAPSHOT > 11
+ nsIURI *uri;
+ uri = doc->GetDocumentURL ();
+ if (uri == NULL) return NS_ERROR_FAILURE;
+#else
nsCOMPtr<nsIURI> uri;
rv = doc->GetDocumentURL(getter_AddRefs(uri));
if (NS_FAILED(rv)) return rv;
+#endif
return uri->Resolve (NS_ConvertUCS2toUTF8(relurl), url);
}