Kaydet (Commit) d785b4dd authored tarafından Jan Holesovsky's avatar Jan Holesovsky

lok: Fix declaration of ‘xContext’ shadows a global declaration.

Change-Id: Iab3c142cd85ca54bf3c37a0710ce7da7a5d77a35
üst 409c230e
...@@ -2420,11 +2420,20 @@ static void doc_resetSelection(LibreOfficeKitDocument* pThis) ...@@ -2420,11 +2420,20 @@ static void doc_resetSelection(LibreOfficeKitDocument* pThis)
static char* getLanguages(const char* pCommand) static char* getLanguages(const char* pCommand)
{ {
css::uno::Reference< css::uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext(); css::uno::Sequence< css::lang::Locale > aLocales;
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); if (xContext.is())
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 >()); 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();
}
}
boost::property_tree::ptree aTree; boost::property_tree::ptree aTree;
aTree.put("commandName", pCommand); aTree.put("commandName", pCommand);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment