summaryrefslogtreecommitdiff
path: root/svtools/source/config
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-06-10 02:23:03 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-10 08:34:21 +0000
commitbe9f916fdf6a561746391945d2bc2a823f62fa9d (patch)
treef291b78b1aa781e4a770f5f0ffa5e4aa88d37966 /svtools/source/config
parent10fa03258fcc7d9e820bd68a25d9d781c6dd7397 (diff)
Convert set of #define to enum class in helpopt
Change-Id: Ic6c31f810fa9e2ab64390702c85fcb4e3db5fad3 Reviewed-on: https://gerrit.libreoffice.org/26140 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools/source/config')
-rw-r--r--svtools/source/config/helpopt.cxx40
1 files changed, 22 insertions, 18 deletions
diff --git a/svtools/source/config/helpopt.cxx b/svtools/source/config/helpopt.cxx
index 6f612ef5b7cc..94edac0a1b1b 100644
--- a/svtools/source/config/helpopt.cxx
+++ b/svtools/source/config/helpopt.cxx
@@ -40,11 +40,14 @@ using namespace com::sun::star;
static SvtHelpOptions_Impl* pOptions = nullptr;
static sal_Int32 nRefCount = 0;
-#define EXTENDEDHELP 0
-#define HELPTIPS 1
-#define LOCALE 2
-#define SYSTEM 3
-#define STYLESHEET 4
+enum class HelpProperty
+{
+ ExtendedHelp = 0,
+ HelpTips = 1,
+ Locale = 2,
+ System = 3,
+ StyleSheet = 4
+};
class SvtHelpOptions_Impl : public utl::ConfigItem
{
@@ -158,12 +161,13 @@ void SvtHelpOptions_Impl::Load(const uno::Sequence< OUString>& rPropertyNames)
sal_Int32 nTmpInt = 0;
if ( pValues[nProp] >>= bTmp )
{
- switch ( lcl_MapPropertyName(rPropertyNames[nProp], aInternalPropertyNames) )
+ switch ( static_cast< HelpProperty >(
+ lcl_MapPropertyName(rPropertyNames[nProp], aInternalPropertyNames) ) )
{
- case EXTENDEDHELP :
+ case HelpProperty::ExtendedHelp:
bExtendedHelp = bTmp;
break;
- case HELPTIPS :
+ case HelpProperty::HelpTips:
bHelpTips = bTmp;
break;
default:
@@ -173,16 +177,16 @@ void SvtHelpOptions_Impl::Load(const uno::Sequence< OUString>& rPropertyNames)
}
else if ( pValues[nProp] >>= aTmpStr )
{
- switch ( nProp )
+ switch ( static_cast< HelpProperty >(nProp) )
{
- case LOCALE:
+ case HelpProperty::Locale:
aLocale = aTmpStr;
break;
- case SYSTEM:
+ case HelpProperty::System:
aSystem = aTmpStr;
break;
- case STYLESHEET :
+ case HelpProperty::StyleSheet:
sHelpStyleSheet = aTmpStr;
break;
default:
@@ -215,24 +219,24 @@ void SvtHelpOptions_Impl::ImplCommit()
Any* pValues = aValues.getArray();
for ( int nProp = 0; nProp < aNames.getLength(); nProp++ )
{
- switch ( nProp )
+ switch ( static_cast< HelpProperty >(nProp) )
{
- case EXTENDEDHELP :
+ case HelpProperty::ExtendedHelp:
pValues[nProp] <<= bExtendedHelp;
break;
- case HELPTIPS :
+ case HelpProperty::HelpTips:
pValues[nProp] <<= bHelpTips;
break;
- case LOCALE:
+ case HelpProperty::Locale:
pValues[nProp] <<= OUString(aLocale);
break;
- case SYSTEM:
+ case HelpProperty::System:
pValues[nProp] <<= OUString(aSystem);
break;
- case STYLESHEET :
+ case HelpProperty::StyleSheet:
pValues[nProp] <<= OUString(sHelpStyleSheet);
break;