diff options
author | Justin Luth <justin_luth@sil.org> | 2018-02-02 14:53:40 +0300 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-02-02 15:15:43 +0100 |
commit | 427c0804cd4aecde1cadb7cb3c4f3487991bd573 (patch) | |
tree | 14a721a18fb1309aeb1b834f7922e27952d72fb8 /sfx2 | |
parent | ecaabbf527f6f6207ce1ca8924708d23e6db45f5 (diff) |
init known ExtraLanguages before document loads
Extensions can add RegisterOnTheFly languages for spell checkers.
A late initialization of the LanguageTable resulted in the inability
to recognize the available spell checker.
So, if a .doc file had an onTheFly language inside, and it was
the first document that LibreOffice opened, then the spell checking
extension was disabled for any other document opened while LibreOffice
was living, including docx and odt files. (Starting with a blank
document, or a .docx or .odt file seems to initialize OK - and
then subsequent .doc files are also ok in those sessions.)
Ensuring that the static LanguageTable is intialized early in the process
avoids this headache.
In my case, .doc was failing with:
LanguageTag::registerOnTheFly: not cross-inserted
0x7e0 for 'kbo' have 'en-US'
but with this patch now matches .odt/docx with:
LanguageTag::registerOnTheFly: cross-inserted
0x7e0 for 'kbo' [have 'kbo']
This fixes .ods .odg, odp,
.xls .xlsx .ppt, pptx
.doc and likely many others
Change-Id: Ie6dcbfd73e063eef4573016c3c62d29cf8ad43ca
Reviewed-on: https://gerrit.libreoffice.org/49142
Reviewed-by: Martin Hosken <martin_hosken@sil.org>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 328f3e353b07..fc290b791fd6 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -72,6 +72,7 @@ #include <comphelper/fileformat.h> #include <comphelper/processfactory.hxx> #include <comphelper/interaction.hxx> +#include <svtools/langtab.hxx> #include <svtools/sfxecode.hxx> #include <unotools/configmgr.hxx> #include <unotools/securityoptions.hxx> @@ -644,6 +645,9 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed ) pImpl->nLoadedFlags = SfxLoadedFlags::NONE; pImpl->bModelInitialized = false; + // initialize static language table so language-related extensions are learned before the document loads + (void)SvtLanguageTable::GetLanguageEntryCount(); + //TODO/LATER: make a clear strategy how to handle "UsesStorage" etc. bool bOwnStorageFormat = IsOwnStorageFormat( *pMedium ); bool bHasStorage = IsPackageStorageFormat_Impl( *pMedium ); |