diff options
23 files changed, 81 insertions, 202 deletions
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 45311f567a6b..32b361992418 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -1171,16 +1171,7 @@ Sequence< OUString > SfxScriptLibraryContainer::getSupportedServiceNames_static( OUString SfxScriptLibraryContainer::getImplementationName_static() { - static OUString aImplName; - static sal_Bool bNeedsInit = sal_True; - - MutexGuard aGuard( Mutex::getGlobalMutex() ); - if( bNeedsInit ) - { - aImplName = OUString("com.sun.star.comp.sfx2.ScriptLibraryContainer" ); - bNeedsInit = sal_False; - } - return aImplName; + return OUString("com.sun.star.comp.sfx2.ScriptLibraryContainer" ); } Reference< XInterface > SAL_CALL SfxScriptLibraryContainer::Create diff --git a/comphelper/source/streaming/memorystream.cxx b/comphelper/source/streaming/memorystream.cxx index 74879e4450ce..ac6148a38cee 100644 --- a/comphelper/source/streaming/memorystream.cxx +++ b/comphelper/source/streaming/memorystream.cxx @@ -221,8 +221,7 @@ void SAL_CALL UNOMemoryStream::truncate() throw (IOException, RuntimeException) ::rtl::OUString SAL_CALL UNOMemoryStream::getImplementationName_static() { - static const OUString sImplName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.MemoryStream" ) ); - return sImplName; + return ::rtl::OUString("com.sun.star.comp.MemoryStream"); } Sequence< ::rtl::OUString > SAL_CALL UNOMemoryStream::getSupportedServiceNames_static() diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx index 7e480c7ea8f5..6a204bfb8bdc 100644 --- a/connectivity/source/commontools/DriversConfig.cxx +++ b/connectivity/source/commontools/DriversConfig.cxx @@ -63,31 +63,25 @@ namespace const ::utl::OConfigurationNode aURLPatternNode = _aInstalled.openNode(_sEntry); if ( aURLPatternNode.isValid() ) { - static const ::rtl::OUString s_sParentURLPattern(RTL_CONSTASCII_USTRINGPARAM("ParentURLPattern")); - static const ::rtl::OUString s_sDriver(RTL_CONSTASCII_USTRINGPARAM("Driver")); - static const ::rtl::OUString s_sDriverTypeDisplayName(RTL_CONSTASCII_USTRINGPARAM("DriverTypeDisplayName")); - static const ::rtl::OUString s_sProperties(RTL_CONSTASCII_USTRINGPARAM("Properties")); - static const ::rtl::OUString s_sFeatures(RTL_CONSTASCII_USTRINGPARAM("Features")); - static const ::rtl::OUString s_sMetaData(RTL_CONSTASCII_USTRINGPARAM("MetaData")); ::rtl::OUString sParentURLPattern; - aURLPatternNode.getNodeValue(s_sParentURLPattern) >>= sParentURLPattern; + aURLPatternNode.getNodeValue("ParentURLPattern") >>= sParentURLPattern; if ( !sParentURLPattern.isEmpty() ) lcl_readURLPatternNode(_aInstalled,sParentURLPattern,_rInstalledDriver); ::rtl::OUString sDriverFactory; - aURLPatternNode.getNodeValue(s_sDriver) >>= sDriverFactory; + aURLPatternNode.getNodeValue("Driver") >>= sDriverFactory; if ( !sDriverFactory.isEmpty() ) _rInstalledDriver.sDriverFactory = sDriverFactory; ::rtl::OUString sDriverTypeDisplayName; - aURLPatternNode.getNodeValue(s_sDriverTypeDisplayName) >>= sDriverTypeDisplayName; + aURLPatternNode.getNodeValue("DriverTypeDisplayName") >>= sDriverTypeDisplayName; OSL_ENSURE(!sDriverTypeDisplayName.isEmpty(),"No valid DriverTypeDisplayName property!"); if ( !sDriverTypeDisplayName.isEmpty() ) _rInstalledDriver.sDriverTypeDisplayName = sDriverTypeDisplayName; - lcl_fillValues(aURLPatternNode,s_sProperties,_rInstalledDriver.aProperties); - lcl_fillValues(aURLPatternNode,s_sFeatures,_rInstalledDriver.aFeatures); - lcl_fillValues(aURLPatternNode,s_sMetaData,_rInstalledDriver.aMetaData); + lcl_fillValues(aURLPatternNode,"Properties",_rInstalledDriver.aProperties); + lcl_fillValues(aURLPatternNode,"Features",_rInstalledDriver.aFeatures); + lcl_fillValues(aURLPatternNode,"MetaData",_rInstalledDriver.aMetaData); } } } diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 19a7a0e3844a..96c8e3017cda 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -624,20 +624,17 @@ AcceleratorCache& XMLBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bWriteA //----------------------------------------------- ::comphelper::Locale XMLBasedAcceleratorConfiguration::impl_ts_getLocale() const { - static ::rtl::OUString LOCALE_PACKAGE("/org.openoffice.Setup"); - static ::rtl::OUString LOCALE_PATH("L10N"); - static ::rtl::OUString LOCALE_KEY("ooLocale"); - // SAFE -> ---------------------------------- ReadGuard aReadLock(m_aLock); css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; aReadLock.unlock(); // <- SAFE ---------------------------------- - css::uno::Reference< css::uno::XInterface > xCFG = fpc::ConfigurationHelper::openConfig(xSMGR, LOCALE_PACKAGE, LOCALE_PATH, fpc::ConfigurationHelper::E_READONLY); + css::uno::Reference< css::uno::XInterface > xCFG = fpc::ConfigurationHelper::openConfig(xSMGR, + "/org.openoffice.Setup", "L10N", fpc::ConfigurationHelper::E_READONLY); css::uno::Reference< css::beans::XPropertySet > xProp (xCFG, css::uno::UNO_QUERY_THROW); ::rtl::OUString sISOLocale; - xProp->getPropertyValue(LOCALE_KEY) >>= sISOLocale; + xProp->getPropertyValue("ooLocale") >>= sISOLocale; if (sISOLocale.isEmpty()) return ::comphelper::Locale::EN_US(); @@ -1666,20 +1663,17 @@ AcceleratorCache& XCUBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bPrefer //----------------------------------------------- ::comphelper::Locale XCUBasedAcceleratorConfiguration::impl_ts_getLocale() const { - static ::rtl::OUString LOCALE_PACKAGE("/org.openoffice.Setup"); - static ::rtl::OUString LOCALE_PATH("L10N"); - static ::rtl::OUString LOCALE_KEY("ooLocale"); - // SAFE -> ---------------------------------- ReadGuard aReadLock(m_aLock); css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; aReadLock.unlock(); // <- SAFE ---------------------------------- - css::uno::Reference< css::uno::XInterface > xCFG = fpc::ConfigurationHelper::openConfig(xSMGR, LOCALE_PACKAGE, LOCALE_PATH, fpc::ConfigurationHelper::E_READONLY); + css::uno::Reference< css::uno::XInterface > xCFG = fpc::ConfigurationHelper::openConfig(xSMGR, + "/org.openoffice.Setup", "L10N", fpc::ConfigurationHelper::E_READONLY); css::uno::Reference< css::beans::XPropertySet > xProp (xCFG, css::uno::UNO_QUERY_THROW); ::rtl::OUString sISOLocale; - xProp->getPropertyValue(LOCALE_KEY) >>= sISOLocale; + xProp->getPropertyValue("ooLocale") >>= sISOLocale; if (sISOLocale.isEmpty()) return ::comphelper::Locale::EN_US(); diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx index ee88be39c325..a72d8f22c577 100644 --- a/framework/source/accelerators/presethandler.cxx +++ b/framework/source/accelerators/presethandler.cxx @@ -83,43 +83,37 @@ namespace framework //----------------------------------------------- ::rtl::OUString PresetHandler::PRESET_DEFAULT() { - static ::rtl::OUString RSTYPE = DECLARE_ASCII("default"); - return RSTYPE; + return ::rtl::OUString("default"); } //----------------------------------------------- ::rtl::OUString PresetHandler::TARGET_CURRENT() { - static ::rtl::OUString RSTYPE = DECLARE_ASCII("current"); - return RSTYPE; + return ::rtl::OUString("current"); } //----------------------------------------------- ::rtl::OUString PresetHandler::RESOURCETYPE_MENUBAR() { - static ::rtl::OUString RSTYPE = DECLARE_ASCII("menubar"); - return RSTYPE; + return ::rtl::OUString("menubar"); } //----------------------------------------------- ::rtl::OUString PresetHandler::RESOURCETYPE_TOOLBAR() { - static ::rtl::OUString RSTYPE = DECLARE_ASCII("toolbar"); - return RSTYPE; + return ::rtl::OUString("toolbar"); } //----------------------------------------------- ::rtl::OUString PresetHandler::RESOURCETYPE_ACCELERATOR() { - static ::rtl::OUString RSTYPE = DECLARE_ASCII("accelerator"); - return RSTYPE; + return ::rtl::OUString("accelerator"); } //----------------------------------------------- ::rtl::OUString PresetHandler::RESOURCETYPE_STATUSBAR() { - static ::rtl::OUString RSTYPE = DECLARE_ASCII("statusbar"); - return RSTYPE; + return ::rtl::OUString("statusbar"); } //----------------------------------------------- diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx index 52bc730e3758..644ab5416c44 100644 --- a/framework/source/classes/taskcreator.cxx +++ b/framework/source/classes/taskcreator.cxx @@ -103,10 +103,6 @@ TaskCreator::~TaskCreator() css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const ::rtl::OUString& sName , sal_Bool bVisible ) { - static ::rtl::OUString PACKAGE("org.openoffice.Office.TabBrowse"); - static ::rtl::OUString RELPATH("TaskCreatorService"); - static ::rtl::OUString KEY("ImplementationName"); - /* SAFE { */ ReadGuard aReadLock( m_aLock ); css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; @@ -123,7 +119,11 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const ::rtl:: ( TargetHelper::matchSpecialTarget(sName, TargetHelper::E_DEFAULT) ) ) { - ::comphelper::ConfigurationHelper::readDirectKey(xSMGR, PACKAGE, RELPATH, KEY, ::comphelper::ConfigurationHelper::E_READONLY) >>= sCreator; + ::comphelper::ConfigurationHelper::readDirectKey(xSMGR, + "org.openoffice.Office.TabBrowse", + "TaskCreatorService", + "ImplementationName", + ::comphelper::ConfigurationHelper::E_READONLY) >>= sCreator; } xCreator = css::uno::Reference< css::lang::XSingleServiceFactory >( diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx index 2f5d4fe62878..fc1ee34366cb 100644 --- a/framework/source/services/taskcreatorsrv.cxx +++ b/framework/source/services/taskcreatorsrv.cxx @@ -119,23 +119,17 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL TaskCreatorService::createI throw(css::uno::Exception , css::uno::RuntimeException) { - static ::rtl::OUString DEFAULTVAL_FRAMENAME = ::rtl::OUString(); - static sal_Bool DEFAULTVAL_MAKEVISIBLE = sal_False; - static sal_Bool DEFAULTVAL_CREATETOPWINDOW = sal_True; - static css::awt::Rectangle DEFAULTVAL_POSSIZE = css::awt::Rectangle(0, 0, 0, 0); // only possize=[0,0,0,0] triggers default handling of vcl ! - static sal_Bool DEFAULTVAL_SUPPORTPERSSISTENTWINDOWSTATE = sal_False; - static sal_Bool DEFAULTVAL_ENABLE_TITLEBARUPDATE = sal_True; - ::comphelper::SequenceAsHashMap lArgs(lArguments); css::uno::Reference< css::frame::XFrame > xParentFrame = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_PARENTFRAME) , css::uno::Reference< css::frame::XFrame >()); - ::rtl::OUString sFrameName = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_FRAMENAME) , DEFAULTVAL_FRAMENAME ); - sal_Bool bVisible = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_MAKEVISIBLE) , DEFAULTVAL_MAKEVISIBLE ); - sal_Bool bCreateTopWindow = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_CREATETOPWINDOW) , DEFAULTVAL_CREATETOPWINDOW ); - css::awt::Rectangle aPosSize = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_POSSIZE) , DEFAULTVAL_POSSIZE ); + ::rtl::OUString sFrameName = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_FRAMENAME) , ::rtl::OUString() ); + sal_Bool bVisible = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_MAKEVISIBLE) , sal_False ); + sal_Bool bCreateTopWindow = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_CREATETOPWINDOW) , sal_True ); + // only possize=[0,0,0,0] triggers default handling of vcl ! + css::awt::Rectangle aPosSize = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_POSSIZE) , css::awt::Rectangle(0, 0, 0, 0) ); css::uno::Reference< css::awt::XWindow > xContainerWindow = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_CONTAINERWINDOW) , css::uno::Reference< css::awt::XWindow >() ); - sal_Bool bSupportPersistentWindowState = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE) , DEFAULTVAL_SUPPORTPERSSISTENTWINDOWSTATE ); - sal_Bool bEnableTitleBarUpdate = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_ENABLE_TITLEBARUPDATE) , DEFAULTVAL_ENABLE_TITLEBARUPDATE ); + sal_Bool bSupportPersistentWindowState = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE) , sal_False ); + sal_Bool bEnableTitleBarUpdate = lArgs.getUnpackedValueOrDefault(rtl::OUString(ARGUMENT_ENABLE_TITLEBARUPDATE) , sal_True ); /* SAFE { */ ReadGuard aReadLock( m_aLock ); diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 42e4371f7882..3bb910ef6487 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -230,6 +230,7 @@ class SaxExpatParser_Impl { public: // module scope Mutex aMutex; + OUString sCDATA; Reference< XDocumentHandler > rDocumentHandler; Reference< XExtendedDocumentHandler > rExtendedDocumentHandler; @@ -263,6 +264,11 @@ public: // module scope Locale locale; public: + SaxExpatParser_Impl() + : sCDATA("CDATA") + { + } + // the C-Callbacks for the expat parser void static callbackStartElement(void *userData, const XML_Char *name , const XML_Char **atts); void static callbackEndElement(void *userData, const XML_Char *name); @@ -789,10 +795,6 @@ void SaxExpatParser_Impl::callbackStartElement( void *pvThis , const XML_Char *pwName , const XML_Char **awAttributes ) { - // in case of two concurrent threads, there is only the danger of an leak, - // which is neglectable for one string - static OUString g_CDATA( "CDATA" ); - SaxExpatParser_Impl *pImpl = ((SaxExpatParser_Impl*)pvThis); if( pImpl->rDocumentHandler.is() ) { @@ -804,7 +806,7 @@ void SaxExpatParser_Impl::callbackStartElement( void *pvThis , OSL_ASSERT( awAttributes[i+1] ); pImpl->pAttrList->addAttribute( XML_CHAR_TO_OUSTRING( awAttributes[i] ) , - g_CDATA , // expat doesn't know types + pImpl->sCDATA, // expat doesn't know types XML_CHAR_TO_OUSTRING( awAttributes[i+1] ) ); i +=2; } diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 92979de304db..c0b21392883c 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -258,10 +258,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) aRepresentation = pDoc->CreatePageNumValue((sal_uInt16)nPgNum); } else - { - static String aNumberText( SdResId( STR_FIELD_PLACEHOLDER_NUMBER ) ); - aRepresentation = aNumberText; - } + aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_NUMBER).toString(); pInfo->SetRepresentation( aRepresentation ); } @@ -298,14 +295,9 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) } if( nPageCount > 0 ) - { aRepresentation = pDoc->CreatePageNumValue(nPageCount); - } else - { - static String aNumberText( SdResId( STR_FIELD_PLACEHOLDER_COUNT ) ); - aRepresentation = aNumberText; - } + aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_COUNT).toString(); pInfo->SetRepresentation( aRepresentation ); } @@ -351,20 +343,11 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo) if( (pPage == NULL) || bMasterView ) { if( bHeaderField ) - { - static String aHeaderStr( SdResId( STR_FIELD_PLACEHOLDER_HEADER ) ); - aRepresentation = aHeaderStr; - } + aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_HEADER).toString(); else if (bFooterField ) - { - static String aFooterStr( SdResId( STR_FIELD_PLACEHOLDER_FOOTER ) ); - aRepresentation = aFooterStr; - } + aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_FOOTER).toString(); else if (bDateTimeField ) - { - static String aDateTimeStr( SdResId( STR_FIELD_PLACEHOLDER_DATETIME ) ); - aRepresentation = aDateTimeStr; - } + aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_DATETIME).toString(); } else { diff --git a/sd/source/ui/framework/factories/BasicToolBarFactory.cxx b/sd/source/ui/framework/factories/BasicToolBarFactory.cxx index 0b05ca453d40..048fb493df52 100644 --- a/sd/source/ui/framework/factories/BasicToolBarFactory.cxx +++ b/sd/source/ui/framework/factories/BasicToolBarFactory.cxx @@ -64,7 +64,7 @@ Reference<XInterface> SAL_CALL BasicToolBarFactory_createInstance ( Sequence<rtl::OUString> SAL_CALL BasicToolBarFactory_getSupportedServiceNames (void) throw (RuntimeException) { - static const ::rtl::OUString sServiceName("com.sun.star.drawing.framework.BasicToolBarFactory"); + const ::rtl::OUString sServiceName("com.sun.star.drawing.framework.BasicToolBarFactory"); return Sequence<rtl::OUString>(&sServiceName, 1); } diff --git a/sd/source/ui/framework/factories/TaskPanelFactory.cxx b/sd/source/ui/framework/factories/TaskPanelFactory.cxx index fe5cd6cde6cd..eda39de09483 100644 --- a/sd/source/ui/framework/factories/TaskPanelFactory.cxx +++ b/sd/source/ui/framework/factories/TaskPanelFactory.cxx @@ -63,7 +63,7 @@ Reference<XInterface> SAL_CALL TaskPanelFactory_createInstance ( Sequence<rtl::OUString> SAL_CALL TaskPanelFactory_getSupportedServiceNames (void) throw (RuntimeException) { - static const OUString sServiceName("com.sun.star.drawing.framework.TaskPanelFactory"); + const OUString sServiceName("com.sun.star.drawing.framework.TaskPanelFactory"); return Sequence<rtl::OUString>(&sServiceName, 1); } diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx index fc823061e593..2d467c58429e 100644 --- a/sfx2/source/appl/appbaslib.cxx +++ b/sfx2/source/appl/appbaslib.cxx @@ -202,31 +202,15 @@ SFX_IMPL_ONEINSTANCEFACTORY( SfxApplicationScriptLibraryContainer ) Sequence< OUString > SfxApplicationScriptLibraryContainer::impl_getStaticSupportedServiceNames() { - static Sequence< OUString > seqServiceNames( 1 ); - static sal_Bool bNeedsInit = sal_True; - - MutexGuard aGuard( Mutex::getGlobalMutex() ); - if( bNeedsInit ) - { - OUString* pSeq = seqServiceNames.getArray(); - pSeq[0] = OUString("com.sun.star.script.ApplicationScriptLibraryContainer"); - bNeedsInit = sal_False; - } + Sequence< OUString > seqServiceNames( 1 ); + OUString* pSeq = seqServiceNames.getArray(); + pSeq[0] = OUString("com.sun.star.script.ApplicationScriptLibraryContainer"); return seqServiceNames; } OUString SfxApplicationScriptLibraryContainer::impl_getStaticImplementationName() { - static OUString aImplName; - static sal_Bool bNeedsInit = sal_True; - - MutexGuard aGuard( Mutex::getGlobalMutex() ); - if( bNeedsInit ) - { - aImplName = OUString("com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer"); - bNeedsInit = sal_False; - } - return aImplName; + return OUString("com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer"); } Reference< XInterface > SAL_CALL SfxApplicationScriptLibraryContainer::impl_createInstance diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 472a6e7e18fb..f4e9fcb36c44 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -109,9 +109,6 @@ void SAL_CALL SfxTerminateListener_Impl::queryTermination( const EventObject& ) void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& aEvent ) throw(RuntimeException ) { - static ::rtl::OUString SERVICE_GLOBALEVENTBROADCASTER("com.sun.star.frame.GlobalEventBroadcaster"); - static ::rtl::OUString EVENT_QUIT_APP ("OnCloseApp"); - Reference< XDesktop > xDesktop( aEvent.Source, UNO_QUERY ); if( xDesktop.is() == sal_True ) xDesktop->removeTerminateListener( this ); @@ -125,11 +122,11 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a pApp->Get_Impl()->pAppDispatch->release(); css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); - css::uno::Reference< css::document::XEventListener > xGlobalBroadcaster(xSMGR->createInstance(SERVICE_GLOBALEVENTBROADCASTER), css::uno::UNO_QUERY); + css::uno::Reference< css::document::XEventListener > xGlobalBroadcaster(xSMGR->createInstance("com.sun.star.frame.GlobalEventBroadcaster"), css::uno::UNO_QUERY); if (xGlobalBroadcaster.is()) { css::document::EventObject aEvent2; - aEvent2.EventName = EVENT_QUIT_APP; + aEvent2.EventName = "OnCloseApp"; xGlobalBroadcaster->notifyEvent(aEvent2); } @@ -139,8 +136,7 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a ::rtl::OUString SAL_CALL SfxTerminateListener_Impl::getImplementationName() throw (RuntimeException) { - static const ::rtl::OUString IMPLNAME("com.sun.star.comp.sfx2.SfxTerminateListener"); - return IMPLNAME; + return ::rtl::OUString("com.sun.star.comp.sfx2.SfxTerminateListener"); } ::sal_Bool SAL_CALL SfxTerminateListener_Impl::supportsService( const ::rtl::OUString& sServiceName ) throw (RuntimeException) diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 3d04c9750c1e..996278f446c1 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -390,20 +390,17 @@ String SfxObjectFactory::GetFactoryURL() const String SfxObjectFactory::GetModuleName() const { - static ::rtl::OUString SERVICENAME_MODULEMANAGER("com.sun.star.frame.ModuleManager"); - static ::rtl::OUString PROP_MODULEUINAME ("ooSetupFactoryUIName"); - try { css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Reference< css::container::XNameAccess > xModuleManager( - xSMGR->createInstance(SERVICENAME_MODULEMANAGER), + xSMGR->createInstance("com.sun.star.frame.ModuleManager"), css::uno::UNO_QUERY_THROW); ::rtl::OUString sDocService(GetDocumentServiceName()); ::comphelper::SequenceAsHashMap aPropSet( xModuleManager->getByName(sDocService) ); - ::rtl::OUString sModuleName = aPropSet.getUnpackedValueOrDefault(PROP_MODULEUINAME, ::rtl::OUString()); + ::rtl::OUString sModuleName = aPropSet.getUnpackedValueOrDefault("ooSetupFactoryUIName", ::rtl::OUString()); return String(sModuleName); } catch(const css::uno::RuntimeException&) diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index 3bcbf2de5309..371264fa73ff 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -421,8 +421,8 @@ namespace sfx2 { try { - static const ::rtl::OUString s_sBasicStorageName( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Basic" ) ) ); - static const ::rtl::OUString s_sScriptsStorageName( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Scripts" ) ) ); + const ::rtl::OUString s_sBasicStorageName( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Basic" ) ) ); + const ::rtl::OUString s_sScriptsStorageName( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Scripts" ) ) ); bHasMacros =( ( rxStorage->hasByName( s_sBasicStorageName ) && rxStorage->isStorageElement( s_sBasicStorageName ) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 5bddcfe7ce9a..be44438cc3a3 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -481,12 +481,9 @@ SfxSaveGuard::SfxSaveGuard(const uno::Reference< frame::XModel >& xM , m_pData (pData ) , m_pFramesLock(0 ) { - static ::rtl::OUString MSG_1("Object already disposed."); - static ::rtl::OUString MSG_2("Concurrent save requests on the same document are not possible."); - if ( m_pData->m_bClosed ) throw ::com::sun::star::lang::DisposedException( - MSG_1, + ::rtl::OUString("Object already disposed."), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >()); if ( @@ -494,7 +491,7 @@ SfxSaveGuard::SfxSaveGuard(const uno::Reference< frame::XModel >& xM m_pData->m_bSaving ) throw ::com::sun::star::io::IOException( - MSG_2, + ::rtl::OUString("Concurrent save requests on the same document are not possible."), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >()); m_pData->m_bSaving = sal_True; @@ -1473,8 +1470,6 @@ void SAL_CALL SfxBaseModel::removeModifyListener(const uno::Reference< XMODIFYLI void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::CloseVetoException, uno::RuntimeException) { - static ::rtl::OUString MSG_1("Cant close while saving."); - SolarMutexGuard aGuard; if ( impl_isDisposed() || m_pData->m_bClosed || m_pData->m_bClosing ) return; @@ -1503,7 +1498,7 @@ void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::Clo if (bDeliverOwnership) m_pData->m_bSuicide = sal_True; throw util::CloseVetoException( - MSG_1, + ::rtl::OUString("Cant close while saving."), static_cast< ::com::sun::star::util::XCloseable* >(this)); } @@ -3739,7 +3734,7 @@ css::uno::Reference< css::frame::XTitle > SfxBaseModel::impl_getTitleHelper () if ( ! m_pData->m_xTitleHelper.is ()) { css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory (); - static const ::rtl::OUString SERVICENAME_DESKTOP("com.sun.star.frame.Desktop"); + const ::rtl::OUString SERVICENAME_DESKTOP("com.sun.star.frame.Desktop"); css::uno::Reference< css::frame::XUntitledNumbers > xDesktop(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::frame::XModel > xThis (static_cast< css::frame::XModel* >(this), css::uno::UNO_QUERY_THROW); diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx index ce4e3ac58e0a..ac0764f9c779 100644 --- a/stoc/source/security/file_policy.cxx +++ b/stoc/source/security/file_policy.cxx @@ -594,8 +594,7 @@ Sequence< OUString > filepolicy_getSupportedServiceNames() SAL_THROW(()) //-------------------------------------------------------------------------------------------------- OUString filepolicy_getImplementationName() SAL_THROW(()) { - static OUString s_implName = OUSTR(IMPL_NAME); - return s_implName; + return OUSTR(IMPL_NAME); } } diff --git a/svtools/source/filter/FilterConfigCache.cxx b/svtools/source/filter/FilterConfigCache.cxx index 79743cf8c41f..f0b6a5fbcf86 100644 --- a/svtools/source/filter/FilterConfigCache.cxx +++ b/svtools/source/filter/FilterConfigCache.cxx @@ -117,7 +117,7 @@ String FilterConfigCache::FilterConfigCacheEntry::GetShortName() @param sPackage specify, which config package should be opened. - Must be one of the defined static values TYPEPKG or FILTERPKG. + Must be one of "types" or "filters" @return A valid object if open was successfull. The access on opened data will be readonly. It returns NULL in case open failed. @@ -127,9 +127,6 @@ String FilterConfigCache::FilterConfigCacheEntry::GetShortName() Reference< XInterface > openConfig(const char* sPackage) throw(RuntimeException) { - static OUString TYPEPKG( "types" ); - static OUString FILTERPKG( "filters" ); - Reference< XMultiServiceFactory > xSMGR( comphelper::getProcessServiceFactory() ); Reference< XInterface > xCfg; @@ -146,9 +143,9 @@ Reference< XInterface > openConfig(const char* sPackage) // define cfg path for open aParam.Name = OUString( "nodepath" ); - if (TYPEPKG.equalsIgnoreAsciiCaseAscii(sPackage)) + if (rtl_str_compareIgnoreAsciiCase(sPackage, "types") == 0) aParam.Value <<= OUString( "/org.openoffice.TypeDetection.Types/Types" ); - if (FILTERPKG.equalsIgnoreAsciiCaseAscii(sPackage)) + if (rtl_str_compareIgnoreAsciiCase(sPackage, "filters") == 0) aParam.Value <<= OUString( "/org.openoffice.TypeDetection.GraphicFilter/Filters" ); lParams[0] = makeAny(aParam); @@ -167,14 +164,14 @@ Reference< XInterface > openConfig(const char* sPackage) void FilterConfigCache::ImplInit() { - static OUString STYPE ( "Type" ); - static OUString SUINAME ( "UIName" ); - static OUString SUICOMPONENT ( "UIComponent" ); - static OUString SFLAGS ( "Flags" ); - static OUString SMEDIATYPE ( "MediaType" ); - static OUString SEXTENSIONS ( "Extensions" ); - static OUString SFORMATNAME ( "FormatName" ); - static OUString SREALFILTERNAME ( "RealFilterName" ); + OUString STYPE ( "Type" ); + OUString SUINAME ( "UIName" ); + OUString SUICOMPONENT ( "UIComponent" ); + OUString SFLAGS ( "Flags" ); + OUString SMEDIATYPE ( "MediaType" ); + OUString SEXTENSIONS ( "Extensions" ); + OUString SFORMATNAME ( "FormatName" ); + OUString SREALFILTERNAME ( "RealFilterName" ); // get access to config Reference< XNameAccess > xTypeAccess ( openConfig("types" ), UNO_QUERY ); diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx index 27dfa6e9670b..a792011a7b88 100644 --- a/svx/source/unodraw/recoveryui.cxx +++ b/svx/source/unodraw/recoveryui.cxx @@ -167,8 +167,7 @@ void SAL_CALL RecoveryUI::removeStatusListener(const css::uno::Reference< css::f //=============================================== ::rtl::OUString RecoveryUI::st_getImplementationName() { - static ::rtl::OUString IMPLEMENTATIONNAME = IMPLEMENTATIONNAME_RECOVERYUI; - return IMPLEMENTATIONNAME; + return ::rtl::OUString(IMPLEMENTATIONNAME_RECOVERYUI); } //=============================================== diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx index 07ae774c65cb..0130017cdab4 100644 --- a/unotools/source/config/bootstrap.cxx +++ b/unotools/source/config/bootstrap.cxx @@ -163,15 +163,6 @@ typedef Bootstrap::PathStatus PathStatus; sal_Unicode const cURLSeparator = '/'; // --------------------------------------------------------------------------------------- -static -inline -OUString getURLSeparator() -{ - static OUString theSep(&cURLSeparator,1); - return theSep; -} - -// --------------------------------------------------------------------------------------- // path status utility function static PathStatus implCheckStatusOfURL(OUString const& _sURL, osl::DirectoryItem& aDirItem) @@ -263,28 +254,7 @@ bool implEnsureAbsolute(OUString & _rsURL) // also strips embedded dots !! return false; } } -/* old code to strip embedded dots - static OUString const sDots(RTL_CONSTASCII_USTRINGPARAM("/..")); - - sal_Int32 nDotsIndex = _rsURL.indexOf(sDots); - while (nDotsIndex >= 0) - { - OSL_ASSERT(_rsURL.indexOf(sDots) == nDotsIndex); - - sal_Int32 nStripIndex = _rsURL.lastIndexOf(cURLSeparator,nDotsIndex); - if (nStripIndex < 0 || nStripIndex+1 == nDotsIndex) - { - OSL_TRACE("Invalid use of dots in bootstrap URL"); - return false; - } - _rsURL = _rsURL.copy(0,nStripIndex) + _rsURL.copy(nDotsIndex + sDots.getLength()); - - nDotsIndex = _rsURL.indexOf(sDots,nStripIndex); - } - return true; -} -*/ // --------------------------------------------------------------------------------------- static @@ -365,7 +335,6 @@ PathStatus getDerivedPath( ) { OUString sDerivedURL; - OSL_PRECOND(!_rData.getFrom(_sBootstrapParameter,sDerivedURL),"Setting for derived path is already defined"); OSL_PRECOND(!_sRelativeURL.isEmpty() && _sRelativeURL[0] != cURLSeparator,"Invalid Relative URL"); @@ -376,7 +345,7 @@ PathStatus getDerivedPath( { OSL_PRECOND(_aBaseURL[_aBaseURL.getLength()-1] != cURLSeparator,"Unexpected: base URL ends in slash"); - sDerivedURL = _aBaseURL + getURLSeparator() + _sRelativeURL; + sDerivedURL = rtl::OUStringBuffer(_aBaseURL).append(cURLSeparator).append(_sRelativeURL).makeStringAndClear(); // a derived (nested) URL can only exist or have a lesser status, if the parent exists if (aStatus == Bootstrap::PATH_EXISTS) diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index 9c6f01eecb8f..168191e0ffc6 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -697,9 +697,8 @@ void lcl_normalizeLocalNames(Sequence< OUString >& _rNames, ConfigNameFormat _eF } else { - static const OUString sSetService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.SetAccess")); Reference<XServiceInfo> xSVI(_xParentNode, UNO_QUERY); - if (xSVI.is() && xSVI->supportsService(sSetService)) + if (xSVI.is() && xSVI->supportsService("com.sun.star.configuration.SetAccess")) { OUString * pNames = _rNames.getArray(); for(int i = 0; i<_rNames.getLength(); ++i) diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx index 3c290d7ab88f..5f933e84a50a 100644 --- a/unotools/source/config/confignode.cxx +++ b/unotools/source/config/confignode.cxx @@ -488,19 +488,14 @@ namespace utl //======================================================================== namespace { - //-------------------------------------------------------------------- - static const ::rtl::OUString& lcl_getProviderServiceName( ) - { - static ::rtl::OUString s_sProviderServiceName( "com.sun.star.configuration.ConfigurationProvider" ); - return s_sProviderServiceName; - } + static const char s_sProviderServiceName[] = "com.sun.star.configuration.ConfigurationProvider"; //-------------------------------------------------------------------- Reference< XMultiServiceFactory > lcl_getConfigProvider( const ::comphelper::ComponentContext& i_rContext ) { try { - Reference< XMultiServiceFactory > xProvider( i_rContext.createComponent( lcl_getProviderServiceName() ), UNO_QUERY_THROW ); + Reference< XMultiServiceFactory > xProvider( i_rContext.createComponent(s_sProviderServiceName), UNO_QUERY_THROW ); return xProvider; } catch ( const Exception& ) @@ -614,7 +609,7 @@ namespace utl { try { - Reference< XMultiServiceFactory > xConfigFactory( _rxORB->createInstance( lcl_getProviderServiceName( ) ), UNO_QUERY ); + Reference< XMultiServiceFactory > xConfigFactory( _rxORB->createInstance(s_sProviderServiceName), UNO_QUERY ); if ( xConfigFactory.is() ) return createWithProvider( xConfigFactory, _rPath, _nDepth, _eMode, _bLazyWrite ); } diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index e4f483d24d26..fddd2acacf79 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -282,8 +282,6 @@ rtl::OUString URLParameter::get_the_jar() void URLParameter::readBerkeley() { - static rtl::OUString aQuestionMark("?"); - if( get_id().compareToAscii("") == 0 ) return; @@ -344,9 +342,9 @@ void URLParameter::readBerkeley() if( !aExtensionPath.isEmpty() ) { rtl::OUStringBuffer aExtendedJarStrBuf; - aExtendedJarStrBuf.append( aQuestionMark ); + aExtendedJarStrBuf.append( '?' ); aExtendedJarStrBuf.append( aExtensionPath ); - aExtendedJarStrBuf.append( aQuestionMark ); + aExtendedJarStrBuf.append( '?' ); aExtendedJarStrBuf.append( m_aJar ); m_aJar = aExtendedJarStrBuf.makeStringAndClear(); m_aExtensionRegistryPath = aExtensionRegistryPath; |