Bug 54493 - On Windows auto enable CJK or CTL features if a keyboard layout in that category is installed
Summary: On Windows auto enable CJK or CTL features if a keyboard layout in that categ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Linguistic (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:4.2.0
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Blocks: 47969
  Show dependency treegraph
 
Reported: 2012-09-04 11:43 UTC by Caolán McNamara
Modified: 2015-12-15 23:35 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Partial patch (2.17 KB, patch)
2013-05-17 09:47 UTC, Marc Garcia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Caolán McNamara 2012-09-04 11:43:00 UTC
Follow the uses of GetWin16SystemLanguage in the source to find the right places to implement and use this. (http://opengrok.libreoffice.org/search?q=getwin16systemlanguage&project=core)

Something like a 
bool SvtSystemLanguageOptions::isCTLKeyboardLayoutInstalled() and
bool SvtSystemLanguageOptions::isCJKKeyboardLayoutInstalled()
implemented by using the MS GetKeyboardLayoutList to get a list of installed keyboards ids, which should be usable with MsLangId::getScriptType to categorize into our ideas of CJK and CTL would likely do the trick
Comment 1 Marc Garcia 2013-05-13 09:30:04 UTC
I'm working on this, please let me know if you plan to do so.
Comment 2 Marc Garcia 2013-05-17 09:47:55 UTC
Created attachment 79460 [details]
Partial patch
Comment 3 Caolán McNamara 2013-06-21 12:33:27 UTC
This looks great to me, are you still working on this or are you stuck ?

IMO it just needs an ifdef WNT around the body (and a break after the isInstalled = true; because we only need to know if one is installed) and then just to use this as an extra || condition in the places that look for some evidence that CJK and CTL would be a good idea to default enable on, e.g. turn http://opengrok.libreoffice.org/xref/core/svl/source/config/cjkoptions.cxx#201 into something like...

    204     sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage(LANGUAGE_SYSTEM);
    205     if ( !bCJKFont && ( aSystemLocaleSettings.isCJKKeyboardLayoutInstalled() || ( nScriptType & SCRIPTTYPE_ASIAN ) ||
    206              ((eSystemLanguage != LANGUAGE_SYSTEM)  && ( nWinScript & SCRIPTTYPE_ASIAN ))))
    207     {
    208         SetAll(sal_True);
    209     }
Comment 4 Marc Garcia 2013-07-12 13:29:21 UTC
Sorry, I can't work on this anymore.
Comment 5 Caolán McNamara 2013-07-12 13:54:58 UTC
No problem, thanks for the windows specific bit. I can knock the rest of it together myself I think.
Comment 6 Commit Notification 2013-07-12 14:16:39 UTC
Marc Garcia committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a865cec5d3af824e3d4f6c1d6401ecb743e4f09b

Related: fdo#54493 determine if a CJK/CTL keyboard is installed



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2013-07-12 14:16:57 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d75dd80abb28cdb126a12840597d0384dd43897e

Resolves: fdo#54493 autoenable CJK/CTL ui based on installed keyboards



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Robinson Tryon (qubit) 2015-12-15 23:35:31 UTC
Migrating Whiteboard tags to Keywords: (EasyHack, DifficultyBeginner, SkillCpp )
[NinjaEdit]