summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-10-03 10:01:40 +0200
committerJan Holesovsky <kendy@collabora.com>2017-10-03 10:03:45 +0200
commit055766f79ef74e1774d0f434ac13c6276d849902 (patch)
treee73e0f39b8434f28a36eee55f15739956a559aa5 /desktop
parent9127d1a89cbfba89eb9df6755ea7b9e161cfc67a (diff)
LOK: getSpellLanguages() is not necessary in comphelper in the end.
Change-Id: If81cd3d4508ba3f44304a9ec9b643bf771e8930c
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ff186f69eacd..9a0bd8737925 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2420,7 +2420,11 @@ static void doc_resetSelection(LibreOfficeKitDocument* pThis)
static char* getLanguages(const char* pCommand)
{
- uno::Sequence< css::lang::Locale > aLocales(comphelper::LibreOfficeKit::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 >());
boost::property_tree::ptree aTree;
aTree.put("commandName", pCommand);