Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / basic / source / classes / global.cxx
blob1e72e242d94b7781f17d0d30d0862b7959cda54a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <comphelper/processfactory.hxx>
11 #include <i18nlangtag/lang.h>
12 #include <i18nutil/transliteration.hxx>
13 #include <rtl/instance.hxx>
14 #include <unotools/transliterationwrapper.hxx>
15 #include <vcl/svapp.hxx>
16 #include <vcl/settings.hxx>
18 #include <global.hxx>
20 namespace
22 class lclTransliterationWrapper
24 private:
25 utl::TransliterationWrapper m_aTransliteration;
26 public:
27 lclTransliterationWrapper()
28 : m_aTransliteration(
29 comphelper::getProcessComponentContext(),
30 TransliterationFlags::IGNORE_CASE )
32 const LanguageType eOfficeLanguage = Application::GetSettings().GetLanguageTag().getLanguageType();
33 m_aTransliteration.loadModuleIfNeeded( eOfficeLanguage );
35 utl::TransliterationWrapper& getTransliteration() { return m_aTransliteration; }
38 class theTransliterationWrapper : public rtl::Static<lclTransliterationWrapper, theTransliterationWrapper> {};
41 utl::TransliterationWrapper& SbGlobal::GetTransliteration()
43 return theTransliterationWrapper::get().getTransliteration();
46 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */