summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/misc/langtab.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 3540c316e472..272f8edf3fc6 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -17,7 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/i18n/DirectionProperty.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Any.h>
#include <i18nlangtag/lang.h>
#include <i18nlangtag/mslangid.hxx>
@@ -28,6 +31,7 @@
#include <svtools/langtab.hxx>
#include <unotools/syslocale.hxx>
#include <tools/resary.hxx>
+#include <officecfg/VCL.hxx>
using namespace ::com::sun::star;
@@ -129,6 +133,28 @@ const OUString ApplyLreOrRleEmbedding( const OUString &rText )
SvtLanguageTableImpl::SvtLanguageTableImpl() :
ResStringArray( SvtResId( STR_ARR_SVT_LANGUAGE_TABLE ) )
{
+ auto xNA = officecfg::VCL::ExtraLanguages::get();
+ uno::Sequence <OUString> rElementNames = xNA->getElementNames();
+ sal_Int32 nLen = rElementNames.getLength();
+ for (sal_Int32 i = 0; i < nLen; ++i)
+ {
+ OUString aName;
+ sal_Int32 nType = 0;
+ uno::Reference <container::XNameAccess> xNB;
+ xNA->getByName(rElementNames[i]) >>= xNB;
+ bool bSuccess = (xNB->getByName("Name") >>= aName) &&
+ (xNB->getByName("ScriptType") >>= nType);
+ if (bSuccess)
+ {
+ LanguageTag aLang(rElementNames[i]);
+ LanguageType nLangType = aLang.getLanguageType();
+ if (nType <= LanguageTag::ScriptType::RTL && nType > LanguageTag::ScriptType::UNKNOWN)
+ aLang.setScriptType(LanguageTag::ScriptType(nType));
+ sal_uInt32 nPos = FindIndex(nLangType);
+ if (nPos == RESARRAY_INDEX_NOTFOUND)
+ AddItem((aName.isEmpty() ? rElementNames[i] : aName), nLangType);
+ }
+ }
}
SvtLanguageTableImpl::~SvtLanguageTableImpl()