aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/EventContext.cpp
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@src.gnome.org>2004-03-17 17:02:38 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-03-17 17:02:38 +0800
commitdbdcf80ba8e559236f9937aaafba1d14b1cee46e (patch)
treed5711b633861b6ffc879fbbce08ea1364e9a64c9 /embed/mozilla/EventContext.cpp
parent9765279aba4cbed66b182e91eaa18e8225305a18 (diff)
downloadgsoc2013-epiphany-dbdcf80ba8e559236f9937aaafba1d14b1cee46e.tar.gz
gsoc2013-epiphany-dbdcf80ba8e559236f9937aaafba1d14b1cee46e.tar.zst
gsoc2013-epiphany-dbdcf80ba8e559236f9937aaafba1d14b1cee46e.zip
merging pre-gnome-2-8 branch
Diffstat (limited to 'embed/mozilla/EventContext.cpp')
-rw-r--r--embed/mozilla/EventContext.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp
index 230ce7dd3..59b3897fb 100644
--- a/embed/mozilla/EventContext.cpp
+++ b/embed/mozilla/EventContext.cpp
@@ -154,17 +154,9 @@ nsresult EventContext::ResolveBaseURL (nsIDocument *doc, const nsAString &relurl
nsIURI *base;
base = doc->GetBaseURL ();
if (!base) return NS_ERROR_FAILURE;
-#elif MOZILLA_SNAPSHOT > 9
- nsCOMPtr<nsIURI> base;
- rv = doc->GetBaseURL (getter_AddRefs(base));
- if (NS_FAILED(rv)) return rv;
-#else
- nsCOMPtr<nsIURI> base;
- rv = doc->GetBaseURL (*getter_AddRefs(base));
- if (NS_FAILED(rv)) return rv;
#endif
- return base->Resolve (NS_ConvertUCS2toUTF8(relurl), url);
+ return base->Resolve (NS_ConvertUTF16toUTF8(relurl), url);
}
nsresult EventContext::ResolveDocumentURL (nsIDocument *doc, const nsAString &relurl, nsACString &url)
@@ -178,13 +170,9 @@ nsresult EventContext::ResolveDocumentURL (nsIDocument *doc, const nsAString &re
nsIURI *uri;
uri = doc->GetDocumentURL ();
if (!uri) 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);
+ return uri->Resolve (NS_ConvertUTF16toUTF8(relurl), url);
}
nsresult EventContext::GetEventContext (nsIDOMEventTarget *EventTarget,
@@ -261,7 +249,7 @@ nsresult EventContext::GetEventContext (nsIDOMEventTarget *EventTarget,
rv = ResolveDocumentURL (doc, img, imglongdesc);
SetStringProperty ("image_long_desc",
- NS_ConvertUTF8toUCS2(imglongdesc));
+ NS_ConvertUTF8toUTF16(imglongdesc));
}
int imgwidth, imgheight;
@@ -302,7 +290,7 @@ nsresult EventContext::GetEventContext (nsIDOMEventTarget *EventTarget,
rv = ResolveDocumentURL (doc, img, cImg);
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
SetStringProperty ("image",
- NS_ConvertUTF8toUCS2(cImg));
+ NS_ConvertUTF8toUTF16(cImg));
}
else if (!value.EqualsIgnoreCase("radio") &&
!value.EqualsIgnoreCase("submit") &&
@@ -839,5 +827,5 @@ nsresult EventContext::SetStringProperty (const char *name, const char *value)
nsresult EventContext::SetStringProperty (const char *name, const nsAString &value)
{
- return SetStringProperty (name, NS_ConvertUCS2toUTF8(value).get());
+ return SetStringProperty (name, NS_ConvertUTF16toUTF8(value).get());
}