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 <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2017-02-03 16:01:54 +02:00
parent 8b2ffb280b
commit 3211dbd1b6
3 changed files with 14 additions and 15 deletions

View File

@@ -715,11 +715,11 @@ void TreeListBox::SetEntryBitmaps( SvTreeListEntry * pEntry, const Image& rImage
LibraryType TreeListBox::GetLibraryType() const LibraryType TreeListBox::GetLibraryType() const
{ {
LibraryType eType = LIBRARY_TYPE_ALL; LibraryType eType = LibraryType::All;
if ( ( nMode & BROWSEMODE_MODULES ) && !( nMode & BROWSEMODE_DIALOGS ) ) if ( ( nMode & BROWSEMODE_MODULES ) && !( nMode & BROWSEMODE_DIALOGS ) )
eType = LIBRARY_TYPE_MODULE; eType = LibraryType::Module;
else if ( !( nMode & BROWSEMODE_MODULES ) && ( nMode & BROWSEMODE_DIALOGS ) ) else if ( !( nMode & BROWSEMODE_MODULES ) && ( nMode & BROWSEMODE_DIALOGS ) )
eType = LIBRARY_TYPE_DIALOG; eType = LibraryType::Dialog;
return eType; return eType;
} }

View File

@@ -1486,9 +1486,9 @@ namespace basctl
{ {
switch ( _eType ) switch ( _eType )
{ {
case LIBRARY_TYPE_MODULE: aTitle = IDE_RESSTR(RID_STR_USERMACROS); break; case LibraryType::Module: aTitle = IDE_RESSTR(RID_STR_USERMACROS); break;
case LIBRARY_TYPE_DIALOG: aTitle = IDE_RESSTR(RID_STR_USERDIALOGS); break; case LibraryType::Dialog: aTitle = IDE_RESSTR(RID_STR_USERDIALOGS); break;
case LIBRARY_TYPE_ALL: aTitle = IDE_RESSTR(RID_STR_USERMACROSDIALOGS); break; case LibraryType::All: aTitle = IDE_RESSTR(RID_STR_USERMACROSDIALOGS); break;
default: default:
break; break;
} }
@@ -1497,9 +1497,9 @@ namespace basctl
{ {
switch ( _eType ) switch ( _eType )
{ {
case LIBRARY_TYPE_MODULE: aTitle = IDE_RESSTR(RID_STR_SHAREMACROS); break; case LibraryType::Module: aTitle = IDE_RESSTR(RID_STR_SHAREMACROS); break;
case LIBRARY_TYPE_DIALOG: aTitle = IDE_RESSTR(RID_STR_SHAREDIALOGS); break; case LibraryType::Dialog: aTitle = IDE_RESSTR(RID_STR_SHAREDIALOGS); break;
case LIBRARY_TYPE_ALL: aTitle = IDE_RESSTR(RID_STR_SHAREMACROSDIALOGS); break; case LibraryType::All: aTitle = IDE_RESSTR(RID_STR_SHAREMACROSDIALOGS); break;
default: default:
break; break;
} }

View File

@@ -50,12 +50,11 @@ namespace basctl
LIBRARY_LOCATION_DOCUMENT LIBRARY_LOCATION_DOCUMENT
}; };
enum LibraryType enum class LibraryType
{ {
LIBRARY_TYPE_UNKNOWN, Module,
LIBRARY_TYPE_MODULE, Dialog,
LIBRARY_TYPE_DIALOG, All
LIBRARY_TYPE_ALL
}; };
class ScriptDocument; class ScriptDocument;
@@ -463,7 +462,7 @@ namespace basctl
getLibraryLocation( const OUString& _rLibName ) const; getLibraryLocation( const OUString& _rLibName ) const;
/// returns the title for the document /// 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 /** returns the title of the document