diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-31 10:29:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-31 10:31:25 +0000 |
commit | aeeabc36fd0a4a71238c8c3df2e80ea324f9bac0 (patch) | |
tree | e329e090adf73c37d18897ddacbd6b1e07382512 /unotools/source/config | |
parent | 40f186a73225f0fcbce828c97d6395dfffb79a90 (diff) |
loplugin:oncevar in unoxml..toolkit
Change-Id: I3b97665908be0a44d24192433bdc9c2bd9008736
Reviewed-on: https://gerrit.libreoffice.org/30431
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools/source/config')
-rw-r--r-- | unotools/source/config/eventcfg.cxx | 9 | ||||
-rw-r--r-- | unotools/source/config/historyoptions.cxx | 18 | ||||
-rw-r--r-- | unotools/source/config/lingucfg.cxx | 15 |
3 files changed, 15 insertions, 27 deletions
diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx index 6b70a39e902d..f9e846ea2bf6 100644 --- a/unotools/source/config/eventcfg.cxx +++ b/unotools/source/config/eventcfg.cxx @@ -40,7 +40,6 @@ using namespace ::osl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star; -static const char ROOTNODE_EVENTS[] = "Office.Events/ApplicationEvents"; #define PATHDELIMITER "/" #define SETNODE_BINDINGS "Bindings" #define PROPERTYNAME_BINDINGURL "BindingURL" @@ -107,7 +106,7 @@ public: GlobalEventConfig_Impl::GlobalEventConfig_Impl() - : ConfigItem( ROOTNODE_EVENTS, ConfigItemMode::ImmediateUpdate ) + : ConfigItem( "Office.Events/ApplicationEvents", ConfigItemMode::ImmediateUpdate ) { // the supported event names for (const GlobalEventId id : o3tl::enumrange<GlobalEventId>()) @@ -169,15 +168,15 @@ void GlobalEventConfig_Impl::ImplCommit() ClearNodeSet( SETNODE_BINDINGS ); Sequence< beans::PropertyValue > seqValues( 1 ); OUString sNode; - static const char sPrefix[] = SETNODE_BINDINGS PATHDELIMITER "BindingType['"; - static const char sPostfix[] = "']" PATHDELIMITER PROPERTYNAME_BINDINGURL; //step through the list of events for(int i=0;it!=it_end;++it,++i) { //no point in writing out empty bindings! if(it->second.isEmpty() ) continue; - sNode = sPrefix + it->first + sPostfix; + sNode = SETNODE_BINDINGS PATHDELIMITER "BindingType['" + + it->first + + "']" PATHDELIMITER PROPERTYNAME_BINDINGURL; OSL_TRACE("writing binding for: %s",OUStringToOString(sNode , RTL_TEXTENCODING_ASCII_US ).pData->buffer); seqValues[ 0 ].Name = sNode; seqValues[ 0 ].Value <<= it->second; diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index 28de4cc1730e..13810fbfd4d7 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -51,12 +51,6 @@ namespace { static const ::sal_Int32 s_nOffsetPassword = 3; static const ::sal_Int32 s_nOffsetThumbnail = 4; - const char s_sCommonHistory[] = "org.openoffice.Office.Common/History"; - const char s_sHistories[] = "org.openoffice.Office.Histories/Histories"; - const char s_sPickListSize[] = "PickListSize"; - const char s_sHelpBookmarksSize[] = "HelpBookmarkSize"; - const char s_sPickList[] = "PickList"; - const char s_sHelpBookmarks[] = "HelpBookmarks"; const char s_sItemList[] = "ItemList"; const char s_sOrderList[] = "OrderList"; const char s_sHistoryItemRef[] = "HistoryItemRef"; @@ -108,14 +102,14 @@ SvtHistoryOptions_Impl::SvtHistoryOptions_Impl() m_xCfg.set( ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessComponentContext(), - s_sHistories, + "org.openoffice.Office.Histories/Histories", ::comphelper::EConfigurationModes::Standard), uno::UNO_QUERY); m_xCommonXCU.set( ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessComponentContext(), - s_sCommonHistory, + "org.openoffice.Office.Common/History", ::comphelper::EConfigurationModes::Standard), uno::UNO_QUERY); } @@ -146,11 +140,11 @@ sal_uInt32 SvtHistoryOptions_Impl::GetCapacity(EHistoryType eHistory) switch (eHistory) { case ePICKLIST: - xListAccess->getPropertyValue(s_sPickListSize) >>= nSize; + xListAccess->getPropertyValue("PickListSize") >>= nSize; break; case eHELPBOOKMARKS: - xListAccess->getPropertyValue(s_sHelpBookmarksSize) >>= nSize; + xListAccess->getPropertyValue("HelpBookmarkSize") >>= nSize; break; default: @@ -174,11 +168,11 @@ uno::Reference<container::XNameAccess> SvtHistoryOptions_Impl::GetListAccess(EHi switch (eHistory) { case ePICKLIST: - m_xCfg->getByName(s_sPickList) >>= xListAccess; + m_xCfg->getByName("PickList") >>= xListAccess; break; case eHELPBOOKMARKS: - m_xCfg->getByName(s_sHelpBookmarks) >>= xListAccess; + m_xCfg->getByName("HelpBookmarks") >>= xListAccess; break; default: diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index 451518e1bb6c..c9d9c639c6a1 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -785,12 +785,7 @@ bool SvtLinguConfigItem::IsReadOnly( sal_Int32 nPropertyHandle ) const static SvtLinguConfigItem *pCfgItem = nullptr; static sal_Int32 nCfgItemRefCount = 0; -static const char aG_SupportedDictionaryFormats[] = "SupportedDictionaryFormats"; static const char aG_Dictionaries[] = "Dictionaries"; -static const char aG_Locations[] = "Locations"; -static const char aG_Format[] = "Format"; -static const char aG_Locales[] = "Locales"; -static const char aG_DisabledDictionaries[] = "DisabledDictionaries"; SvtLinguConfig::SvtLinguConfig() { @@ -905,7 +900,7 @@ bool SvtLinguConfig::GetSupportedDictionaryFormatsFor( xNA.set( xNA->getByName("ServiceManager"), uno::UNO_QUERY_THROW ); xNA.set( xNA->getByName( rSetName ), uno::UNO_QUERY_THROW ); xNA.set( xNA->getByName( rSetEntry ), uno::UNO_QUERY_THROW ); - if (xNA->getByName( aG_SupportedDictionaryFormats ) >>= rFormatList) + if (xNA->getByName( "SupportedDictionaryFormats" ) >>= rFormatList) bSuccess = true; DBG_ASSERT( rFormatList.getLength(), "supported dictionary format list is empty" ); } @@ -953,9 +948,9 @@ bool SvtLinguConfig::GetDictionaryEntry( uno::Sequence< OUString > aLocations; OUString aFormatName; uno::Sequence< OUString > aLocaleNames; - bSuccess = (xNA->getByName( aG_Locations ) >>= aLocations) && - (xNA->getByName( aG_Format ) >>= aFormatName) && - (xNA->getByName( aG_Locales ) >>= aLocaleNames); + bSuccess = (xNA->getByName( "Locations" ) >>= aLocations) && + (xNA->getByName( "Format" ) >>= aFormatName) && + (xNA->getByName( "Locales" ) >>= aLocaleNames); DBG_ASSERT( aLocations.getLength(), "Dictionary locations not set" ); DBG_ASSERT( !aFormatName.isEmpty(), "Dictionary format name not set" ); DBG_ASSERT( aLocaleNames.getLength(), "No locales set for the dictionary" ); @@ -993,7 +988,7 @@ uno::Sequence< OUString > SvtLinguConfig::GetDisabledDictionaries() const { uno::Reference< container::XNameAccess > xNA( GetMainUpdateAccess(), uno::UNO_QUERY_THROW ); xNA.set( xNA->getByName("ServiceManager"), uno::UNO_QUERY_THROW ); - xNA->getByName( aG_DisabledDictionaries ) >>= aResult; + xNA->getByName( "DisabledDictionaries" ) >>= aResult; } catch (uno::Exception &) { |