[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang svx/inc svx/source sw/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Feb 7 06:01:39 UTC 2017


 compilerplugins/clang/unusedenumconstants.py |    3 +++
 svx/inc/galbrws2.hxx                         |    8 ++------
 svx/source/gallery2/galbrws2.cxx             |    8 ++++----
 svx/source/gallery2/galctrl.cxx              |    8 ++++----
 sw/source/uibase/docvw/edtwin.cxx            |    3 +--
 5 files changed, 14 insertions(+), 16 deletions(-)

New commits:
commit d91c81e4335ccf6a383d1d66d789f2478c92bc7a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Feb 6 13:51:47 2017 +0200

    convert GalleryBrowserTravel to scoped enum
    
    and drop unused GALLERYBROWSERTRAVEL_CURRENT value
    
    Change-Id: Id91824cbe024d4b5109ee0755b518164837bc6a6
    Reviewed-on: https://gerrit.libreoffice.org/33965
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index 4c454f5..3b5585e 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -100,6 +100,9 @@ for d in definitionSet:
          "framework/inc/helper/mischelper.hxx",
          "include/svtools/htmltokn.h",
          "include/sfx2/shell.hxx",
+         "sw/inc/iodetect.hxx",
+         "sw/inc/fmtfordr.hxx",
+         "sw/inc/flddat.hxx",
         # Windows or OSX only
          "include/canvas/rendering/icolorbuffer.hxx",
          "include/vcl/commandevent.hxx",
diff --git a/svx/inc/galbrws2.hxx b/svx/inc/galbrws2.hxx
index e7168f0..3db2b5a 100644
--- a/svx/inc/galbrws2.hxx
+++ b/svx/inc/galbrws2.hxx
@@ -44,13 +44,9 @@ enum GalleryBrowserMode
 };
 
 
-enum GalleryBrowserTravel
+enum class GalleryBrowserTravel
 {
-    GALLERYBROWSERTRAVEL_CURRENT = 0,
-    GALLERYBROWSERTRAVEL_FIRST = 1,
-    GALLERYBROWSERTRAVEL_LAST = 2,
-    GALLERYBROWSERTRAVEL_PREVIOUS = 3,
-    GALLERYBROWSERTRAVEL_NEXT = 4
+    First, Last, Previous, Next
 };
 
 enum class GalleryItemFlags {
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index f7a3be6..2f3927b 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -855,10 +855,10 @@ void GalleryBrowser2::Travel( GalleryBrowserTravel eTravel )
 
             switch( eTravel )
             {
-                case GALLERYBROWSERTRAVEL_FIRST:     nNewItemId = 1; break;
-                case GALLERYBROWSERTRAVEL_LAST:      nNewItemId = mpCurTheme->GetObjectCount(); break;
-                case GALLERYBROWSERTRAVEL_PREVIOUS:  nNewItemId--; break;
-                case GALLERYBROWSERTRAVEL_NEXT:      nNewItemId++; break;
+                case GalleryBrowserTravel::First:     nNewItemId = 1; break;
+                case GalleryBrowserTravel::Last:      nNewItemId = mpCurTheme->GetObjectCount(); break;
+                case GalleryBrowserTravel::Previous:  nNewItemId--; break;
+                case GalleryBrowserTravel::Next:      nNewItemId++; break;
                 default:
                     break;
             }
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index 0bd9ba3..f7f9edb 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -170,21 +170,21 @@ void GalleryPreview::KeyInput(const KeyEvent& rKEvt)
             break;
 
             case KEY_HOME:
-                pBrowser->Travel( GALLERYBROWSERTRAVEL_FIRST );
+                pBrowser->Travel( GalleryBrowserTravel::First );
             break;
 
             case KEY_END:
-                pBrowser->Travel( GALLERYBROWSERTRAVEL_LAST );
+                pBrowser->Travel( GalleryBrowserTravel::Last );
             break;
 
             case KEY_LEFT:
             case KEY_UP:
-                pBrowser->Travel( GALLERYBROWSERTRAVEL_PREVIOUS );
+                pBrowser->Travel( GalleryBrowserTravel::Previous );
             break;
 
             case KEY_RIGHT:
             case KEY_DOWN:
-                pBrowser->Travel( GALLERYBROWSERTRAVEL_NEXT );
+                pBrowser->Travel( GalleryBrowserTravel::Next );
             break;
 
             default:
commit c57cbcea9a4434eddba31d185e738cc7e3fbd73c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Feb 6 13:02:50 2017 +0200

    remove unused value from SW_KeyState enum
    
    Change-Id: Ied6ac5724957ff10fd1e9e217bbb32c1187f3cba
    Reviewed-on: https://gerrit.libreoffice.org/33963
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 8869510..0a5762c 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -1560,8 +1560,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
     bool bStopKeyInputTimer = true;
     OUString sFormulaEntry;
 
-    enum SW_KeyState { KS_Start,
-                       KS_CheckKey, KS_InsChar, KS_InsTab,
+    enum SW_KeyState { KS_CheckKey, KS_InsChar, KS_InsTab,
                        KS_NoNum, KS_NumOff, KS_NumOrNoNum, KS_NumDown, KS_NumUp,
                        KS_NumIndentInc, KS_NumIndentDec,
 


More information about the Libreoffice-commits mailing list