From 75b7b685cecde509bb305dc370448f42010d00da Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 7 Feb 2017 09:37:01 +0200 Subject: convert ScaCategory to scoped enum and drop unused AddIn constant Change-Id: I4422f34db756649cb08aa9aa7f975cef73ccfa91 --- scaddins/source/datefunc/datefunc.cxx | 31 ++++++++++++++----------------- scaddins/source/datefunc/datefunc.hxx | 19 +++++++++---------- 2 files changed, 23 insertions(+), 27 deletions(-) (limited to 'scaddins/source') diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index d5e0d9aac320..9bf44cb799b4 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -52,14 +52,14 @@ ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) : const ScaFuncDataBase pFuncDataArr[] = { - FUNCDATA( DiffWeeks, 3, ScaCat_DateTime, UNIQUE, INTPAR ), - FUNCDATA( DiffMonths, 3, ScaCat_DateTime, UNIQUE, INTPAR ), - FUNCDATA( DiffYears, 3, ScaCat_DateTime, UNIQUE, INTPAR ), - FUNCDATA( IsLeapYear, 1, ScaCat_DateTime, UNIQUE, INTPAR ), - FUNCDATA( DaysInMonth, 1, ScaCat_DateTime, UNIQUE, INTPAR ), - FUNCDATA( DaysInYear, 1, ScaCat_DateTime, UNIQUE, INTPAR ), - FUNCDATA( WeeksInYear, 1, ScaCat_DateTime, UNIQUE, INTPAR ), - FUNCDATA( Rot13, 1, ScaCat_Text, UNIQUE, STDPAR ) + FUNCDATA( DiffWeeks, 3, ScaCategory::DateTime, UNIQUE, INTPAR ), + FUNCDATA( DiffMonths, 3, ScaCategory::DateTime, UNIQUE, INTPAR ), + FUNCDATA( DiffYears, 3, ScaCategory::DateTime, UNIQUE, INTPAR ), + FUNCDATA( IsLeapYear, 1, ScaCategory::DateTime, UNIQUE, INTPAR ), + FUNCDATA( DaysInMonth, 1, ScaCategory::DateTime, UNIQUE, INTPAR ), + FUNCDATA( DaysInYear, 1, ScaCategory::DateTime, UNIQUE, INTPAR ), + FUNCDATA( WeeksInYear, 1, ScaCategory::DateTime, UNIQUE, INTPAR ), + FUNCDATA( Rot13, 1, ScaCategory::Text, UNIQUE, STDPAR ) }; #undef FUNCDATA @@ -353,15 +353,12 @@ OUString SAL_CALL ScaDateAddIn::getProgrammaticCategoryName( { switch( fDataIt->GetCategory() ) { - case ScaCat_DateTime: aRet = STR_FROM_ANSI( "Date&Time" ); break; - case ScaCat_Text: aRet = STR_FROM_ANSI( "Text" ); break; - case ScaCat_Finance: aRet = STR_FROM_ANSI( "Financial" ); break; - case ScaCat_Inf: aRet = STR_FROM_ANSI( "Information" ); break; - case ScaCat_Math: aRet = STR_FROM_ANSI( "Mathematical" ); break; - case ScaCat_Tech: aRet = STR_FROM_ANSI( "Technical" ); break; - // coverity[dead_error_begin] - following conditions exist to avoid compiler warning - default: - break; + case ScaCategory::DateTime: aRet = STR_FROM_ANSI( "Date&Time" ); break; + case ScaCategory::Text: aRet = STR_FROM_ANSI( "Text" ); break; + case ScaCategory::Finance: aRet = STR_FROM_ANSI( "Financial" ); break; + case ScaCategory::Inf: aRet = STR_FROM_ANSI( "Information" ); break; + case ScaCategory::Math: aRet = STR_FROM_ANSI( "Mathematical" ); break; + case ScaCategory::Tech: aRet = STR_FROM_ANSI( "Technical" ); break; } } diff --git a/scaddins/source/datefunc/datefunc.hxx b/scaddins/source/datefunc/datefunc.hxx index c0637d6295a4..1a30f8acf9dc 100644 --- a/scaddins/source/datefunc/datefunc.hxx +++ b/scaddins/source/datefunc/datefunc.hxx @@ -102,15 +102,14 @@ public: }; -enum ScaCategory +enum class ScaCategory { - ScaCat_AddIn, - ScaCat_DateTime, - ScaCat_Text, - ScaCat_Finance, - ScaCat_Inf, - ScaCat_Math, - ScaCat_Tech + DateTime, + Text, + Finance, + Inf, + Math, + Tech }; struct ScaFuncDataBase @@ -121,8 +120,8 @@ struct ScaFuncDataBase sal_uInt16 nCompListID; // resource ID to list of valid names sal_uInt16 nParamCount; // number of named / described parameters ScaCategory eCat; // function category - bool bDouble; // name already exist in Calc - bool bWithOpt; // first parameter is internal + bool bDouble; // name already exist in Calc + bool bWithOpt; // first parameter is internal }; class ScaFuncData final -- cgit v1.2.3