From f50bf3c5225b49b3c6f77f882e35305e5dc5ccd3 Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Mon, 2 Oct 2017 22:49:03 -0400 Subject: lok: use getCommandValues to obtain a list of languages Change-Id: I4a1f04b9dfe9e3ebbc174380db93c332e958ccfa Reviewed-on: https://gerrit.libreoffice.org/43060 Tested-by: Jenkins Reviewed-by: Henry Castro --- comphelper/source/misc/lok.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'comphelper/source') diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx index a4f60ac6c565..4e24ab9d391b 100644 --- a/comphelper/source/misc/lok.cxx +++ b/comphelper/source/misc/lok.cxx @@ -8,6 +8,11 @@ */ #include +#include + +#include +#include + namespace comphelper { @@ -114,6 +119,16 @@ void statusIndicatorFinish() pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Finish, 0); } +css::uno::Sequence< css::lang::Locale > getSpellLanguages() +{ + css::uno::Reference< css::uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext(); + css::uno::Reference< css::linguistic2::XLinguServiceManager2 > xLangSrv = css::linguistic2::LinguServiceManager::create(xContext); + css::uno::Reference< css::linguistic2::XSpellChecker > xSpell(xLangSrv.is() ? xLangSrv->getSpellChecker() : nullptr, css::uno::UNO_QUERY); + css::uno::Reference< css::linguistic2::XSupportedLocales > xLocales(xSpell, css::uno::UNO_QUERY); + css::uno::Sequence< css::lang::Locale > aLocales(xLocales.is() ? xLocales->getLocales() : css::uno::Sequence< css::lang::Locale >()); + return aLocales; +} + } // namespace LibreOfficeKit } // namespace comphelper -- cgit