From d33c13d6d52a405ef9bec15b414904a9c2620380 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sat, 10 Jan 2004 21:33:04 +0000 Subject: Adapt to the ever-changing mozilla API. 2004-01-10 Christian Persch * configure.in: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EventContext.cpp: Adapt to the ever-changing mozilla API. --- ChangeLog | 8 ++++++++ configure.in | 4 +++- embed/mozilla/EphyBrowser.cpp | 15 ++++++++++++--- embed/mozilla/EventContext.cpp | 16 ++++++++++++---- 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7801fe7d4..df3c6b7d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-01-10 Christian Persch + + * configure.in: + * embed/mozilla/EphyBrowser.cpp: + * embed/mozilla/EventContext.cpp: + + Adapt to the ever-changing mozilla API. + 2004-01-10 Christian Persch * embed/ephy-history.c: (ephy_history_get_type), diff --git a/configure.in b/configure.in index d01a17008..a29825e71 100644 --- a/configure.in +++ b/configure.in @@ -191,7 +191,9 @@ case "$MOZILLA_VERSION" in 1.6a) MOZILLA_SNAPSHOT=12 ;; 1.6b) MOZILLA_SNAPSHOT=13 ;; 1.6) MOZILLA_SNAPSHOT=13 ;; - 1.7a) MOZILLA_SNAPSHOT=13 ;; + 1.7a) MOZILLA_SNAPSHOT=14 ;; + 1.7b) MOZILLA_SNAPSHOT=14 ;; + 1.7) MOZILLA_SNAPSHOT=14 ;; trunk) MOZILLA_SNAPSHOT=13 ;; *) AC_ERROR([ ***************************************************************************** diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index b57bb44e8..1581050bd 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -135,7 +135,10 @@ EphyFaviconEventListener::HandleFaviconLink (nsIDOMNode *node) nsCOMPtr doc = do_QueryInterface (domDoc); NS_ENSURE_TRUE (doc, NS_ERROR_FAILURE); -#if MOZILLA_SNAPSHOT > 11 +#if MOZILLA_SNAPSHOT > 13 + nsIURI *uri; + uri = doc->GetDocumentURI (); +#elif MOZILLA_SNAPSHOT > 11 nsIURI *uri; uri = doc->GetDocumentURL (); #else @@ -631,7 +634,10 @@ nsresult EphyBrowser::GetDocumentUrl (nsCString &url) nsCOMPtr doc = do_QueryInterface(DOMDocument); NS_ENSURE_TRUE (doc, NS_ERROR_FAILURE); -#if MOZILLA_SNAPSHOT > 11 +#if MOZILLA_SNAPSHOT > 13 + nsIURI *uri; + uri = doc->GetDocumentURI (); +#elif MOZILLA_SNAPSHOT > 11 nsIURI *uri; uri = doc->GetDocumentURL (); #else @@ -652,7 +658,10 @@ nsresult EphyBrowser::GetTargetDocumentUrl (nsCString &url) nsCOMPtr doc = do_QueryInterface(DOMDocument); NS_ENSURE_TRUE (doc, NS_ERROR_FAILURE); -#if MOZILLA_SNAPSHOT > 11 +#if MOZILLA_SNAPSHOT > 13 + nsIURI *uri; + uri = doc->GetDocumentURI (); +#elif MOZILLA_SNAPSHOT > 11 nsIURI *uri; uri = doc->GetDocumentURL (); #else diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp index 985b7ff23..05ed96306 100644 --- a/embed/mozilla/EventContext.cpp +++ b/embed/mozilla/EventContext.cpp @@ -145,10 +145,14 @@ nsresult EventContext::GatherTextUnder (nsIDOMNode* aNode, nsString& aResult) nsresult EventContext::ResolveBaseURL (nsIDocument *doc, const nsAString &relurl, nsACString &url) { nsresult rv; -#if MOZILLA_SNAPSHOT > 11 +#if MOZILLA_SNAPSHOT > 13 + nsIURI *base; + base = doc->GetBaseURI (); + if (!base) return NS_ERROR_FAILURE; +#elif MOZILLA_SNAPSHOT > 11 nsIURI *base; base = doc->GetBaseURL (); - if (base == NULL) return NS_ERROR_FAILURE; + if (!base) return NS_ERROR_FAILURE; #elif MOZILLA_SNAPSHOT > 9 nsCOMPtr base; rv = doc->GetBaseURL (getter_AddRefs(base)); @@ -165,10 +169,14 @@ nsresult EventContext::ResolveBaseURL (nsIDocument *doc, const nsAString &relurl nsresult EventContext::ResolveDocumentURL (nsIDocument *doc, const nsAString &relurl, nsACString &url) { nsresult rv; -#if MOZILLA_SNAPSHOT > 11 +#if MOZILLA_SNAPSHOT > 13 + nsIURI *uri; + uri = doc->GetDocumentURI (); + if (!uri) return NS_ERROR_FAILURE; +#elif MOZILLA_SNAPSHOT > 11 nsIURI *uri; uri = doc->GetDocumentURL (); - if (uri == NULL) return NS_ERROR_FAILURE; + if (!uri) return NS_ERROR_FAILURE; #else nsCOMPtr uri; rv = doc->GetDocumentURL(getter_AddRefs(uri)); -- cgit v1.2.3