Bug 866736 part.3 Replace CRLF in WinIMEHandler.(h|cpp) with LF r=jimm
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 28 Jun 2013 01:06:45 +0900
changeset 136692 10abfa7e0154209072e1ddc73be2e8236f18e0b1
parent 136691 765cd0d0dc5bcf4b519120cdf1922b0b431cf331
child 136693 8f7ef2198996cc0bed6d232d24bf343130addfbd
push id24892
push userphilringnalda@gmail.com
push dateFri, 28 Jun 2013 02:32:37 +0000
treeherdermozilla-central@8e3a124c9c1a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs866736
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 866736 part.3 Replace CRLF in WinIMEHandler.(h|cpp) with LF r=jimm
widget/windows/WinIMEHandler.cpp
widget/windows/WinIMEHandler.h
--- a/widget/windows/WinIMEHandler.cpp
+++ b/widget/windows/WinIMEHandler.cpp
@@ -30,24 +30,24 @@ IMEHandler::SetInputScopesFunc IMEHandle
 void
 IMEHandler::Initialize()
 {
 #ifdef NS_ENABLE_TSF
   nsTextStore::Initialize();
   sIsInTSFMode = nsTextStore::IsInTSFMode();
   if (!sIsInTSFMode) {
     // When full nsTextStore is not available, try to use SetInputScopes API
-    // to enable at least InputScope. Use GET_MODULE_HANDLE_EX_FLAG_PIN to
-    // ensure that msctf.dll will not be unloaded.
-    HMODULE module = nullptr;
-    if (GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_PIN, L"msctf.dll",
-                           &module)) {
-      sSetInputScopes = reinterpret_cast<SetInputScopesFunc>(
-        GetProcAddress(module, "SetInputScopes"));
-    }
+    // to enable at least InputScope. Use GET_MODULE_HANDLE_EX_FLAG_PIN to
+    // ensure that msctf.dll will not be unloaded.
+    HMODULE module = nullptr;
+    if (GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_PIN, L"msctf.dll",
+                           &module)) {
+      sSetInputScopes = reinterpret_cast<SetInputScopesFunc>(
+        GetProcAddress(module, "SetInputScopes"));
+    }
   }
 #endif // #ifdef NS_ENABLE_TSF
 
   nsIMM32Handler::Initialize();
 }
 
 // static
 void
