diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-02-10 22:12:03 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-02-10 22:59:45 +0100 |
commit | 05d48fb71f85af3bd66ff1156b71f8d95ea7a411 (patch) | |
tree | bad4418d259fc2c8908da5839509456ee565a6e3 /basic | |
parent | f7eae4c89c76ba3ae219e9f0869d9a07a2fb4889 (diff) |
add SbGlobal for shared static objects
Diffstat (limited to 'basic')
-rw-r--r-- | basic/Library_sb.mk | 1 | ||||
-rw-r--r-- | basic/Package_inc.mk | 1 | ||||
-rw-r--r-- | basic/inc/basic/global.hxx | 45 | ||||
-rw-r--r-- | basic/source/classes/global.cxx | 50 |
4 files changed, 97 insertions, 0 deletions
diff --git a/basic/Library_sb.mk b/basic/Library_sb.mk index 04dad27756c5..017168278608 100644 --- a/basic/Library_sb.mk +++ b/basic/Library_sb.mk @@ -70,6 +70,7 @@ $(eval $(call gb_Library_add_exception_objects,sb,\ basic/source/basmgr/vbahelper \ basic/source/classes/errobject \ basic/source/classes/eventatt \ + basic/source/classes/global \ basic/source/classes/image \ basic/source/classes/propacc \ basic/source/classes/sb \ diff --git a/basic/Package_inc.mk b/basic/Package_inc.mk index 603e6945f26c..1b1da04589c8 100644 --- a/basic/Package_inc.mk +++ b/basic/Package_inc.mk @@ -44,6 +44,7 @@ $(eval $(call gb_Package_add_file,basic_inc,inc/basic/sbxdef.hxx,basic/sbxdef.hx $(eval $(call gb_Package_add_file,basic_inc,inc/basic/sbxfac.hxx,basic/sbxfac.hxx)) $(eval $(call gb_Package_add_file,basic_inc,inc/basic/sbxform.hxx,basic/sbxform.hxx)) $(eval $(call gb_Package_add_file,basic_inc,inc/basic/sbx.hxx,basic/sbx.hxx)) +$(eval $(call gb_Package_add_file,basic_inc,inc/basic/global.hxx,basic/global.hxx)) $(eval $(call gb_Package_add_file,basic_inc,inc/basic/sbxmeth.hxx,basic/sbxmeth.hxx)) $(eval $(call gb_Package_add_file,basic_inc,inc/basic/sbxobj.hxx,basic/sbxobj.hxx)) $(eval $(call gb_Package_add_file,basic_inc,inc/basic/sbxprop.hxx,basic/sbxprop.hxx)) diff --git a/basic/inc/basic/global.hxx b/basic/inc/basic/global.hxx new file mode 100644 index 000000000000..75c5d625a99e --- /dev/null +++ b/basic/inc/basic/global.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef BASIC_SBGLOBAL_HXX +#define BASIC_SBGLOBAL_HXX + +namespace utl { + class TransliterationWrapper; +} + +class SbGlobal +{ + static utl::TransliterationWrapper* pTransliteration; +public: + static utl::TransliterationWrapper* GetTransliteration(); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basic/source/classes/global.cxx b/basic/source/classes/global.cxx new file mode 100644 index 000000000000..023ed85a32c1 --- /dev/null +++ b/basic/source/classes/global.cxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "basic/global.hxx" +#include <unotools/transliterationwrapper.hxx> +#include <comphelper/processfactory.hxx> +#include <i18npool/lang.h> +#include <vcl/svapp.hxx> + +utl::TransliterationWrapper* SbGlobal::pTransliteration = NULL; + +utl::TransliterationWrapper* SbGlobal::GetTransliteration() +{ + if(!pTransliteration) + { + const LanguageType eOfficeLanguage = Application::GetSettings().GetLanguage(); + pTransliteration = new ::utl::TransliterationWrapper( + comphelper::getProcessServiceFactory(), + com::sun::star::i18n::TransliterationModules_IGNORE_CASE ); + pTransliteration->loadModuleIfNeeded( eOfficeLanguage ); + } + return pTransliteration; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |