Bug 790015 - Bustage fix after nsIScriptError::init() interface changes in Bug 789382 r=ssitter
authorStefan Sitter <ssitter@gmail.com>
Thu, 13 Sep 2012 19:35:43 +0200
changeset 12264 6d5b06e82381bd10e45ba740dd18060fbe9eedb3
parent 12263 2c53684716c77ed2bd705c9b29ef94cba6ccc5f5
child 12265 313e5a6f520b6d423191fb6330c8da57aecbab04
push id738
push userbugzilla@standard8.plus.com
push dateMon, 08 Oct 2012 19:38:39 +0000
treeherdercomm-aurora@6694e4ec3767 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersssitter
bugs790015, 789382
Bug 790015 - Bustage fix after nsIScriptError::init() interface changes in Bug 789382 r=ssitter
calendar/base/src/calUtils.cpp
calendar/base/src/calUtils.h
--- a/calendar/base/src/calUtils.cpp
+++ b/calendar/base/src/calUtils.cpp
@@ -7,29 +7,29 @@
 #include "calUtils.h"
 
 extern "C" {
 #include "ical.h"
 }
 
 namespace cal {
 
-nsresult logError(PRUnichar const* msg) {
+nsresult logError(const nsAString& msg) {
     nsresult rc;
     nsCOMPtr<nsIScriptError> const scriptError(do_CreateInstance("@mozilla.org/scripterror;1", &rc));
     NS_ENSURE_SUCCESS(rc, rc);
-    rc = scriptError->Init(msg, nullptr, nullptr, 0, 0, nsIScriptError::errorFlag, "calendar");
+    rc = scriptError->Init(msg, EmptyString(), EmptyString(), 0, 0, nsIScriptError::errorFlag, "calendar");
     return getConsoleService()->LogMessage(scriptError);
 }
 
-nsresult logWarning(PRUnichar const* msg) {
+nsresult logWarning(const nsAString& msg) {
     nsresult rc;
     nsCOMPtr<nsIScriptError> const scriptError(do_CreateInstance("@mozilla.org/scripterror;1", &rc));
     NS_ENSURE_SUCCESS(rc, rc);
-    rc = scriptError->Init(msg, nullptr, nullptr, 0, 0, nsIScriptError::warningFlag, "calendar");
+    rc = scriptError->Init(msg, EmptyString(), EmptyString(), 0, 0, nsIScriptError::warningFlag, "calendar");
     return getConsoleService()->LogMessage(scriptError);
 }
 
 nsresult log(PRUnichar const* msg) {
     return getConsoleService()->LogStringMessage(msg);
 }
 
 nsCOMPtr<calITimezone> detectTimezone(icaltimetype const& icalt,
@@ -57,17 +57,17 @@ nsCOMPtr<calITimezone> detectTimezone(ic
     return floating();
 }
 
 void logMissingTimezone(char const* tzid) {
     // xxx todo: needs l10n
     nsString msg(NS_LITERAL_STRING("Timezone \""));
     msg += NS_ConvertUTF8toUTF16(tzid);
     msg += NS_LITERAL_STRING("\" not found, falling back to floating!");
-    logError(msg.get());
+    logError(msg);
 }
 
 icaltimezone * getIcalTimezone(calITimezone * tz) {
     icaltimezone * icaltz = nullptr;
     if (!tz) {
         NS_ASSERTION(false, "No Timezone passed to getIcalTimezone");
         return nullptr;
     }
--- a/calendar/base/src/calUtils.h
+++ b/calendar/base/src/calUtils.h
@@ -61,33 +61,33 @@ inline nsCOMPtr<calITimezoneService> get
         NS_RUNTIMEABORT("Could not load timezone service, brace yourself and prepare for crash");
     }
     return tzs;
 }
 
 /**
  * Logs an error.
  */
-nsresult logError(PRUnichar const* msg);
+nsresult logError(const nsAString& msg);
 inline nsresult logError(char const* msg) {
-    return logError(NS_ConvertASCIItoUTF16(msg).get());
+    return logError(NS_ConvertASCIItoUTF16(msg));
 }
 inline nsresult logError(nsACString const& msg) {
-    return logError(NS_ConvertASCIItoUTF16(msg).get());
+    return logError(NS_ConvertASCIItoUTF16(msg));
 }
 
 /**
  * Logs a warning.
  */
-nsresult logWarning(PRUnichar const* msg);
+nsresult logWarning(const nsAString& msg);
 inline nsresult logWarning(char const* msg) {
-    return logWarning(NS_ConvertASCIItoUTF16(msg).get());
+    return logWarning(NS_ConvertASCIItoUTF16(msg));
 }
 inline nsresult logWarning(nsACString const& msg) {
-    return logWarning(NS_ConvertASCIItoUTF16(msg).get());
+    return logWarning(NS_ConvertASCIItoUTF16(msg));
 }
 
 /**
  * Just logs.
  */
 nsresult log(PRUnichar const* msg);
 inline nsresult log(char const* msg) {
     return log(NS_ConvertASCIItoUTF16(msg).get());