aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/EventContext.cpp
diff options
context:
space:
mode:
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());
}