diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-03-24 14:00:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-03-26 12:18:08 +0100 |
commit | d41b5a88bd4fdff79975d0a64a56d6aae2be1f22 (patch) | |
tree | 79f755f5f8bdc4d4e9485e6afe2c12fac168413f /framework | |
parent | 35fe7d4365f0fd9e118d17bb4b579cf303cd6720 (diff) |
reduce over use of static OUStrings
Diffstat (limited to 'framework')
3 files changed, 25 insertions, 35 deletions
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 2c740088e452..ca210b89260e 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -73,12 +73,8 @@ namespace framework { - const ::rtl::OUString CFG_ENTRY_PRIMARY(RTL_CONSTASCII_USTRINGPARAM("PrimaryKeys")); - const ::rtl::OUString CFG_ENTRY_SECONDARY(RTL_CONSTASCII_USTRINGPARAM("SecondaryKeys")); - const ::rtl::OUString CFG_ENTRY_GLOBAL(RTL_CONSTASCII_USTRINGPARAM("Global")); - const ::rtl::OUString CFG_ENTRY_MODULES(RTL_CONSTASCII_USTRINGPARAM("Modules")); - const ::rtl::OUString CFG_PROP_COMMAND(RTL_CONSTASCII_USTRINGPARAM("Command")); - + const char CFG_ENTRY_SECONDARY[] = "SecondaryKeys"; + const char CFG_PROP_COMMAND[] = "Command"; #ifdef fpc #error "Who exports this define? I use it as namespace alias ..." @@ -1245,14 +1241,14 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util: ::rtl::OUString sPrimarySecondary = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); ::rtl::OUString sGlobalModules = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); - if ( sGlobalModules.equals(CFG_ENTRY_GLOBAL) ) + if ( sGlobalModules.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CFG_ENTRY_GLOBAL)) ) { ::rtl::OUString sModule; sKey = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); if ( !sKey.isEmpty() && !sPath.isEmpty() ) reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey); } - else if ( sGlobalModules.equals(CFG_ENTRY_MODULES) ) + else if ( sGlobalModules.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CFG_ENTRY_MODULES)) ) { ::rtl::OUString sModule = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); sKey = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); @@ -1487,9 +1483,9 @@ void XCUBasedAcceleratorConfiguration::insertKeyToConfiguration( const css::awt: else m_xCfg->getByName(CFG_ENTRY_SECONDARY) >>= xAccess; - if ( m_sGlobalOrModules.equals(CFG_ENTRY_GLOBAL) ) + if ( m_sGlobalOrModules.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CFG_ENTRY_GLOBAL)) ) xAccess->getByName(CFG_ENTRY_GLOBAL) >>= xContainer; - else if ( m_sGlobalOrModules.equals(CFG_ENTRY_MODULES) ) + else if ( m_sGlobalOrModules.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CFG_ENTRY_MODULES)) ) { css::uno::Reference< css::container::XNameContainer > xModules; xAccess->getByName(CFG_ENTRY_MODULES) >>= xModules; @@ -1532,9 +1528,9 @@ void XCUBasedAcceleratorConfiguration::removeKeyFromConfiguration( const css::aw else m_xCfg->getByName(CFG_ENTRY_SECONDARY) >>= xAccess; - if ( m_sGlobalOrModules.equals(CFG_ENTRY_GLOBAL) ) + if ( m_sGlobalOrModules.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CFG_ENTRY_GLOBAL)) ) xAccess->getByName(CFG_ENTRY_GLOBAL) >>= xContainer; - else if ( m_sGlobalOrModules.equals(CFG_ENTRY_MODULES) ) + else if ( m_sGlobalOrModules.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CFG_ENTRY_MODULES)) ) { css::uno::Reference< css::container::XNameAccess > xModules; xAccess->getByName(CFG_ENTRY_MODULES) >>= xModules; @@ -1554,7 +1550,7 @@ void XCUBasedAcceleratorConfiguration::reloadChanged( const ::rtl::OUString& sPr css::uno::Reference< css::container::XNameContainer > xContainer; m_xCfg->getByName(sPrimarySecondary) >>= xAccess; - if ( sGlobalModules.equals(CFG_ENTRY_GLOBAL) ) + if ( sGlobalModules.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CFG_ENTRY_GLOBAL)) ) xAccess->getByName(CFG_ENTRY_GLOBAL) >>= xContainer; else { @@ -1602,14 +1598,14 @@ void XCUBasedAcceleratorConfiguration::reloadChanged( const ::rtl::OUString& sPr xCommand->getByName(sLocale) >>= sCommand; } - if (sPrimarySecondary.equals(CFG_ENTRY_PRIMARY)) + if (sPrimarySecondary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CFG_ENTRY_PRIMARY))) { if (sCommand.isEmpty()) m_aPrimaryReadCache.removeKey(aKeyEvent); else m_aPrimaryReadCache.setKeyCommandPair(aKeyEvent, sCommand); } - else if (sPrimarySecondary.equals(CFG_ENTRY_SECONDARY)) + else if (sPrimarySecondary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CFG_ENTRY_SECONDARY))) { if (sCommand.isEmpty()) m_aSecondaryReadCache.removeKey(aKeyEvent); diff --git a/framework/source/inc/accelerators/acceleratorconfiguration.hxx b/framework/source/inc/accelerators/acceleratorconfiguration.hxx index 1b34cb13c3e1..13c1a94e4dad 100644 --- a/framework/source/inc/accelerators/acceleratorconfiguration.hxx +++ b/framework/source/inc/accelerators/acceleratorconfiguration.hxx @@ -73,16 +73,10 @@ namespace framework { -//----------------------------------------------- -// Accelerators.xcu -extern const ::rtl::OUString CFG_ENTRY_PRIMARY; -extern const ::rtl::OUString CFG_ENTRY_SECONDARY; - -extern const ::rtl::OUString CFG_ENTRY_GLOBAL; -extern const ::rtl::OUString CFG_ENTRY_MODULES; - -extern const ::rtl::OUString CFG_PROP_COMMAND; +const char CFG_ENTRY_PRIMARY[] = "PrimaryKeys"; +const char CFG_ENTRY_GLOBAL[] = "Global"; +const char CFG_ENTRY_MODULES[] = "Modules"; /** "global" type to make accelerator presets unique, so they can be used in combination with the salhelper::SingletonRef mechanism! */ diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 9edec64f4b63..73f6ac6e9eda 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -199,17 +199,17 @@ static const ::rtl::OUString CMD_DO_SESSION_RESTORE(RTL_CONSTASCII_USTRINGPARAM( static const ::rtl::OUString CMD_DO_DISABLE_RECOVERY(RTL_CONSTASCII_USTRINGPARAM("/disableRecovery")); // disable recovery and auto save (!) temp. for this office session static const ::rtl::OUString CMD_DO_SET_AUTOSAVE_STATE(RTL_CONSTASCII_USTRINGPARAM("/setAutoSaveState")); // disable/enable auto save (not crash save) for this office session -static const ::rtl::OUString REFERRER_USER(RTL_CONSTASCII_USTRINGPARAM("private:user")); +static const char REFERRER_USER[] = "private:user"; -static const ::rtl::OUString PROP_DISPATCH_ASYNCHRON(RTL_CONSTASCII_USTRINGPARAM("DispatchAsynchron")); -static const ::rtl::OUString PROP_PROGRESS(RTL_CONSTASCII_USTRINGPARAM("StatusIndicator")); -static const ::rtl::OUString PROP_SAVEPATH(RTL_CONSTASCII_USTRINGPARAM("SavePath")); -static const ::rtl::OUString PROP_ENTRY_ID(RTL_CONSTASCII_USTRINGPARAM("EntryID")); -static const ::rtl::OUString PROP_AUTOSAVE_STATE(RTL_CONSTASCII_USTRINGPARAM("AutoSaveState")); +static const char PROP_DISPATCH_ASYNCHRON[] = "DispatchAsynchron"; +static const char PROP_PROGRESS[] = "StatusIndicator"; +static const char PROP_SAVEPATH[] = "SavePath"; +static const char PROP_ENTRY_ID[] = "EntryID"; +static const char PROP_AUTOSAVE_STATE[] = "AutoSaveState"; -static const ::rtl::OUString OPERATION_START(RTL_CONSTASCII_USTRINGPARAM("start")); -static const ::rtl::OUString OPERATION_STOP(RTL_CONSTASCII_USTRINGPARAM("stop")); -static const ::rtl::OUString OPERATION_UPDATE(RTL_CONSTASCII_USTRINGPARAM("update")); +static const char OPERATION_START[] = "start"; +static const char OPERATION_STOP[] = "stop"; +static const char OPERATION_UPDATE[] = "update"; static const sal_Int32 MIN_DISCSPACE_DOCSAVE = 5; // [MB] static const sal_Int32 MIN_DISCSPACE_CONFIGSAVE = 1; // [MB] @@ -2483,7 +2483,7 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa ::comphelper::MediaDescriptor lDescriptor; // its an UI feature - so the "USER" itself must be set as referer - lDescriptor[::comphelper::MediaDescriptor::PROP_REFERRER()] <<= REFERRER_USER; + lDescriptor[::comphelper::MediaDescriptor::PROP_REFERRER()] <<= ::rtl::OUString(REFERRER_USER); lDescriptor[::comphelper::MediaDescriptor::PROP_SALVAGEDFILE()] <<= ::rtl::OUString(); // recovered documents are loaded hidden, and shown all at once, later @@ -2930,7 +2930,7 @@ css::frame::FeatureStateEvent AutoRecovery::implst_createFeatureStateEvent( aEvent.FeatureURL.Complete = AutoRecovery::implst_getJobDescription(eJob); aEvent.FeatureDescriptor = sEventType; - if (sEventType.equals(OPERATION_UPDATE) && pInfo) + if (pInfo && sEventType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(OPERATION_UPDATE))) { // pack rInfo for transport via UNO ::comphelper::NamedValueCollection aInfo; |