Skip to content

Commit d43c55c

Browse files
author
Trevor Saunders
committed
bug 949821 - use MOZ_UTF16 more and NS_LITERAL_STRING less r=froydnj
1 parent e3d76f3 commit d43c55c

File tree

97 files changed

+284
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+284
-284
lines changed

accessible/src/generic/Accessible.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3267,36 +3267,36 @@ KeyBinding::ToPlatformFormat(nsAString& aValue) const
32673267
return;
32683268

32693269
nsAutoString separator;
3270-
keyStringBundle->GetStringFromName(NS_LITERAL_STRING("MODIFIER_SEPARATOR").get(),
3270+
keyStringBundle->GetStringFromName(MOZ_UTF16("MODIFIER_SEPARATOR"),
32713271
getter_Copies(separator));
32723272

32733273
nsAutoString modifierName;
32743274
if (mModifierMask & kControl) {
3275-
keyStringBundle->GetStringFromName(NS_LITERAL_STRING("VK_CONTROL").get(),
3275+
keyStringBundle->GetStringFromName(MOZ_UTF16("VK_CONTROL"),
32763276
getter_Copies(modifierName));
32773277

32783278
aValue.Append(modifierName);
32793279
aValue.Append(separator);
32803280
}
32813281

32823282
if (mModifierMask & kAlt) {
3283-
keyStringBundle->GetStringFromName(NS_LITERAL_STRING("VK_ALT").get(),
3283+
keyStringBundle->GetStringFromName(MOZ_UTF16("VK_ALT"),
32843284
getter_Copies(modifierName));
32853285

32863286
aValue.Append(modifierName);
32873287
aValue.Append(separator);
32883288
}
32893289

32903290
if (mModifierMask & kShift) {
3291-
keyStringBundle->GetStringFromName(NS_LITERAL_STRING("VK_SHIFT").get(),
3291+
keyStringBundle->GetStringFromName(MOZ_UTF16("VK_SHIFT"),
32923292
getter_Copies(modifierName));
32933293

32943294
aValue.Append(modifierName);
32953295
aValue.Append(separator);
32963296
}
32973297

32983298
if (mModifierMask & kMeta) {
3299-
keyStringBundle->GetStringFromName(NS_LITERAL_STRING("VK_META").get(),
3299+
keyStringBundle->GetStringFromName(MOZ_UTF16("VK_META"),
33003300
getter_Copies(modifierName));
33013301

33023302
aValue.Append(modifierName);

accessible/src/generic/ApplicationAccessible.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ApplicationAccessible::Name(nsString& aName)
8282
return eNameOK;
8383

8484
nsXPIDLString appName;
85-
rv = bundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
85+
rv = bundle->GetStringFromName(MOZ_UTF16("brandShortName"),
8686
getter_Copies(appName));
8787
if (NS_FAILED(rv) || appName.IsEmpty()) {
8888
NS_WARNING("brandShortName not found, using default app name");

browser/components/shell/src/nsGNOMEShellService.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ nsGNOMEShellService::SetDefaultBrowser(bool aClaimAllTypes,
285285
NS_ENSURE_SUCCESS(rv, rv);
286286

287287
nsString brandShortName;
288-
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
288+
brandBundle->GetStringFromName(MOZ_UTF16("brandShortName"),
289289
getter_Copies(brandShortName));
290290

291291
// use brandShortName as the application id.
@@ -430,7 +430,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
430430
rv = bundleService->CreateBundle(BRAND_PROPERTIES,
431431
getter_AddRefs(brandBundle));
432432
if (NS_SUCCEEDED(rv) && brandBundle) {
433-
rv = brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
433+
rv = brandBundle->GetStringFromName(MOZ_UTF16("brandShortName"),
434434
getter_Copies(brandName));
435435
NS_ENSURE_SUCCESS(rv, rv);
436436
}

browser/components/shell/src/nsWindowsShellService.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
867867
// e.g. "Desktop Background.bmp"
868868
nsString fileLeafName;
869869
rv = shellBundle->GetStringFromName
870-
(NS_LITERAL_STRING("desktopBackgroundLeafNameWin").get(),
870+
(MOZ_UTF16("desktopBackgroundLeafNameWin"),
871871
getter_Copies(fileLeafName));
872872
NS_ENSURE_SUCCESS(rv, rv);
873873

caps/src/nsScriptSecurityManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
11721172
NS_ConvertASCIItoUTF16 ucsTargetScheme(targetScheme);
11731173
const PRUnichar* formatStrings[] = { ucsTargetScheme.get() };
11741174
rv = sStrBundle->
1175-
FormatStringFromName(NS_LITERAL_STRING("ProtocolFlagError").get(),
1175+
FormatStringFromName(MOZ_UTF16("ProtocolFlagError"),
11761176
formatStrings,
11771177
ArrayLength(formatStrings),
11781178
getter_Copies(message));

content/base/src/EventSource.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,11 +987,11 @@ EventSource::ConsoleError()
987987

988988
if (mReadyState == CONNECTING && !mInterrupted) {
989989
rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
990-
NS_LITERAL_STRING("connectionFailure").get(),
990+
MOZ_UTF16("connectionFailure"),
991991
formatStrings, ArrayLength(formatStrings));
992992
} else {
993993
rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
994-
NS_LITERAL_STRING("netInterrupt").get(),
994+
MOZ_UTF16("netInterrupt"),
995995
formatStrings, ArrayLength(formatStrings));
996996
}
997997
NS_ENSURE_SUCCESS(rv, rv);

content/base/src/WebSocket.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@ WebSocket::ConsoleError()
176176

177177
if (mReadyState < WebSocket::OPEN) {
178178
PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
179-
NS_LITERAL_STRING("connectionFailure").get(),
179+
MOZ_UTF16("connectionFailure"),
180180
formatStrings, ArrayLength(formatStrings));
181181
} else {
182182
PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
183-
NS_LITERAL_STRING("netInterrupt").get(),
183+
MOZ_UTF16("netInterrupt"),
184184
formatStrings, ArrayLength(formatStrings));
185185
}
186186
}

content/base/src/nsContentUtils.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -531,12 +531,12 @@ nsContentUtils::InitializeModifierStrings()
531531
nsXPIDLString modifierSeparator;
532532
if (bundle) {
533533
//macs use symbols for each modifier key, so fetch each from the bundle, which also covers i18n
534-
bundle->GetStringFromName(NS_LITERAL_STRING("VK_SHIFT").get(), getter_Copies(shiftModifier));
535-
bundle->GetStringFromName(NS_LITERAL_STRING("VK_META").get(), getter_Copies(metaModifier));
536-
bundle->GetStringFromName(NS_LITERAL_STRING("VK_WIN").get(), getter_Copies(osModifier));
537-
bundle->GetStringFromName(NS_LITERAL_STRING("VK_ALT").get(), getter_Copies(altModifier));
538-
bundle->GetStringFromName(NS_LITERAL_STRING("VK_CONTROL").get(), getter_Copies(controlModifier));
539-
bundle->GetStringFromName(NS_LITERAL_STRING("MODIFIER_SEPARATOR").get(), getter_Copies(modifierSeparator));
534+
bundle->GetStringFromName(MOZ_UTF16("VK_SHIFT"), getter_Copies(shiftModifier));
535+
bundle->GetStringFromName(MOZ_UTF16("VK_META"), getter_Copies(metaModifier));
536+
bundle->GetStringFromName(MOZ_UTF16("VK_WIN"), getter_Copies(osModifier));
537+
bundle->GetStringFromName(MOZ_UTF16("VK_ALT"), getter_Copies(altModifier));
538+
bundle->GetStringFromName(MOZ_UTF16("VK_CONTROL"), getter_Copies(controlModifier));
539+
bundle->GetStringFromName(MOZ_UTF16("MODIFIER_SEPARATOR"), getter_Copies(modifierSeparator));
540540
}
541541
//if any of these don't exist, we get an empty string
542542
sShiftText = new nsString(shiftModifier);
@@ -6006,12 +6006,12 @@ nsContentUtils::PlatformToDOMLineBreaks(nsString &aString)
60066006
{
60076007
if (aString.FindChar(PRUnichar('\r')) != -1) {
60086008
// Windows linebreaks: Map CRLF to LF:
6009-
aString.ReplaceSubstring(NS_LITERAL_STRING("\r\n").get(),
6010-
NS_LITERAL_STRING("\n").get());
6009+
aString.ReplaceSubstring(MOZ_UTF16("\r\n"),
6010+
MOZ_UTF16("\n"));
60116011

60126012
// Mac linebreaks: Map any remaining CR to LF:
6013-
aString.ReplaceSubstring(NS_LITERAL_STRING("\r").get(),
6014-
NS_LITERAL_STRING("\n").get());
6013+
aString.ReplaceSubstring(MOZ_UTF16("\r"),
6014+
MOZ_UTF16("\n"));
60156015
}
60166016
}
60176017

content/base/src/nsPlainTextSerializer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ nsPlainTextSerializer::DoOpenContainer(nsIAtom* aTag)
570570
// importable, we use a TAB.
571571
if (GetLastBool(mHasWrittenCellsForRow)) {
572572
// Bypass |Write| so that the TAB isn't compressed away.
573-
AddToLine(NS_LITERAL_STRING("\t").get(), 1);
573+
AddToLine(MOZ_UTF16("\t"), 1);
574574
mInWhitespace = true;
575575
}
576576
else if (mHasWrittenCellsForRow.IsEmpty()) {
@@ -1173,7 +1173,7 @@ static bool
11731173
IsSpaceStuffable(const PRUnichar *s)
11741174
{
11751175
if (s[0] == '>' || s[0] == ' ' || s[0] == kNBSP ||
1176-
nsCRT::strncmp(s, NS_LITERAL_STRING("From ").get(), 5) == 0)
1176+
nsCRT::strncmp(s, MOZ_UTF16("From "), 5) == 0)
11771177
return true;
11781178
else
11791179
return false;

content/canvas/src/WebGLContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ WebGLMemoryPressureObserver::Observe(nsISupports* aSubject,
8383
ProcessPriorityManager::CurrentProcessIsForeground())
8484
wantToLoseContext = false;
8585
else if (!nsCRT::strcmp(aSomeData,
86-
NS_LITERAL_STRING("heap-minimize").get()))
86+
MOZ_UTF16("heap-minimize")))
8787
wantToLoseContext = mContext->mLoseContextOnHeapMinimize;
8888

8989
if (wantToLoseContext)

0 commit comments

Comments
 (0)