[Libreoffice-commits] core.git: basctl/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Feb 6 05:49:11 UTC 2017


 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(-)

New commits:
commit 3211dbd1b6d214b93fc944434d577a62745d749d
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Feb 3 16:01:54 2017 +0200

    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 at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index 4238ebd..926cdaf 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 c5966a4..49a0f27 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 6546799..68835bf 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
 


More information about the Libreoffice-commits mailing list