Bug 835738 - Use GUID_PROP_INPUTSCOPE declaration from inputscope.h r=jmathies
authorJacek Caban <jacek@codeweavers.com>
Wed, 30 Jan 2013 11:45:42 +0100
changeset 130226 bfe496ca5c4094a4ec653a0e1d7dbfd615d0d67e
parent 130225 054718506d8ce2bc6a536da0d0df82df7c3e2aad
child 130227 8aac8445c2bb730e2a5ee22a01074e41f16579a7
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmathies
bugs835738
milestone21.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 835738 - Use GUID_PROP_INPUTSCOPE declaration from inputscope.h r=jmathies
widget/windows/nsTextStore.cpp
widget/windows/nsTextStore.h
--- a/widget/windows/nsTextStore.cpp
+++ b/widget/windows/nsTextStore.cpp
@@ -7,25 +7,27 @@
 #include <algorithm>
 
 #ifdef MOZ_LOGGING
 #define FORCE_PR_LOG /* Allow logging in the release build */
 #endif // MOZ_LOGGING
 #include "prlog.h"
 
 #include "nscore.h"
-#include "nsTextStore.h"
 #include "nsWindow.h"
 #ifdef MOZ_METRO
 #include "winrt/MetroWidget.h"
 #endif
 #include "nsPrintfCString.h"
 #include "WinUtils.h"
 #include "mozilla/Preferences.h"
 
+#define INPUTSCOPE_INIT_GUID
+#include "nsTextStore.h"
+
 using namespace mozilla;
 using namespace mozilla::widget;
 
 #ifdef PR_LOGGING
 /**
  * TSF related code should log its behavior even on release build especially
  * in the interface methods.
  *
@@ -47,21 +49,16 @@ PRLogModuleInfo* sTextStoreLog = nullptr
 #endif // #ifdef PR_LOGGING
 
 #define IS_SEARCH static_cast<InputScope>(50)
 
 /******************************************************************/
 /* InputScopeImpl                                                 */
 /******************************************************************/
 
-// InputScope property GUID
-static const GUID GUID_PROP_INPUTSCOPE =
-  { 0x1713dd5a, 0x68e7, 0x4a5b,
-    { 0x9a, 0xf6, 0x59, 0x2a, 0x59, 0x5c, 0x77, 0x8d } };
-
 class InputScopeImpl MOZ_FINAL : public ITfInputScope
 {
 public:
   InputScopeImpl(const nsTArray<InputScope>& aList) :
     mRefCnt(1),
     mInputScopes(aList)
   {
     PR_LOG(sTextStoreLog, PR_LOG_ALWAYS,
--- a/widget/windows/nsTextStore.h
+++ b/widget/windows/nsTextStore.h
@@ -11,17 +11,23 @@
 #include "nsCOMPtr.h"
 #include "nsITimer.h"
 #include "nsIWidget.h"
 #include "nsWindowBase.h"
 #include "mozilla/Attributes.h"
 
 #include <msctf.h>
 #include <textstor.h>
-#include <InputScope.h>
+
+// GUID_PROP_INPUTSCOPE is declared in inputscope.h using INIT_GUID.
+// With initguid.h, we get its instance instead of extern declaration.
+#ifdef INPUTSCOPE_INIT_GUID
+#include <initguid.h>
+#endif
+#include <inputscope.h>
 
 struct ITfThreadMgr;
 struct ITfDocumentMgr;
 struct ITfDisplayAttributeMgr;
 struct ITfCategoryMgr;
 class nsWindow;
 class nsTextEvent;
 #ifdef MOZ_METRO