@@ -281,18 +281,18 @@ IMEHandler::SetInputContext(nsWindow* aW
     nsTextStore::SetInputContext(aWindow, aInputContext, aAction);
     if (IsTSFAvailable()) {
       aInputContext.mNativeIMEContext = nsTextStore::GetTextStore();
       if (adjustOpenState) {
         nsTextStore::SetIMEOpenState(open);
       }
       return;
     }
-  } else {
-    // Set at least InputScope even when TextStore is not available.
+  } else {
+    // Set at least InputScope even when TextStore is not available.
     SetInputScopeForIMM32(aWindow, aInputContext.mHTMLInputType);
   }
 #endif // #ifdef NS_ENABLE_TSF
 
   nsIMEContext IMEContext(aWindow->GetWindowHandle());
   if (enable) {
     IMEContext.AssociateDefaultContext();
     if (!aInputContext.mNativeIMEContext) {
@@ -353,71 +353,71 @@ IMEHandler::CurrentKeyboardLayoutHasIME(
   }
 #endif // #ifdef NS_ENABLE_TSF
 
   return nsIMM32Handler::IsIMEAvailable();
 }
 #endif // #ifdef DEBUG
 
 // static
-void
+void
 IMEHandler::SetInputScopeForIMM32(nsWindow* aWindow,
-                                  const nsAString& aHTMLInputType)
+                                  const nsAString& aHTMLInputType)
 {
   if (sIsInTSFMode || !sSetInputScopes || aWindow->Destroyed()) {
     return;
   }
   UINT arraySize = 0;
   const InputScope* scopes = nullptr;
-  // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html
-  if (aHTMLInputType.IsEmpty() || aHTMLInputType.EqualsLiteral("text")) {
-    static const InputScope inputScopes[] = { IS_DEFAULT };
-    scopes = &inputScopes[0];
-    arraySize = ArrayLength(inputScopes);
-  } else if (aHTMLInputType.EqualsLiteral("url")) {
-    static const InputScope inputScopes[] = { IS_URL };
-    scopes = &inputScopes[0];
-    arraySize = ArrayLength(inputScopes);
-  } else if (aHTMLInputType.EqualsLiteral("search")) {
-    static const InputScope inputScopes[] = { IS_SEARCH };
-    scopes = &inputScopes[0];
-    arraySize = ArrayLength(inputScopes);
-  } else if (aHTMLInputType.EqualsLiteral("email")) {
-    static const InputScope inputScopes[] = { IS_EMAIL_SMTPEMAILADDRESS };
-    scopes = &inputScopes[0];
-    arraySize = ArrayLength(inputScopes);
-  } else if (aHTMLInputType.EqualsLiteral("password")) {
-    static const InputScope inputScopes[] = { IS_PASSWORD };
-    scopes = &inputScopes[0];
-    arraySize = ArrayLength(inputScopes);
-  } else if (aHTMLInputType.EqualsLiteral("datetime") ||
-             aHTMLInputType.EqualsLiteral("datetime-local")) {
-    static const InputScope inputScopes[] = {
-      IS_DATE_FULLDATE, IS_TIME_FULLTIME };
-    scopes = &inputScopes[0];
-    arraySize = ArrayLength(inputScopes);
-  } else if (aHTMLInputType.EqualsLiteral("date") ||
-             aHTMLInputType.EqualsLiteral("month") ||
-             aHTMLInputType.EqualsLiteral("week")) {
-    static const InputScope inputScopes[] = { IS_DATE_FULLDATE };
-    scopes = &inputScopes[0];
-    arraySize = ArrayLength(inputScopes);
-  } else if (aHTMLInputType.EqualsLiteral("time")) {
-    static const InputScope inputScopes[] = { IS_TIME_FULLTIME };
-    scopes = &inputScopes[0];
-    arraySize = ArrayLength(inputScopes);
-  } else if (aHTMLInputType.EqualsLiteral("tel")) {
-    static const InputScope inputScopes[] = {
-      IS_TELEPHONE_FULLTELEPHONENUMBER, IS_TELEPHONE_LOCALNUMBER };
-    scopes = &inputScopes[0];
-    arraySize = ArrayLength(inputScopes);
-  } else if (aHTMLInputType.EqualsLiteral("number")) {
-    static const InputScope inputScopes[] = { IS_NUMBER };
-    scopes = &inputScopes[0];
-    arraySize = ArrayLength(inputScopes);
+  // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html
+  if (aHTMLInputType.IsEmpty() || aHTMLInputType.EqualsLiteral("text")) {
+    static const InputScope inputScopes[] = { IS_DEFAULT };
+    scopes = &inputScopes[0];
+    arraySize = ArrayLength(inputScopes);
+  } else if (aHTMLInputType.EqualsLiteral("url")) {
+    static const InputScope inputScopes[] = { IS_URL };
+    scopes = &inputScopes[0];
+    arraySize = ArrayLength(inputScopes);
+  } else if (aHTMLInputType.EqualsLiteral("search")) {
+    static const InputScope inputScopes[] = { IS_SEARCH };
+    scopes = &inputScopes[0];
+    arraySize = ArrayLength(inputScopes);
+  } else if (aHTMLInputType.EqualsLiteral("email")) {
+    static const InputScope inputScopes[] = { IS_EMAIL_SMTPEMAILADDRESS };
+    scopes = &inputScopes[0];
+    arraySize = ArrayLength(inputScopes);
+  } else if (aHTMLInputType.EqualsLiteral("password")) {
+    static const InputScope inputScopes[] = { IS_PASSWORD };
+    scopes = &inputScopes[0];
+    arraySize = ArrayLength(inputScopes);
+  } else if (aHTMLInputType.EqualsLiteral("datetime") ||
+             aHTMLInputType.EqualsLiteral("datetime-local")) {
+    static const InputScope inputScopes[] = {
+      IS_DATE_FULLDATE, IS_TIME_FULLTIME };
+    scopes = &inputScopes[0];
+    arraySize = ArrayLength(inputScopes);
+  } else if (aHTMLInputType.EqualsLiteral("date") ||
+             aHTMLInputType.EqualsLiteral("month") ||
+             aHTMLInputType.EqualsLiteral("week")) {
+    static const InputScope inputScopes[] = { IS_DATE_FULLDATE };
+    scopes = &inputScopes[0];
+    arraySize = ArrayLength(inputScopes);
+  } else if (aHTMLInputType.EqualsLiteral("time")) {
+    static const InputScope inputScopes[] = { IS_TIME_FULLTIME };
+    scopes = &inputScopes[0];
+    arraySize = ArrayLength(inputScopes);
+  } else if (aHTMLInputType.EqualsLiteral("tel")) {
+    static const InputScope inputScopes[] = {
+      IS_TELEPHONE_FULLTELEPHONENUMBER, IS_TELEPHONE_LOCALNUMBER };
+    scopes = &inputScopes[0];
+    arraySize = ArrayLength(inputScopes);
+  } else if (aHTMLInputType.EqualsLiteral("number")) {
+    static const InputScope inputScopes[] = { IS_NUMBER };
+    scopes = &inputScopes[0];
+    arraySize = ArrayLength(inputScopes);
   }
   if (scopes && arraySize > 0) {
     sSetInputScopes(aWindow->GetWindowHandle(), scopes, arraySize, nullptr, 0,
                     nullptr, nullptr);
   }
 }
 
 } // namespace widget
--- a/widget/windows/WinIMEHandler.h
+++ b/widget/windows/WinIMEHandler.h
@@ -110,17 +110,17 @@ public:
   /**
    * Returns true when current keyboard layout has IME.  Otherwise, false.
    */
   static bool CurrentKeyboardLayoutHasIME();
 #endif // #ifdef DEBUG
 
 private:
 #ifdef NS_ENABLE_TSF
-  typedef HRESULT (WINAPI *SetInputScopesFunc)(HWND aindowHandle,
+  typedef HRESULT (WINAPI *SetInputScopesFunc)(HWND windowHandle,
                                                const InputScope *inputScopes,
                                                UINT numInputScopes,
                                                wchar_t **phrase_list,
                                                UINT numPhraseList,
                                                wchar_t *regExp,
                                                wchar_t *srgs);
   static SetInputScopesFunc sSetInputScopes;
   static void SetInputScopeForIMM32(nsWindow* aWindow,