summaryrefslogtreecommitdiff
path: root/binfilter/bf_svtools/source/config/svt_languageoptions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'binfilter/bf_svtools/source/config/svt_languageoptions.cxx')
-rw-r--r--binfilter/bf_svtools/source/config/svt_languageoptions.cxx121
1 files changed, 121 insertions, 0 deletions
diff --git a/binfilter/bf_svtools/source/config/svt_languageoptions.cxx b/binfilter/bf_svtools/source/config/svt_languageoptions.cxx
new file mode 100644
index 000000000000..02285954548c
--- /dev/null
+++ b/binfilter/bf_svtools/source/config/svt_languageoptions.cxx
@@ -0,0 +1,121 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <bf_svtools/languageoptions.hxx>
+
+#include <bf_svtools/cjkoptions.hxx>
+#include <bf_svtools/ctloptions.hxx>
+#include <vcl/svapp.hxx>
+#include <i18npool/mslangid.hxx>
+
+#include <osl/mutex.hxx>
+#include <vcl/svapp.hxx>
+#include <osl/mutex.hxx>
+#include <rtl/instance.hxx>
+
+#include <com/sun/star/i18n/ScriptType.hpp>
+
+using namespace ::com::sun::star;
+// global ----------------------------------------------------------------------
+
+namespace { struct ALMutex : public rtl::Static< ::osl::Mutex, ALMutex > {}; }
+
+namespace binfilter
+{
+
+// -----------------------------------------------------------------------------
+// returns for a language the scripttype
+sal_uInt16 SvtLanguageOptions::GetScriptTypeOfLanguage( sal_uInt16 nLang )
+{
+ if( LANGUAGE_DONTKNOW == nLang )
+ nLang = LANGUAGE_ENGLISH_US;
+ else if( LANGUAGE_SYSTEM == nLang )
+ nLang = Application::GetSettings().GetLanguage();
+
+ sal_Int16 nScriptType = MsLangId::getScriptType( nLang );
+ USHORT nScript;
+ switch (nScriptType)
+ {
+ case ::com::sun::star::i18n::ScriptType::ASIAN:
+ nScript = SCRIPTTYPE_ASIAN;
+ break;
+ case ::com::sun::star::i18n::ScriptType::COMPLEX:
+ nScript = SCRIPTTYPE_COMPLEX;
+ break;
+ default:
+ nScript = SCRIPTTYPE_LATIN;
+ }
+ return nScript;
+}
+// -----------------------------------------------------------------------------
+
+
+/*-- 27.10.2005 08:18:01---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+SvtSystemLanguageOptions::SvtSystemLanguageOptions() :
+ utl::ConfigItem( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("System/L10N") ))
+{
+ uno::Sequence< rtl::OUString > aPropertyNames(1);
+ rtl::OUString* pNames = aPropertyNames.getArray();
+ pNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SystemLocale"));
+ uno::Sequence< uno::Any > aValues = GetProperties( aPropertyNames );
+
+ if ( aValues.getLength() )
+ {
+ aValues[0]>>= m_sWin16SystemLocale;
+ }
+}
+/*-- 27.10.2005 08:18:01---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+SvtSystemLanguageOptions::~SvtSystemLanguageOptions()
+{
+}
+/*-- 27.10.2005 08:18:02---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+void SvtSystemLanguageOptions::Commit()
+{
+ //does nothing
+}
+/*-- 27.10.2005 08:36:14---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+LanguageType SvtSystemLanguageOptions::GetWin16SystemLanguage()
+{
+ if( m_sWin16SystemLocale.getLength() == 0 )
+ return LANGUAGE_NONE;
+ return MsLangId::convertIsoStringToLanguage( m_sWin16SystemLocale );
+}
+
+ void SvtSystemLanguageOptions::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */