From d64395704e1a41e8f39e70a219ce3be90928e04d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 11 Aug 2016 14:06:49 +0200 Subject: loplugin:unusedenumconstants in unotools..xmlhelp Change-Id: Id7ddc0fc1f57c5e8e7fb002e31d54fb8e9f8ffab Reviewed-on: https://gerrit.libreoffice.org/28050 Tested-by: Jenkins Reviewed-by: Noel Grandin --- unotools/source/config/eventcfg.cxx | 2 -- unotools/source/config/pathoptions.cxx | 29 ++++++++++------------------- unotools/source/ucbhelper/ucblockbytes.cxx | 1 - 3 files changed, 10 insertions(+), 22 deletions(-) (limited to 'unotools') diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx index 0f968a85e22a..19226c22e60c 100644 --- a/unotools/source/config/eventcfg.cxx +++ b/unotools/source/config/eventcfg.cxx @@ -47,8 +47,6 @@ static const char ROOTNODE_EVENTS[] = "Office.Events/ApplicationEvents"; static o3tl::enumarray pEventAsciiNames = { -"OnStartApp", -"OnCloseApp", "OnCreate", "OnNew", "OnLoadFinished", diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index d5963e76c107..944eb366dd72 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -46,6 +46,7 @@ #include "itemholder1.hxx" +#include #include #include @@ -68,18 +69,11 @@ using namespace com::sun::star::lang; #define STRPOS_NOTFOUND -1 -enum VarNameProperty -{ - VAR_NEEDS_SYSTEM_PATH, - VAR_NEEDS_FILEURL -}; - typedef std::unordered_map NameToHandleMap; typedef std::unordered_map EnumToHandleMap; -typedef std::unordered_map - VarNameToEnumMap; +typedef std::set VarNameSet; // class SvtPathOptions_Impl --------------------------------------------- class SvtPathOptions_Impl @@ -91,7 +85,7 @@ class SvtPathOptions_Impl Reference< XStringSubstitution > m_xSubstVariables; Reference< XMacroExpander > m_xMacroExpander; mutable EnumToHandleMap m_aMapEnumToPropHandle; - VarNameToEnumMap m_aMapVarNamesToEnum; + VarNameSet m_aSystemPathVarNames; LanguageTag m_aLanguageTag; OUString m_aEmptyString; @@ -174,7 +168,6 @@ struct PropertyStruct struct VarNameAttribute { const char* pVarName; // The name of the path variable - VarNameProperty eVarProperty; // Which return value is needed by this path variable }; static const PropertyStruct aPropNames[] = @@ -208,10 +201,10 @@ static const PropertyStruct aPropNames[] = static const VarNameAttribute aVarNameAttribute[] = { - { SUBSTITUTE_INSTPATH, VAR_NEEDS_SYSTEM_PATH }, // $(instpath) - { SUBSTITUTE_PROGPATH, VAR_NEEDS_SYSTEM_PATH }, // $(progpath) - { SUBSTITUTE_USERPATH, VAR_NEEDS_SYSTEM_PATH }, // $(userpath) - { SUBSTITUTE_PATH, VAR_NEEDS_SYSTEM_PATH }, // $(path) + { SUBSTITUTE_INSTPATH }, // $(instpath) + { SUBSTITUTE_PROGPATH }, // $(progpath) + { SUBSTITUTE_USERPATH }, // $(userpath) + { SUBSTITUTE_PATH }, // $(path) }; // class SvtPathOptions_Impl --------------------------------------------- @@ -343,8 +336,8 @@ OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar ) const aSubString = aSubString.toAsciiLowerCase(); // Look for special variable that needs a system path. - VarNameToEnumMap::const_iterator pIter = m_aMapVarNamesToEnum.find( aSubString ); - if ( pIter != m_aMapVarNamesToEnum.end() ) + VarNameSet::const_iterator pIter = m_aSystemPathVarNames.find( aSubString ); + if ( pIter != m_aSystemPathVarNames.end() ) bConvertLocal = true; nPosition += nLength; @@ -429,9 +422,7 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() : nCount = sizeof( aVarNameAttribute ) / sizeof( VarNameAttribute ); for ( i = 0; i < nCount; i++ ) { - m_aMapVarNamesToEnum.insert( VarNameToEnumMap::value_type( - OUString::createFromAscii( aVarNameAttribute[i].pVarName ), - aVarNameAttribute[i].eVarProperty )); + m_aSystemPathVarNames.insert( OUString::createFromAscii( aVarNameAttribute[i].pVarName ) ); } // Set language type! diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index bc9d74820f58..e55cf2091c74 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -282,7 +282,6 @@ public: enum ReplyType { NOREPLY, EXIT, - RETRY, REQUESTHANDLED }; -- cgit