From 8512e5c2b3617a2c8d77381788c3864db594ce46 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 16 May 2012 11:19:17 +0100 Subject: reduce static_initialization_and_destruction chain Change-Id: I962aeac0c7feeabb7963016d5afcfeca5a48ccfe --- l10ntools/source/help/HelpCompiler.cxx | 1 - l10ntools/source/help/HelpCompiler.hxx | 4 +- l10ntools/source/help/HelpLinker.cxx | 8 ++-- l10ntools/source/help/HelpLinker_main.cxx | 2 +- l10ntools/source/help/HelpSearch.cxx | 2 - .../source/presenter/PresenterBitmapContainer.cxx | 42 ++++++------------- sdext/source/presenter/PresenterComponent.cxx | 11 +++-- sfx2/source/appl/workwin.cxx | 46 ++++++++++++--------- stoc/source/security/access_controller.cxx | 9 ++--- svl/inc/svl/zforlist.hxx | 13 +----- svl/source/numbers/zforlist.cxx | 19 ++++++++- svtools/source/edit/syntaxhighlight.cxx | 47 +++++++++------------- vcl/generic/fontmanager/fontmanager.cxx | 8 +--- vcl/inc/vcl/fontmanager.hxx | 4 +- vcl/source/gdi/bmpfast.cxx | 10 ----- xmlhelp/source/cxxhelp/provider/databases.cxx | 5 ++- 16 files changed, 100 insertions(+), 131 deletions(-) diff --git a/l10ntools/source/help/HelpCompiler.cxx b/l10ntools/source/help/HelpCompiler.cxx index d3e5760a1fdd..fb92e5b7341a 100644 --- a/l10ntools/source/help/HelpCompiler.cxx +++ b/l10ntools/source/help/HelpCompiler.cxx @@ -266,7 +266,6 @@ std::string myparser::dump(xmlNodePtr node) xmlChar *pContent = xmlNodeGetContent(node); app += std::string((const char*)pContent); xmlFree(pContent); - // std::cout << app << std::endl; } return app; } diff --git a/l10ntools/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx index 5e0ec8d032cb..cd8357518ded 100644 --- a/l10ntools/source/help/HelpCompiler.hxx +++ b/l10ntools/source/help/HelpCompiler.hxx @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -61,9 +60,10 @@ #include #if OSL_DEBUG_LEVEL > 2 + #include #define HCDBG(foo) do { if (1) foo; } while(0) #else - #define HCDBG(foo) do { if (0) foo; } while(0) + #define HCDBG(foo) do { } while(0) #endif namespace fs diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index 8c0d510ddb32..7656d0bcc061 100644 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -437,11 +437,12 @@ void HelpLinker::link() throw( HelpProcessingException ) if (!bExtensionMode && xhpFileName.rfind(".xhp") != xhpFileName.length()-4) { // only work on .xhp - files - std::cerr << + SAL_WARN("l10ntools", "ERROR: input list entry '" << xhpFileName << "' has the wrong extension (only files with extension .xhp " - << "are accepted)"; + << "are accepted)"); + continue; } @@ -642,8 +643,7 @@ void HelpLinker::link() throw( HelpProcessingException ) fs::path fsAdditionalFileName( additionalFileName, fs::native ); std::string aNativeStr = fsAdditionalFileName.native_file_string(); - const char* pStr = aNativeStr.c_str(); - HCDBG(std::cerr << pStr << std::endl); + HCDBG(const char* pStr = aNativeStr.c_str(); std::cerr << pStr << std::endl); fs::path fsTargetName( indexDirParentName / additionalFileKey ); diff --git a/l10ntools/source/help/HelpLinker_main.cxx b/l10ntools/source/help/HelpLinker_main.cxx index fae24bcebf0b..54ce8916d1b9 100644 --- a/l10ntools/source/help/HelpLinker_main.cxx +++ b/l10ntools/source/help/HelpLinker_main.cxx @@ -28,7 +28,7 @@ #include "HelpCompiler.hxx" #include "l10ntools/HelpLinker.hxx" - +#include #include SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { diff --git a/l10ntools/source/help/HelpSearch.cxx b/l10ntools/source/help/HelpSearch.cxx index 10b57dbce741..64c0ed16aca7 100644 --- a/l10ntools/source/help/HelpSearch.cxx +++ b/l10ntools/source/help/HelpSearch.cxx @@ -31,8 +31,6 @@ #include #include -#include - #include "LuceneHelper.hxx" HelpSearch::HelpSearch(rtl::OUString const &lang, rtl::OUString const &indexDir) diff --git a/sdext/source/presenter/PresenterBitmapContainer.cxx b/sdext/source/presenter/PresenterBitmapContainer.cxx index e4267c3b64aa..8b3ff5c11861 100644 --- a/sdext/source/presenter/PresenterBitmapContainer.cxx +++ b/sdext/source/presenter/PresenterBitmapContainer.cxx @@ -47,22 +47,6 @@ using ::rtl::OUString; namespace sdext { namespace presenter { -namespace { -static OUString gsNameProperty (A2S("Name")); -static OUString gsNormalFileNameProperty (A2S("NormalFileName")); -static OUString gsMouseOverFileNameProperty (A2S("MouseOverFileName")); -static OUString gsButtonDownFileNameProperty (A2S("ButtonDownFileName")); -static OUString gsDisabledFileNameProperty (A2S("DisabledFileName")); -static OUString gsMaskFileNameProperty (A2S("MaskFileName")); -static OUString gsXOffsetProperty (A2S("XOffset")); -static OUString gsYOffsetProperty (A2S("YOffset")); -static OUString gsXHotSpotProperty (A2S("XHotSpot")); -static OUString gsYHotSpotProperty (A2S("YHotSpot")); -static OUString gsReplacementColorProperty (A2S("ReplacementColor")); -static OUString gsHorizontalTexturingModeProperty (A2S("HorizontalTexturingMode")); -static OUString gsVerticalTexturingModeProperty (A2S("VerticalTexturingMode")); -} - //===== PresenterBitmapContainer ============================================== PresenterBitmapContainer::PresenterBitmapContainer ( @@ -210,7 +194,7 @@ void PresenterBitmapContainer::ProcessBitmap ( const Reference& rxProperties) { OUString sName; - if ( ! (PresenterConfigurationAccess::GetProperty(rxProperties, gsNameProperty) >>= sName)) + if ( ! (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("Name")) >>= sName)) sName = rsKey; maIconContainer[sName] = LoadBitmap( @@ -239,7 +223,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( OUString sFileName; // Load bitmaps. - if (PresenterConfigurationAccess::GetProperty(rxProperties, gsNormalFileNameProperty) >>= sFileName) + if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("NormalFileName")) >>= sFileName) try { pBitmap->SetBitmap( @@ -248,7 +232,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( } catch (Exception&) {} - if (PresenterConfigurationAccess::GetProperty(rxProperties, gsMouseOverFileNameProperty) >>= sFileName) + if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("MouseOverFileName")) >>= sFileName) try { pBitmap->SetBitmap( @@ -257,7 +241,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( } catch (Exception&) {} - if (PresenterConfigurationAccess::GetProperty(rxProperties, gsButtonDownFileNameProperty) >>= sFileName) + if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("ButtonDownFileName")) >>= sFileName) try { pBitmap->SetBitmap( @@ -266,7 +250,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( } catch (Exception&) {} - if (PresenterConfigurationAccess::GetProperty(rxProperties, gsDisabledFileNameProperty) >>= sFileName) + if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("DisabledFileName")) >>= sFileName) try { pBitmap->SetBitmap( @@ -275,7 +259,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( } catch (Exception&) {} - if (PresenterConfigurationAccess::GetProperty(rxProperties, gsMaskFileNameProperty) >>= sFileName) + if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("MaskFileName")) >>= sFileName) try { pBitmap->SetBitmap( @@ -285,18 +269,18 @@ SharedBitmapDescriptor PresenterBitmapContainer::LoadBitmap ( catch (Exception&) {} - PresenterConfigurationAccess::GetProperty(rxProperties, gsXOffsetProperty) >>= pBitmap->mnXOffset; - PresenterConfigurationAccess::GetProperty(rxProperties, gsYOffsetProperty) >>= pBitmap->mnYOffset; + PresenterConfigurationAccess::GetProperty(rxProperties, A2S("XOffset")) >>= pBitmap->mnXOffset; + PresenterConfigurationAccess::GetProperty(rxProperties, A2S("YOffset")) >>= pBitmap->mnYOffset; - PresenterConfigurationAccess::GetProperty(rxProperties, gsXHotSpotProperty) >>= pBitmap->mnXHotSpot; - PresenterConfigurationAccess::GetProperty(rxProperties, gsYHotSpotProperty) >>= pBitmap->mnYHotSpot; + PresenterConfigurationAccess::GetProperty(rxProperties, A2S("XHotSpot")) >>= pBitmap->mnXHotSpot; + PresenterConfigurationAccess::GetProperty(rxProperties, A2S("YHotSpot")) >>= pBitmap->mnYHotSpot; - PresenterConfigurationAccess::GetProperty(rxProperties, gsReplacementColorProperty) >>= pBitmap->maReplacementColor; + PresenterConfigurationAccess::GetProperty(rxProperties, A2S("ReplacementColor")) >>= pBitmap->maReplacementColor; OUString sTexturingMode; - if (PresenterConfigurationAccess::GetProperty(rxProperties, gsHorizontalTexturingModeProperty) >>= sTexturingMode) + if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("HorizontalTexturingMode")) >>= sTexturingMode) pBitmap->meHorizontalTexturingMode = StringToTexturingMode(sTexturingMode); - if (PresenterConfigurationAccess::GetProperty(rxProperties, gsVerticalTexturingModeProperty) >>= sTexturingMode) + if (PresenterConfigurationAccess::GetProperty(rxProperties, A2S("VerticalTexturingMode")) >>= sTexturingMode) pBitmap->meVerticalTexturingMode = StringToTexturingMode(sTexturingMode); return pBitmap; diff --git a/sdext/source/presenter/PresenterComponent.cxx b/sdext/source/presenter/PresenterComponent.cxx index 581427cf94ac..8032fb03c27a 100644 --- a/sdext/source/presenter/PresenterComponent.cxx +++ b/sdext/source/presenter/PresenterComponent.cxx @@ -44,8 +44,6 @@ using ::rtl::OUString; namespace sdext { namespace presenter { -static OUString gsBasePath; - ::rtl::OUString PresenterComponent::GetBasePath ( const Reference& rxComponentContext) { @@ -56,7 +54,8 @@ static OUString gsBasePath; const Reference& rxComponentContext, const OUString& rsExtensionIdentifier) { - if (gsBasePath.isEmpty()) + static ::rtl::OUString sBasePath; + if (sBasePath.isEmpty()) { // Determine the base path of the bitmaps. Reference xInformationProvider ( @@ -68,16 +67,16 @@ static OUString gsBasePath; { try { - gsBasePath = xInformationProvider->getPackageLocation(rsExtensionIdentifier) + sBasePath = xInformationProvider->getPackageLocation(rsExtensionIdentifier) + OUString(RTL_CONSTASCII_USTRINGPARAM("/")); } - catch(deployment::DeploymentException&) + catch (const deployment::DeploymentException&) { } } } - return gsBasePath; + return sBasePath; } rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT; diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 12f858e38bbf..5f6d001ad6e4 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -319,37 +319,45 @@ throw (css::uno::RuntimeException) } } -//==================================================================== - -typedef boost::unordered_map< sal_Int32, rtl::OUString > ToolBarResIdToResourceURLMap; - -static sal_Bool bMapInitialized = sal_False; -static ToolBarResIdToResourceURLMap aResIdToResourceURLMap; - -static rtl::OUString GetResourceURLFromResId( sal_uInt16 nResId ) +namespace { - if ( !bMapInitialized ) + class FilledToolBarResIdToResourceURLMap { - osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ; - if ( !bMapInitialized ) + private: + typedef boost::unordered_map< sal_Int32, rtl::OUString > ToolBarResIdToResourceURLMap; + ToolBarResIdToResourceURLMap m_aResIdToResourceURLMap; + public: + FilledToolBarResIdToResourceURLMap() { sal_Int32 nIndex( 0 ); while ( pToolBarResToName[nIndex].nId != 0 ) { rtl::OUString aResourceURL( rtl::OUString::createFromAscii( pToolBarResToName[nIndex].pName )); - aResIdToResourceURLMap.insert( ToolBarResIdToResourceURLMap::value_type( + m_aResIdToResourceURLMap.insert( ToolBarResIdToResourceURLMap::value_type( sal_Int32( pToolBarResToName[nIndex].nId ), aResourceURL )); ++nIndex; } - bMapInitialized = sal_True; } - } - ToolBarResIdToResourceURLMap::const_iterator pIter = aResIdToResourceURLMap.find( nResId ); - if ( pIter != aResIdToResourceURLMap.end() ) - return pIter->second; - else - return rtl::OUString(); + rtl::OUString findURL(sal_uInt16 nResId) const + { + ToolBarResIdToResourceURLMap::const_iterator aIter = m_aResIdToResourceURLMap.find( nResId ); + if ( aIter != m_aResIdToResourceURLMap.end() ) + return aIter->second; + return rtl::OUString(); + } + }; + + class theFilledToolBarResIdToResourceURLMap + : public rtl::Static + { + }; +} + +static rtl::OUString GetResourceURLFromResId( sal_uInt16 nResId ) +{ + return theFilledToolBarResIdToResourceURLMap::get().findURL(nResId); } sal_Bool IsAppWorkWinToolbox_Impl( sal_uInt16 nPos ) diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index 15e58ab8475f..c128b4a63e38 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -80,7 +80,7 @@ namespace stoc_sec { // static stuff initialized when loading lib static OUString s_envType = OUSTR(CPPU_CURRENT_LANGUAGE_BINDING_NAME); -static OUString s_acRestriction = OUSTR("access-control.restriction"); +const char s_acRestriction[] = "access-control.restriction"; //################################################################################################## @@ -325,7 +325,7 @@ void acc_CurrentContext::release() Any acc_CurrentContext::getValueByName( OUString const & name ) throw (RuntimeException) { - if (name.equals( s_acRestriction )) + if (name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_acRestriction))) { return m_restriction; } @@ -358,7 +358,7 @@ static inline Reference< security::XAccessControlContext > getDynamicRestriction { if (xContext.is()) { - Any acc( xContext->getValueByName( s_acRestriction ) ); + Any acc(xContext->getValueByName(rtl::OUString(s_acRestriction))); if (typelib_TypeClass_INTERFACE == acc.pType->eTypeClass) { // avoid ref-counting @@ -1047,8 +1047,7 @@ Sequence< OUString > ac_getSupportedServiceNames() SAL_THROW(()) //-------------------------------------------------------------------------------------------------- OUString ac_getImplementationName() SAL_THROW(()) { - static OUString s_implName = OUSTR(IMPL_NAME); - return s_implName; + return OUSTR(IMPL_NAME); } //-------------------------------------------------------------------------------------------------- Reference< XInterface > SAL_CALL filepolicy_create( diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx index 96a8955936e5..701216468f0d 100644 --- a/svl/inc/svl/zforlist.hxx +++ b/svl/inc/svl/zforlist.hxx @@ -339,9 +339,6 @@ public: */ static const sal_uInt16 INPUTSTRING_PRECISION; - /** THE set of installed locales. */ - static NfInstalledLocales theInstalledLocales; - /// Preferred ctor with service manager and language/country enum SvNumberFormatter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMgr, @@ -809,15 +806,7 @@ public: String GetStandardName( LanguageType eLnge ); /** Check if a specific locale has supported locale data. */ - static bool IsLocaleInstalled( LanguageType eLang ) - { - // The set is initialized as a side effect of the currency table - // created, make sure that exists, which usually is the case unless a - // SvNumberFormatter was never instanciated. - GetTheCurrencyTable(); - return theInstalledLocales.find( eLang) != theInstalledLocales.end(); - } - + static bool IsLocaleInstalled( LanguageType eLang ); private: ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager; diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index c09d14ea28b2..7c8a49ca727b 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -178,6 +178,11 @@ namespace struct theLegacyOnlyCurrencyTable : public rtl::Static< NfCurrencyTable, theLegacyOnlyCurrencyTable > {}; + + /** THE set of installed locales. */ + struct theInstalledLocales : + public rtl::Static< NfInstalledLocales, theInstalledLocales> {}; + } sal_uInt16 SvNumberFormatter::nSystemCurrencyPosition = 0; SV_IMPL_PTRARR( NfCurrencyTable, NfCurrencyEntry* ); @@ -192,7 +197,6 @@ SV_IMPL_PTRARR( NfWSStringsDtor, String* ); const sal_uInt16 SvNumberFormatter::UNLIMITED_PRECISION = ::std::numeric_limits::max(); const sal_uInt16 SvNumberFormatter::INPUTSTRING_PRECISION = ::std::numeric_limits::max()-1; -NfInstalledLocales SvNumberFormatter::theInstalledLocales; SvNumberFormatter::SvNumberFormatter( const Reference< XMultiServiceFactory >& xSMgr, @@ -3514,6 +3518,16 @@ void lcl_CheckCurrencySymbolPosition( const NfCurrencyEntry& rCurr ) } } +// static +bool SvNumberFormatter::IsLocaleInstalled( LanguageType eLang ) +{ + // The set is initialized as a side effect of the currency table + // created, make sure that exists, which usually is the case unless a + // SvNumberFormatter was never instanciated. + GetTheCurrencyTable(); + const NfInstalledLocales &rInstalledLocales = theInstalledLocales::get(); + return rInstalledLocales.find( eLang) != rInstalledLocales.end(); +} // static void SvNumberFormatter::ImpInitCurrencyTable() @@ -3554,12 +3568,13 @@ void SvNumberFormatter::ImpInitCurrencyTable() Locale const * const pLocales = xLoc.getConstArray(); NfCurrencyTable &rCurrencyTable = theCurrencyTable::get(); NfCurrencyTable &rLegacyOnlyCurrencyTable = theLegacyOnlyCurrencyTable::get(); + NfInstalledLocales &rInstalledLocales = theInstalledLocales::get(); sal_uInt16 nLegacyOnlyCurrencyPos = 0; for ( sal_Int32 nLocale = 0; nLocale < nLocaleCount; nLocale++ ) { LanguageType eLang = MsLangId::convertLocaleToLanguage( pLocales[nLocale]); - theInstalledLocales.insert( eLang); + rInstalledLocales.insert( eLang); pLocaleData->setLocale( pLocales[nLocale] ); Sequence< Currency2 > aCurrSeq = pLocaleData->getAllCurrencies(); sal_Int32 nCurrencyCount = aCurrSeq.getLength(); diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx index d4caa88c511f..2bf3d0204a7e 100644 --- a/svtools/source/edit/syntaxhighlight.cxx +++ b/svtools/source/edit/syntaxhighlight.cxx @@ -234,39 +234,32 @@ extern "C" int CDECL compare_strings( const void *arg1, const void *arg2 ) } -namespace { - -class LetterTable +namespace { - bool IsLetterTab[256]; - -public: - LetterTable( void ); - inline bool isLetter( sal_Unicode c ) + class LetterTable { - bool bRet = (c < 256) ? IsLetterTab[c] : isLetterUnicode( c ); - return bRet; - } - bool isLetterUnicode( sal_Unicode c ); -}; + bool IsLetterTab[256]; -} + public: + LetterTable( void ); -class BasicSimpleCharClass -{ - static LetterTable aLetterTable; + inline bool isLetter( sal_Unicode c ) + { + bool bRet = (c < 256) ? IsLetterTab[c] : isLetterUnicode( c ); + return bRet; + } + bool isLetterUnicode( sal_Unicode c ); + }; -public: - static sal_Bool isAlpha( sal_Unicode c ) + static bool isAlpha(sal_Unicode c) { - sal_Bool bRet = comphelper::string::isalphaAscii(c) || - aLetterTable.isLetter(c); - return bRet; + if (comphelper::string::isalphaAscii(c)) + return true; + static LetterTable aLetterTable; + return aLetterTable.isLetter(c); } -}; - -LetterTable BasicSimpleCharClass::aLetterTable; +} LetterTable::LetterTable( void ) { @@ -358,7 +351,7 @@ sal_Bool SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, sal_uInt16 nTestFla else if( c > 255 ) { bRet = (( CHAR_START_IDENTIFIER | CHAR_IN_IDENTIFIER ) & nTestFlags) != 0 - ? BasicSimpleCharClass::isAlpha(c) : false; + ? isAlpha(c) : false; } return bRet; } @@ -469,7 +462,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, { // Naechstes Zeichen holen c = peekChar(); - bIdentifierChar = BasicSimpleCharClass::isAlpha(c); + bIdentifierChar = isAlpha(c); if( bIdentifierChar ) getChar(); } diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index 06bfb7b1dad5..ddb2fdba1703 100644 --- a/vcl/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx @@ -994,10 +994,6 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult return true; } -// ------------------------------------------------------------------------- - -OString PrintFontManager::s_aEmptyOString; - /* * one instance only */ @@ -1051,10 +1047,10 @@ PrintFontManager::~PrintFontManager() // ------------------------------------------------------------------------- -const OString& PrintFontManager::getDirectory( int nAtom ) const +OString PrintFontManager::getDirectory( int nAtom ) const { ::boost::unordered_map< int, OString >::const_iterator it( m_aAtomToDir.find( nAtom ) ); - return it != m_aAtomToDir.end() ? it->second : s_aEmptyOString; + return it != m_aAtomToDir.end() ? it->second : OString(); } // ------------------------------------------------------------------------- diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx index 0760e3069432..2cb07aed5ec5 100644 --- a/vcl/inc/vcl/fontmanager.hxx +++ b/vcl/inc/vcl/fontmanager.hxx @@ -267,8 +267,6 @@ class VCL_PLUGIN_PUBLIC PrintFontManager virtual bool queryMetricPage( int nPage, utl::MultiAtomProvider* pProvider ); }; - static rtl::OString s_aEmptyOString; - fontID m_nNextFontID; boost::unordered_map< fontID, PrintFont* > m_aFonts; boost::unordered_map< int, FontFamily > m_aFamilyTypes; @@ -328,7 +326,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager void fillPrintFontInfo( PrintFont* pFont, FastPrintFontInfo& rInfo ) const; void fillPrintFontInfo( PrintFont* pFont, PrintFontInfo& rInfo ) const; - const rtl::OString& getDirectory( int nAtom ) const; + rtl::OString getDirectory( int nAtom ) const; int getDirectoryAtom( const rtl::OString& rDirectory, bool bCreate = false ); /* try to initialize fonts from libfontconfig diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx index 131686f273b2..3d0a48dfc264 100644 --- a/vcl/source/gdi/bmpfast.cxx +++ b/vcl/source/gdi/bmpfast.cxx @@ -37,7 +37,6 @@ #define FAST_ARGB_BGRA #include -static bool bDisableFastBitops = (getenv( "SAL_DISABLE_BITMAPS_OPTS" ) != NULL); typedef unsigned char PIXBYTE; @@ -502,9 +501,6 @@ inline bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc, const SalTwoRect& rTR ) { - if( bDisableFastBitops ) - return false; - // horizontal mirroring not implemented yet if( rTR.mnDestWidth < 0 ) return false; @@ -760,9 +756,6 @@ bool ImplFastBitmapBlending( BitmapWriteAccess& rDstWA, const BitmapReadAccess& rSrcRA, const BitmapReadAccess& rMskRA, const SalTwoRect& rTR ) { - if( bDisableFastBitops ) - return false; - // accelerated blending of paletted bitmaps not implemented yet if( rSrcRA.HasPalette() ) return false; @@ -884,9 +877,6 @@ bool ImplFastBitmapBlending( BitmapWriteAccess& rDstWA, bool ImplFastEraseBitmap( BitmapBuffer& rDst, const BitmapColor& rColor ) { - if( bDisableFastBitops ) - return false; - const sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN; // erasing a bitmap is often just a byte-wise memory fill diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 22c873e627ce..0af076bb2b24 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -83,7 +83,6 @@ using namespace com::sun::star::beans; static rtl::OUString aSlash(RTL_CONSTASCII_USTRINGPARAM("/")); -static rtl::OUString aHelpFilesBaseName(RTL_CONSTASCII_USTRINGPARAM("help")); rtl::OUString Databases::expandURL( const rtl::OUString& aURL ) { @@ -1629,7 +1628,7 @@ rtl::OUString ExtensionIteratorBase::implGetFileFromPackage( if( !bLangFolderOnly ) { aStrBuf.append( aSlash ); - aStrBuf.append( aHelpFilesBaseName ); + aStrBuf.append( "help" ); aStrBuf.append( rFileExtension ); } @@ -1774,6 +1773,8 @@ Db* DataBaseIterator::implGetDbFromPackage( Reference< deployment::XPackage > xP rtl::OUString aRegDataUrl(optRegData.Value); aRegDataUrl += aSlash; + rtl::OUString aHelpFilesBaseName("help"); + rtl::OUString aUsedLanguage = m_aLanguage; pRetDb = m_rDatabases.getBerkeley( aHelpFilesBaseName, aUsedLanguage, m_bHelpText, &aRegDataUrl); -- cgit