Bugzilla – Attachment 79460 Details for
Bug 54493
On Windows auto enable CJK or CTL features if a keyboard layout in that category is installed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Partial patch
54493.patch (text/plain), 2.17 KB, created by
Marc Garcia
on 2013-05-17 09:47:55 UTC
(
hide
)
Description:
Partial patch
Filename:
MIME Type:
Creator:
Marc Garcia
Created:
2013-05-17 09:47:55 UTC
Size:
2.17 KB
patch
obsolete
>diff --git a/include/svl/languageoptions.hxx b/include/svl/languageoptions.hxx >index ef8fb1b..96698c0 100644 >--- a/include/svl/languageoptions.hxx >+++ b/include/svl/languageoptions.hxx >@@ -97,6 +97,8 @@ class SVL_DLLPUBLIC SvtSystemLanguageOptions : public utl::ConfigItem > { > private: > OUString m_sWin16SystemLocale; >+ >+ bool isKeyboardLayoutTypeInstalled(sal_Int16 scriptType); > > public: > SvtSystemLanguageOptions(); >@@ -106,6 +108,9 @@ public: > virtual void Notify( const com::sun::star::uno::Sequence< OUString >& rPropertyNames ); > > LanguageType GetWin16SystemLanguage(); >+ >+ bool isCTLKeyboardLayoutInstalled(); >+ bool isCJKKeyboardLayoutInstalled(); > }; > > #endif // _SVTOOLS_LANGUAGEOPTIONS_HXX >diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx >index eb7a711..2d03097 100644 >--- a/svl/source/config/languageoptions.cxx >+++ b/svl/source/config/languageoptions.cxx >@@ -28,6 +28,8 @@ > #include <com/sun/star/i18n/ScriptType.hpp> > #include <unotools/syslocale.hxx> > >+#include <windows.h> >+ > using namespace ::com::sun::star; > // global ---------------------------------------------------------------------- > >@@ -205,4 +207,39 @@ LanguageType SvtSystemLanguageOptions::GetWin16SystemLanguage() > } > > >+bool SvtSystemLanguageOptions::isKeyboardLayoutTypeInstalled(sal_Int16 scriptType) >+{ >+ bool isInstalled = false; >+ >+ int nLayouts = GetKeyboardLayoutList(0, NULL); >+ if (nLayouts > 0) >+ { >+ HKL *lpList = (HKL*)LocalAlloc(LPTR, (nLayouts * sizeof(HKL))); >+ nLayouts = GetKeyboardLayoutList(nLayouts, lpList); >+ >+ for(int i = 0; i < nLayouts; ++i) >+ { >+ LCID lang = MAKELCID(((UINT)lpList[i] & 0xffffffff), SORT_DEFAULT); >+ if (MsLangId::getScriptType(lang) == scriptType) >+ isInstalled = true; >+ } >+ >+ if (lpList) LocalFree(lpList); >+ } >+ >+ return isInstalled; >+} >+ >+ >+bool SvtSystemLanguageOptions::isCTLKeyboardLayoutInstalled() >+{ >+ return isKeyboardLayoutTypeInstalled(::com::sun::star::i18n::ScriptType::COMPLEX); >+} >+ >+ >+bool SvtSystemLanguageOptions::isCJKKeyboardLayoutInstalled() >+{ >+ return isKeyboardLayoutTypeInstalled(::com::sun::star::i18n::ScriptType::ASIAN); >+} >+ > /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 54493
: 79460