Bug 232691 - replace nsString() nsAutoString() and friends with EmptyC?String(). r=jonas
authorEdmund Wong <ewong@pw-wspx.org>
Tue, 18 May 2010 09:50:14 +0200
changeset 42408 9fbcdeef28c0068b2c95630fc1953c88823fe7f9
parent 42407 f5e8565a6b73c5e785b8ea014bae0e6d8c478ed5
child 42409 41e6a1ad820d55043f9f8132b3e30f91dd1add9b
push idunknown
push userunknown
push dateunknown
reviewersjonas
bugs232691
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 232691 - replace nsString() nsAutoString() and friends with EmptyC?String(). r=jonas
accessible/src/html/nsHTMLImageAccessible.cpp
toolkit/components/places/src/nsNavHistory.cpp
toolkit/xre/nsNativeAppSupportUnix.cpp
widget/src/cocoa/nsMenuItemIconX.mm
widget/src/windows/nsDeviceContextSpecWin.cpp
--- a/accessible/src/html/nsHTMLImageAccessible.cpp
+++ b/accessible/src/html/nsHTMLImageAccessible.cpp
@@ -180,17 +180,17 @@ nsHTMLImageAccessible::DoAction(PRUint8 
     nsCOMPtr<nsIDOMDocument> domDocument;
     rv = mDOMNode->GetOwnerDocument(getter_AddRefs(domDocument));
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr<nsIDocument> document(do_QueryInterface(domDocument));
     nsCOMPtr<nsPIDOMWindow> piWindow = document->GetWindow();
     nsCOMPtr<nsIDOMWindowInternal> win(do_QueryInterface(piWindow));
     NS_ENSURE_TRUE(win, NS_ERROR_FAILURE);
     nsCOMPtr<nsIDOMWindow> tmp;
-    return win->Open(longDesc, NS_LITERAL_STRING(""), NS_LITERAL_STRING(""),
+    return win->Open(longDesc, EmptyString(), EmptyString(),
                      getter_AddRefs(tmp));
   }
   return nsLinkableAccessible::DoAction(aIndex);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleImage
 
--- a/toolkit/components/places/src/nsNavHistory.cpp
+++ b/toolkit/components/places/src/nsNavHistory.cpp
@@ -934,17 +934,17 @@ mozStorageFunctionGetUnreversedHost::OnF
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (src.Length()>1) {
     src.Truncate(src.Length() - 1);
     nsAutoString dest;
     ReverseString(src, dest);
     result->SetAsAString(dest);
   } else {
-    result->SetAsAString(NS_LITERAL_STRING(""));
+    result->SetAsAString(EmptyString());
   }
   NS_ADDREF(*_retval = result);
   return NS_OK;
 }
 
 nsresult
 nsNavHistory::InitTempTables()
 {
--- a/toolkit/xre/nsNativeAppSupportUnix.cpp
+++ b/toolkit/xre/nsNativeAppSupportUnix.cpp
@@ -230,17 +230,17 @@ OssoSetWindowOrientation(PRBool aPortrai
   if (lockScreen)
     return;
 
   // Tell Hildon desktop to force our window to be either portrait or landscape,
   // depending on the current rotation
   // NOTE: We only update the most recent top-level window so this is only
   //       suitable for apps with only one window.
   nsCOMPtr<nsIDOMWindowInternal> window;
-  GetMostRecentWindow(NS_LITERAL_STRING("").get(), getter_AddRefs(window));
+  GetMostRecentWindow(EmptyString(), getter_AddRefs(window));
   GtkWidget* widget = WidgetForDOMWindow(window);
   if (widget && widget->window) {
     GdkWindow *gdk = widget->window;
     GdkAtom request = gdk_atom_intern("_HILDON_PORTRAIT_MODE_REQUEST", FALSE);
 
     if (aPortrait) {
       gulong portrait_set = 1;
       gdk_property_change(gdk, request, gdk_x11_xatom_to_atom(XA_CARDINAL),
--- a/widget/src/cocoa/nsMenuItemIconX.mm
+++ b/widget/src/cocoa/nsMenuItemIconX.mm
@@ -209,18 +209,18 @@ nsMenuItemIconX::GetIconURI(nsIURI** aIc
     if (NS_FAILED(rv)) return rv;
 
     nsCOMPtr<nsIDOMViewCSS> domViewCSS = do_QueryInterface(domAbstractView);
     if (!domViewCSS) return NS_ERROR_FAILURE;
 
     nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(mContent);
     if (!domElement) return NS_ERROR_FAILURE;
 
-    nsAutoString empty;
-    rv = domViewCSS->GetComputedStyle(domElement, empty,
+
+    rv = domViewCSS->GetComputedStyle(domElement, EmptyString(),
                                       getter_AddRefs(cssStyleDecl));
     if (NS_FAILED(rv)) return rv;
 
     NS_NAMED_LITERAL_STRING(listStyleImage, "list-style-image");
     rv = cssStyleDecl->GetPropertyCSSValue(listStyleImage,
                                            getter_AddRefs(cssValue));
     if (NS_FAILED(rv)) return rv;
 
--- a/widget/src/windows/nsDeviceContextSpecWin.cpp
+++ b/widget/src/windows/nsDeviceContextSpecWin.cpp
@@ -1018,17 +1018,17 @@ GlobalPrinters::GetDefaultPrinterName(ns
     LPWSTR sPtr = szDefaultPrinterName;
     while (*sPtr != comma && *sPtr != 0) 
       sPtr++;
     if (*sPtr == comma) {
       *sPtr = NULL;
     }
     aDefaultPrinterName = szDefaultPrinterName;
   } else {
-    aDefaultPrinterName = NS_LITERAL_STRING("");
+    aDefaultPrinterName = EmptyString();
   }
 
   PR_PL(("DEFAULT PRINTER [%s]\n", aDefaultPrinterName.get()));
 #else
   aDefaultPrinterName = NS_LITERAL_STRING("UNKNOWN");
 #endif
 }