diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-06-27 14:35:31 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-06-27 14:35:31 +0000 |
commit | bd82b6d61b68d5de8684cc8e4bc484cbeb9dc780 (patch) | |
tree | c414017fb24bafe8324b10b621c6f6b36c7637e9 /accessibility/source/helper | |
parent | 9eb52b96f79280bf349a58b4cd80daa1a1f6a3f4 (diff) |
INTEGRATION: CWS a11ysep (1.1.2); FILE ADDED
2005/09/28 11:39:25 fs 1.1.2.2: manual resync (files have been moved herein from another location): licence change
2005/03/07 08:29:46 fs 1.1.2.1: #i44293# moved implementations herein from toolkit module
Diffstat (limited to 'accessibility/source/helper')
-rw-r--r-- | accessibility/source/helper/accresmgr.cxx | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/accessibility/source/helper/accresmgr.cxx b/accessibility/source/helper/accresmgr.cxx new file mode 100644 index 000000000000..5cd870d07bd9 --- /dev/null +++ b/accessibility/source/helper/accresmgr.cxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: accresmgr.cxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: hr $ $Date: 2007-06-27 15:35:31 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef ACCESSIBILITY_HELPER_TKARESMGR_HXX +#include <accessibility/helper/accresmgr.hxx> +#endif + +#ifndef _TOOLS_SIMPLERESMGR_HXX +#include <tools/simplerm.hxx> +#endif + +#ifndef _SV_SVAPP_HXX +#include <vcl/svapp.hxx> +#endif + + +// ----------------------------------------------------------------------------- +// TkResMgr +// ----------------------------------------------------------------------------- + +SimpleResMgr* TkResMgr::m_pImpl = NULL; + +// ----------------------------------------------------------------------------- + +TkResMgr::EnsureDelete::~EnsureDelete() +{ + delete TkResMgr::m_pImpl; +} + +// ----------------------------------------------------------------------------- + +void TkResMgr::ensureImplExists() +{ + if (m_pImpl) + return; + + ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale(); + + ByteString sResMgrName( "tk" ); + sResMgrName += ByteString::CreateFromInt32( (sal_Int32)SUPD ); + + m_pImpl = SimpleResMgr::Create( sResMgrName.GetBuffer(), aLocale ); + + if (m_pImpl) + { + // now that we have a impl class, make sure it's deleted on unloading the library + static TkResMgr::EnsureDelete s_aDeleteTheImplClass; + } +} + +// ----------------------------------------------------------------------------- + +::rtl::OUString TkResMgr::loadString( sal_uInt16 nResId ) +{ + ::rtl::OUString sReturn; + + ensureImplExists(); + if ( m_pImpl ) + sReturn = m_pImpl->ReadString( nResId ); + + return sReturn; +} + +// ----------------------------------------------------------------------------- |