1*24acc546SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*24acc546SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*24acc546SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*24acc546SAndrew Rist * distributed with this work for additional information 6*24acc546SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*24acc546SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*24acc546SAndrew Rist * "License"); you may not use this file except in compliance 9*24acc546SAndrew Rist * with the License. You may obtain a copy of the License at 10*24acc546SAndrew Rist * 11*24acc546SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*24acc546SAndrew Rist * 13*24acc546SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*24acc546SAndrew Rist * software distributed under the License is distributed on an 15*24acc546SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*24acc546SAndrew Rist * KIND, either express or implied. See the License for the 17*24acc546SAndrew Rist * specific language governing permissions and limitations 18*24acc546SAndrew Rist * under the License. 19*24acc546SAndrew Rist * 20*24acc546SAndrew Rist *************************************************************/ 21*24acc546SAndrew Rist 22*24acc546SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_forms.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "frm_resource.hxx" 28cdf0e10cSrcweir #include <tools/simplerm.hxx> 29cdf0e10cSrcweir 30cdf0e10cSrcweir // ---- needed as long as we have no contexts for components --- 31cdf0e10cSrcweir #include <vcl/svapp.hxx> 32cdf0e10cSrcweir //--------------------------------------------------- 33cdf0e10cSrcweir 34cdf0e10cSrcweir #ifndef _SOLAR_HRC 35cdf0e10cSrcweir #include <svl/solar.hrc> 36cdf0e10cSrcweir #endif 37cdf0e10cSrcweir 38cdf0e10cSrcweir //......................................................................... 39cdf0e10cSrcweir namespace frm 40cdf0e10cSrcweir { 41cdf0e10cSrcweir 42cdf0e10cSrcweir //================================================================== 43cdf0e10cSrcweir //= ResourceManager 44cdf0e10cSrcweir //================================================================== 45cdf0e10cSrcweir SimpleResMgr* ResourceManager::m_pImpl = NULL; 46cdf0e10cSrcweir 47cdf0e10cSrcweir //------------------------------------------------------------------ ~EnsureDelete()48cdf0e10cSrcweir ResourceManager::EnsureDelete::~EnsureDelete() 49cdf0e10cSrcweir { 50cdf0e10cSrcweir delete ResourceManager::m_pImpl; 51cdf0e10cSrcweir } 52cdf0e10cSrcweir 53cdf0e10cSrcweir //------------------------------------------------------------------ ensureImplExists()54cdf0e10cSrcweir void ResourceManager::ensureImplExists() 55cdf0e10cSrcweir { 56cdf0e10cSrcweir if (m_pImpl) 57cdf0e10cSrcweir return; 58cdf0e10cSrcweir 59cdf0e10cSrcweir ByteString sFileName("frm"); 60cdf0e10cSrcweir 61cdf0e10cSrcweir m_pImpl = SimpleResMgr::Create(sFileName.GetBuffer(), Application::GetSettings().GetUILocale()); 62cdf0e10cSrcweir 63cdf0e10cSrcweir if (m_pImpl) 64cdf0e10cSrcweir { 65cdf0e10cSrcweir // no that we have a impl class make sure it's deleted on unloading the library 66cdf0e10cSrcweir static ResourceManager::EnsureDelete s_aDeleteTheImplClas; 67cdf0e10cSrcweir } 68cdf0e10cSrcweir } 69cdf0e10cSrcweir 70cdf0e10cSrcweir //------------------------------------------------------------------ loadString(sal_uInt16 _nResId)71cdf0e10cSrcweir ::rtl::OUString ResourceManager::loadString(sal_uInt16 _nResId) 72cdf0e10cSrcweir { 73cdf0e10cSrcweir ::rtl::OUString sReturn; 74cdf0e10cSrcweir 75cdf0e10cSrcweir ensureImplExists(); 76cdf0e10cSrcweir if (m_pImpl) 77cdf0e10cSrcweir sReturn = m_pImpl->ReadString(_nResId); 78cdf0e10cSrcweir 79cdf0e10cSrcweir return sReturn; 80cdf0e10cSrcweir } 81cdf0e10cSrcweir 82cdf0e10cSrcweir //......................................................................... 83cdf0e10cSrcweir } 84cdf0e10cSrcweir //......................................................................... 85cdf0e10cSrcweir 86