diff options
Diffstat (limited to 'comphelper/source/misc/lok.cxx')
-rw-r--r-- | comphelper/source/misc/lok.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
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 <comphelper/lok.hxx> +#include <comphelper/processfactory.hxx> + +#include <com/sun/star/linguistic2/LinguServiceManager.hpp> +#include <com/sun/star/linguistic2/XSpellChecker.hpp> + 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 |