diff options
-rw-r--r-- | comphelper/source/misc/lok.cxx | 15 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 6 | ||||
-rw-r--r-- | include/comphelper/lok.hxx | 5 |
3 files changed, 5 insertions, 21 deletions
diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx index 4e24ab9d391b..a4f60ac6c565 100644 --- a/comphelper/source/misc/lok.cxx +++ b/comphelper/source/misc/lok.cxx @@ -8,11 +8,6 @@ */ #include <comphelper/lok.hxx> -#include <comphelper/processfactory.hxx> - -#include <com/sun/star/linguistic2/LinguServiceManager.hpp> -#include <com/sun/star/linguistic2/XSpellChecker.hpp> - namespace comphelper { @@ -119,16 +114,6 @@ 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 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); diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx index 22f0c70556c7..7a293ca70352 100644 --- a/include/comphelper/lok.hxx +++ b/include/comphelper/lok.hxx @@ -10,10 +10,7 @@ #ifndef INCLUDED_COMPHELPER_LOK_HXX #define INCLUDED_COMPHELPER_LOK_HXX -#include <com/sun/star/lang/Locale.hpp> - #include <comphelper/comphelperdllapi.h> -#include <comphelper/sequence.hxx> // Interface between the LibreOfficeKit implementation called by LibreOfficeKit clients and other // LibreOffice code. @@ -71,8 +68,6 @@ COMPHELPER_DLLPUBLIC void statusIndicatorStart(); COMPHELPER_DLLPUBLIC void statusIndicatorSetValue(int percent); COMPHELPER_DLLPUBLIC void statusIndicatorFinish(); -COMPHELPER_DLLPUBLIC css::uno::Sequence< css::lang::Locale > getSpellLanguages(); - } } |