summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorMert Tumer <mert.tumer@collabora.com>2022-05-10 13:06:06 +0300
committerMert Tumer <mert.tumer@collabora.com>2022-06-14 16:13:22 +0200
commit7686dceb70881e8a3c4ac7f18ced15e5202de8c7 (patch)
treeb73601bbbc496eef7796349e224eadcd702d012a /unotools
parentb5e01104fc7df9b715a70bc1cc86ad1af13b51fa (diff)
LanguageTool Grammar Checker implementation
Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Change-Id: I275cbea668afc5beb5147370119631df8b6a2d46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135464
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/lingucfg.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index f37fffb5734a..f65340253401 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -929,6 +929,27 @@ bool SvtLinguConfig::GetSupportedDictionaryFormatsFor(
return bSuccess;
}
+bool SvtLinguConfig::GetLocaleListFor( const OUString &rSetName, const OUString &rSetEntry, css::uno::Sequence< OUString > &rLocaleList ) const
+{
+ if (rSetName.isEmpty() || rSetEntry.isEmpty())
+ return false;
+ bool bSuccess = false;
+ try
+ {
+ uno::Reference< container::XNameAccess > xNA( GetMainUpdateAccess(), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName("ServiceManager"), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName( rSetName ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName( rSetEntry ), uno::UNO_QUERY_THROW );
+ if (xNA->getByName( "Locales" ) >>= rLocaleList)
+ bSuccess = true;
+ DBG_ASSERT( rLocaleList.hasElements(), "Locale list is empty" );
+ }
+ catch (uno::Exception &)
+ {
+ }
+ return bSuccess;
+}
+
static bool lcl_GetFileUrlFromOrigin(
OUString /*out*/ &rFileUrl,
const OUString &rOrigin )