From 3211dbd1b6d214b93fc944434d577a62745d749d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 3 Feb 2017 16:01:54 +0200 Subject: loplugin:unusedenumconstants in basctl drop UNKNOWN constant and convert to scoped enum Change-Id: Iffeb27193cd0df47c781f2b84144d6f85a6b49e0 Reviewed-on: https://gerrit.libreoffice.org/33888 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basctl/source/basicide/bastype2.cxx | 6 +++--- basctl/source/basicide/scriptdocument.cxx | 12 ++++++------ basctl/source/inc/scriptdocument.hxx | 11 +++++------ 3 files changed, 14 insertions(+), 15 deletions(-) (limited to 'basctl') diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index 4238ebd357c7..926cdaf53776 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -715,11 +715,11 @@ void TreeListBox::SetEntryBitmaps( SvTreeListEntry * pEntry, const Image& rImage LibraryType TreeListBox::GetLibraryType() const { - LibraryType eType = LIBRARY_TYPE_ALL; + LibraryType eType = LibraryType::All; if ( ( nMode & BROWSEMODE_MODULES ) && !( nMode & BROWSEMODE_DIALOGS ) ) - eType = LIBRARY_TYPE_MODULE; + eType = LibraryType::Module; else if ( !( nMode & BROWSEMODE_MODULES ) && ( nMode & BROWSEMODE_DIALOGS ) ) - eType = LIBRARY_TYPE_DIALOG; + eType = LibraryType::Dialog; return eType; } diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx index c5966a49f1da..49a0f271b2d4 100644 --- a/basctl/source/basicide/scriptdocument.cxx +++ b/basctl/source/basicide/scriptdocument.cxx @@ -1486,9 +1486,9 @@ namespace basctl { switch ( _eType ) { - case LIBRARY_TYPE_MODULE: aTitle = IDE_RESSTR(RID_STR_USERMACROS); break; - case LIBRARY_TYPE_DIALOG: aTitle = IDE_RESSTR(RID_STR_USERDIALOGS); break; - case LIBRARY_TYPE_ALL: aTitle = IDE_RESSTR(RID_STR_USERMACROSDIALOGS); break; + case LibraryType::Module: aTitle = IDE_RESSTR(RID_STR_USERMACROS); break; + case LibraryType::Dialog: aTitle = IDE_RESSTR(RID_STR_USERDIALOGS); break; + case LibraryType::All: aTitle = IDE_RESSTR(RID_STR_USERMACROSDIALOGS); break; default: break; } @@ -1497,9 +1497,9 @@ namespace basctl { switch ( _eType ) { - case LIBRARY_TYPE_MODULE: aTitle = IDE_RESSTR(RID_STR_SHAREMACROS); break; - case LIBRARY_TYPE_DIALOG: aTitle = IDE_RESSTR(RID_STR_SHAREDIALOGS); break; - case LIBRARY_TYPE_ALL: aTitle = IDE_RESSTR(RID_STR_SHAREMACROSDIALOGS); break; + case LibraryType::Module: aTitle = IDE_RESSTR(RID_STR_SHAREMACROS); break; + case LibraryType::Dialog: aTitle = IDE_RESSTR(RID_STR_SHAREDIALOGS); break; + case LibraryType::All: aTitle = IDE_RESSTR(RID_STR_SHAREMACROSDIALOGS); break; default: break; } diff --git a/basctl/source/inc/scriptdocument.hxx b/basctl/source/inc/scriptdocument.hxx index 65467998b4b8..68835bf3d074 100644 --- a/basctl/source/inc/scriptdocument.hxx +++ b/basctl/source/inc/scriptdocument.hxx @@ -50,12 +50,11 @@ namespace basctl LIBRARY_LOCATION_DOCUMENT }; - enum LibraryType + enum class LibraryType { - LIBRARY_TYPE_UNKNOWN, - LIBRARY_TYPE_MODULE, - LIBRARY_TYPE_DIALOG, - LIBRARY_TYPE_ALL + Module, + Dialog, + All }; class ScriptDocument; @@ -463,7 +462,7 @@ namespace basctl getLibraryLocation( const OUString& _rLibName ) const; /// returns the title for the document - OUString getTitle( LibraryLocation _eLocation, LibraryType _eType = LIBRARY_TYPE_ALL ) const; + OUString getTitle( LibraryLocation _eLocation, LibraryType _eType = LibraryType::All ) const; /** returns the title of the document -- cgit