desktop/source/lib/init.cxx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
New commits: commit 0c9924495eb8010eedd3c93641f995ae560b3aad Author: Ashod Nakashian <[email protected]> AuthorDate: Fri Jul 6 16:49:29 2018 -0400 Commit: Jan Holesovsky <[email protected]> CommitDate: Wed Sep 12 17:59:16 2018 +0200 desktop: move font initialization into preloadData Reviewed-on: https://gerrit.libreoffice.org/57160 Reviewed-by: Jan Holesovsky <[email protected]> Tested-by: Jan Holesovsky <[email protected]> (cherry picked from commit bbba0902fc1f1c6bb2a7f1e6ff2b682e2fbd3cc9) Change-Id: I66840512b45e987cc7b08b07b65bdb24f2023a41 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 1f5842e1ea26..9d5f43108672 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3795,9 +3795,35 @@ static void preloadData() images.getImageUrl("forcefed.png", "style", "FO_oo"); std::cerr << "Preload languages\n"; + // force load language singleton SvtLanguageTable::HasLanguageType(LANGUAGE_SYSTEM); LanguageTag::isValidBcp47("foo", nullptr); + + std::cerr << "Preload fonts\n"; + + // Initialize fonts. + css::uno::Reference<css::linguistic2::XLinguServiceManager2> xLangSrv = css::linguistic2::LinguServiceManager::create(xContext); + if (xLangSrv.is()) + { + css::uno::Reference<css::linguistic2::XSpellChecker> xSpell(xLangSrv->getSpellChecker(), css::uno::UNO_QUERY); + css::uno::Reference<css::linguistic2::XSupportedLocales> xLocales(xSpell, css::uno::UNO_QUERY); + if (xLocales.is()) + aLocales = xLocales->getLocales(); + } + + for (const auto& aLocale : aLocales) + { + //TODO: Add more types and cache more aggessively. For now this initializes the fontcache. + using namespace ::com::sun::star::i18n::ScriptType; + LanguageType nLang; + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale, false), LATIN); + OutputDevice::GetDefaultFont(DefaultFontType::LATIN_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale, false), ASIAN); + OutputDevice::GetDefaultFont(DefaultFontType::CJK_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale, false), COMPLEX); + OutputDevice::GetDefaultFont(DefaultFontType::CTL_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); + } } static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfileUrl) @@ -3928,30 +3954,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char preloadData(); - // Initialize fonts. - css::uno::Sequence< css::lang::Locale > aLocales; - css::uno::Reference<css::linguistic2::XLinguServiceManager2> xLangSrv = css::linguistic2::LinguServiceManager::create(xContext); - if (xLangSrv.is()) - { - css::uno::Reference<css::linguistic2::XSpellChecker> xSpell(xLangSrv->getSpellChecker(), css::uno::UNO_QUERY); - css::uno::Reference<css::linguistic2::XSupportedLocales> xLocales(xSpell, css::uno::UNO_QUERY); - if (xLocales.is()) - aLocales = xLocales->getLocales(); - } - - for (const auto& aLocale : aLocales) - { - //TODO: Add more types and cache more aggessively. For now this initializes the fontcache. - using namespace ::com::sun::star::i18n::ScriptType; - LanguageType nLang; - nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale, false), LATIN); - OutputDevice::GetDefaultFont(DefaultFontType::LATIN_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); - nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale, false), ASIAN); - OutputDevice::GetDefaultFont(DefaultFontType::CJK_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); - nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale, false), COMPLEX); - OutputDevice::GetDefaultFont(DefaultFontType::CTL_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); - } - // Release Solar Mutex, lo_startmain thread should acquire it. Application::ReleaseSolarMutex(); } commit 0f7dc36f3d8688805584f6269f722f4b75c83ea8 Author: Aron Budea <[email protected]> AuthorDate: Fri Jul 6 15:32:49 2018 +0200 Commit: Jan Holesovsky <[email protected]> CommitDate: Wed Sep 12 17:59:02 2018 +0200 desktop: move dictionary preload before font init spell-checker is initialized during font init since e7f65920b12517b31f0c5cbfd0dcb8df96d20ba4 Change-Id: Ia5b5223aa8cc00d0e80451142ae18a7046ad00d4 Reviewed-on: https://gerrit.libreoffice.org/57064 Reviewed-by: Ashod Nakashian <[email protected]> Tested-by: Ashod Nakashian <[email protected]> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a09bd793e159..1f5842e1ea26 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3926,6 +3926,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char VclBuilder::preload(); VclAbstractDialogFactory::Create(); + preloadData(); + // Initialize fonts. css::uno::Sequence< css::lang::Locale > aLocales; css::uno::Reference<css::linguistic2::XLinguServiceManager2> xLangSrv = css::linguistic2::LinguServiceManager::create(xContext); @@ -3950,8 +3952,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char OutputDevice::GetDefaultFont(DefaultFontType::CTL_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); } - preloadData(); - // Release Solar Mutex, lo_startmain thread should acquire it. Application::ReleaseSolarMutex(); } commit bcef1c1c21b5819343e2d4b324fe57635ffcb4a1 Author: Ashod Nakashian <[email protected]> AuthorDate: Thu Jun 28 01:07:32 2018 -0400 Commit: Jan Holesovsky <[email protected]> CommitDate: Wed Sep 12 17:58:49 2018 +0200 desktop: initialize fonts in pre-init Reviewed-on: https://gerrit.libreoffice.org/56573 Reviewed-by: Jan Holesovsky <[email protected]> Tested-by: Jan Holesovsky <[email protected]> (cherry picked from commit e7f65920b12517b31f0c5cbfd0dcb8df96d20ba4) Change-Id: I5a3acc41196c7e0672514fa2dae00e5fc0f76a1f diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 79e975ddbe6e..a09bd793e159 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -63,6 +63,7 @@ #include <com/sun/star/linguistic2/LinguServiceManager.hpp> #include <com/sun/star/linguistic2/XSpellChecker.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> #include <editeng/fontitem.hxx> #include <editeng/flstitem.hxx> @@ -105,6 +106,7 @@ #include <svl/undo.hxx> #include <unotools/datetime.hxx> #include <android/compatibility.hxx> +#include <i18nlangtag/mslangid.hxx> #include <i18nlangtag/languagetag.hxx> #include <vcl/builder.hxx> #include <vcl/abstdlg.hxx> @@ -3923,6 +3925,31 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char // Force load some modules VclBuilder::preload(); VclAbstractDialogFactory::Create(); + + // Initialize fonts. + css::uno::Sequence< css::lang::Locale > aLocales; + css::uno::Reference<css::linguistic2::XLinguServiceManager2> xLangSrv = css::linguistic2::LinguServiceManager::create(xContext); + if (xLangSrv.is()) + { + css::uno::Reference<css::linguistic2::XSpellChecker> xSpell(xLangSrv->getSpellChecker(), css::uno::UNO_QUERY); + css::uno::Reference<css::linguistic2::XSupportedLocales> xLocales(xSpell, css::uno::UNO_QUERY); + if (xLocales.is()) + aLocales = xLocales->getLocales(); + } + + for (const auto& aLocale : aLocales) + { + //TODO: Add more types and cache more aggessively. For now this initializes the fontcache. + using namespace ::com::sun::star::i18n::ScriptType; + LanguageType nLang; + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale, false), LATIN); + OutputDevice::GetDefaultFont(DefaultFontType::LATIN_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale, false), ASIAN); + OutputDevice::GetDefaultFont(DefaultFontType::CJK_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale, false), COMPLEX); + OutputDevice::GetDefaultFont(DefaultFontType::CTL_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); + } + preloadData(); // Release Solar Mutex, lo_startmain thread should acquire it. _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
