compilerplugins/clang/unusedenumconstants.py        |    5 +
 desktop/source/deployment/registry/help/dp_help.cxx |    5 -
 framework/source/dispatch/closedispatcher.cxx       |    6 +-
 framework/source/dispatch/startmoduledispatcher.cxx |    2 
 framework/source/fwe/classes/framelistanalyzer.cxx  |   23 +++----
 framework/source/loadenv/loadenv.cxx                |    8 +-
 framework/source/services/frame.cxx                 |    2 
 helpcompiler/inc/HelpCompiler.hxx                   |    2 
 helpcompiler/source/HelpCompiler.cxx                |    2 
 helpcompiler/source/HelpLinker.cxx                  |   52 ++++++++---------
 include/framework/framelistanalyzer.hxx             |   50 +++++++++-------
 include/helpcompiler/compilehelp.hxx                |   15 ++---
 include/i18nutil/paper.hxx                          |    2 
 include/rsc/rsc-vcl-shared-types.hxx                |    8 --
 reportdesign/source/ui/inc/ReportDefines.hxx        |    2 
 reportdesign/source/ui/report/DesignView.cxx        |    4 -
 reportdesign/source/ui/report/ReportController.cxx  |   24 ++++----
 reportdesign/source/ui/report/ReportSection.cxx     |    6 +-
 reportdesign/source/ui/report/dlgedfunc.cxx         |   25 +++-----
 sal/qa/osl/file/osl_File.cxx                        |    5 -
 sc/inc/dbdata.hxx                                   |    1 
 sc/inc/detfunc.hxx                                  |   12 +---
 sc/inc/externalrefmgr.hxx                           |   12 ----
 sc/inc/global.hxx                                   |   13 +---
 sc/inc/types.hxx                                    |    8 +-
 sc/inc/viewdata.hxx                                 |   15 +++--
 sc/source/core/data/bcaslot.cxx                     |    6 +-
 sc/source/core/data/table3.cxx                      |    2 
 sc/source/core/inc/bcaslot.hxx                      |    2 
 sc/source/core/tool/dbdata.cxx                      |    2 
 sc/source/core/tool/detfunc.cxx                     |   55 ++++++------------
 sc/source/ui/app/inputhdl.cxx                       |    4 -
 sc/source/ui/docshell/dbdocfun.cxx                  |    2 
 sc/source/ui/docshell/dbdocimp.cxx                  |    2 
 sc/source/ui/docshell/docfunc.cxx                   |    4 -
 sc/source/ui/docshell/docsh4.cxx                    |    2 
 sc/source/ui/docshell/docsh5.cxx                    |    6 +-
 sc/source/ui/docshell/externalrefmgr.cxx            |   37 ++++--------
 sc/source/ui/drawfunc/futext.cxx                    |    2 
 sc/source/ui/inc/dbfunc.hxx                         |    2 
 sc/source/ui/unoobj/cellsuno.cxx                    |   22 +++----
 sc/source/ui/view/cellsh1.cxx                       |    4 -
 sc/source/ui/view/dbfunc.cxx                        |   29 ++-------
 sc/source/ui/view/gridwin.cxx                       |    4 -
 sc/source/ui/view/tabvwshc.cxx                      |    4 -
 sc/source/ui/view/viewdata.cxx                      |    4 -
 sc/source/ui/view/viewfun5.cxx                      |    2 
 sc/source/ui/view/viewfunc.cxx                      |    2 
 sfx2/source/view/viewfrm.cxx                        |    2 
 svx/source/dialog/page.h                            |    2 
 vcl/source/window/decoview.cxx                      |   59 --------------------
 51 files changed, 220 insertions(+), 351 deletions(-)

New commits:
commit d76d15552d7ef9faddb0694e5f05d180e5798c14
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Thu Feb 16 08:16:45 2017 +0200

    convert FrameListAnalyzer::EDetect to scoped enum
    
    Change-Id: I4e1bd449c4ad60ec810ef52c73d6c6ff3dd313ee

diff --git a/framework/source/dispatch/closedispatcher.cxx 
b/framework/source/dispatch/closedispatcher.cxx
index a9ad77b..97527aa 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -287,7 +287,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback, 
LinkParamNone*, void)
     // If we found some special cases, we can
     // make some decisions earlier!
     css::uno::Reference< css::frame::XFramesSupplier > xDesktop( 
css::frame::Desktop::create(xContext), css::uno::UNO_QUERY_THROW);
-    FrameListAnalyzer aCheck1(xDesktop, xCloseFrame, FrameListAnalyzer::E_HELP 
| FrameListAnalyzer::E_BACKINGCOMPONENT);
+    FrameListAnalyzer aCheck1(xDesktop, xCloseFrame, FrameAnalyzerFlags::Help 
| FrameAnalyzerFlags::BackingComponent);
 
     // Check for existing UNO connections.
     // NOTE: There is a race between checking this and connections being 
created/destroyed before
@@ -330,7 +330,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback, 
LinkParamNone*, void)
         {
             // OK; this frame is empty now.
             // Check the environment again to decide, what is the next step.
-            FrameListAnalyzer aCheck2(xDesktop, xCloseFrame, 
FrameListAnalyzer::E_ALL);
+            FrameListAnalyzer aCheck2(xDesktop, xCloseFrame, 
FrameAnalyzerFlags::All);
 
             // c1) there is as minimum 1 frame open, which is visible and 
contains a document
             //     different from our one. And it's not the help!
@@ -456,7 +456,7 @@ bool CloseDispatcher::implts_prepareFrameForClosing(const 
css::uno::Reference< c
         }
 
         css::uno::Reference< css::frame::XFramesSupplier > xDesktop( 
css::frame::Desktop::create( xContext ), css::uno::UNO_QUERY_THROW);
-        FrameListAnalyzer aCheck(xDesktop, xFrame, FrameListAnalyzer::E_ALL);
+        FrameListAnalyzer aCheck(xDesktop, xFrame, FrameAnalyzerFlags::All);
 
         size_t c = aCheck.m_lModelFrames.size();
         size_t i = 0;
diff --git a/framework/source/dispatch/startmoduledispatcher.cxx 
b/framework/source/dispatch/startmoduledispatcher.cxx
index 8fb1006..64f5974 100644
--- a/framework/source/dispatch/startmoduledispatcher.cxx
+++ b/framework/source/dispatch/startmoduledispatcher.cxx
@@ -111,7 +111,7 @@ bool StartModuleDispatcher::implts_isBackingModePossible()
     FrameListAnalyzer aCheck(
         xDesktop,
         css::uno::Reference< css::frame::XFrame >(),
-        FrameListAnalyzer::E_HELP | FrameListAnalyzer::E_BACKINGCOMPONENT);
+        FrameAnalyzerFlags::Help | FrameAnalyzerFlags::BackingComponent);
 
     bool  bIsPossible    = false;
 
diff --git a/framework/source/fwe/classes/framelistanalyzer.cxx 
b/framework/source/fwe/classes/framelistanalyzer.cxx
index 2b6ded8..efb772f 100644
--- a/framework/source/fwe/classes/framelistanalyzer.cxx
+++ b/framework/source/fwe/classes/framelistanalyzer.cxx
@@ -40,7 +40,7 @@ namespace framework{
 
 FrameListAnalyzer::FrameListAnalyzer( const css::uno::Reference< 
css::frame::XFramesSupplier >& xSupplier       ,
                                       const css::uno::Reference< 
css::frame::XFrame >&          xReferenceFrame ,
-                                            sal_uInt32                         
                 eDetectMode     )
+                                            FrameAnalyzerFlags                 
                 eDetectMode     )
     : m_xSupplier      (xSupplier      )
     , m_xReferenceFrame(xReferenceFrame)
     , m_eDetectMode    (eDetectMode    )
@@ -97,7 +97,7 @@ void FrameListAnalyzer::impl_analyze()
     // to sort it into the list of frames with the same model.
     // Suppress this step, if right detect mode isn't set.
     css::uno::Reference< css::frame::XModel > xReferenceModel;
-    if ((m_eDetectMode & E_MODEL) == E_MODEL )
+    if (m_eDetectMode & FrameAnalyzerFlags::Model)
     {
         css::uno::Reference< css::frame::XController > xReferenceController;
         if (m_xReferenceFrame.is())
@@ -109,17 +109,14 @@ void FrameListAnalyzer::impl_analyze()
     // check, if the reference frame is in hidden mode.
     // But look, if this analyze step is really needed.
     css::uno::Reference< css::beans::XPropertySet > xSet(m_xReferenceFrame, 
css::uno::UNO_QUERY);
-    if (
-        ((m_eDetectMode & E_HIDDEN) == E_HIDDEN) &&
-        (xSet.is()                             )
-       )
+    if ( (m_eDetectMode & FrameAnalyzerFlags::Hidden) && xSet.is() )
     {
         xSet->getPropertyValue(FRAME_PROPNAME_ASCII_ISHIDDEN) >>= 
m_bReferenceIsHidden;
     }
 
     // check, if the reference frame includes the backing component.
     // But look, if this analyze step is really needed.
-    if (((m_eDetectMode & E_BACKINGCOMPONENT) == E_BACKINGCOMPONENT) && 
m_xReferenceFrame.is() )
+    if ((m_eDetectMode & FrameAnalyzerFlags::BackingComponent) && 
m_xReferenceFrame.is() )
     {
         try
         {
@@ -140,7 +137,7 @@ void FrameListAnalyzer::impl_analyze()
     // check, if the reference frame includes the help module.
     // But look, if this analyze step is really needed.
     if (
-        ((m_eDetectMode & E_HELP)     == E_HELP                ) &&
+        (m_eDetectMode & FrameAnalyzerFlags::Help) &&
         (m_xReferenceFrame.is()                                ) &&
         (m_xReferenceFrame->getName() == SPECIALTARGET_HELPTASK)
        )
@@ -165,7 +162,7 @@ void FrameListAnalyzer::impl_analyze()
                 continue;
 
             if (
-                ((m_eDetectMode & E_ZOMBIE) == E_ZOMBIE) &&
+                (m_eDetectMode & FrameAnalyzerFlags::Zombie) &&
                 (
                  (!xFrame->getContainerWindow().is()) ||
                  (!xFrame->getComponentWindow().is())
@@ -178,7 +175,7 @@ void FrameListAnalyzer::impl_analyze()
             // a) Is it the special help task?
             //    Return it separated from any return list.
             if (
-                ((m_eDetectMode & E_HELP) == E_HELP      ) &&
+                (m_eDetectMode & FrameAnalyzerFlags::Help) &&
                 (xFrame->getName()==SPECIALTARGET_HELPTASK)
                )
             {
@@ -190,7 +187,7 @@ void FrameListAnalyzer::impl_analyze()
             //    Return it separated from any return list.
             //    But check if the reference task itself is the backing frame.
             //    Our user must know it to decide right.
-            if ((m_eDetectMode & E_BACKINGCOMPONENT) == E_BACKINGCOMPONENT)
+            if (m_eDetectMode & FrameAnalyzerFlags::BackingComponent)
             {
                 try
                 {
@@ -210,7 +207,7 @@ void FrameListAnalyzer::impl_analyze()
 
             // c) Or is it the a task, which uses the specified model?
             //    Add it to the list of "model frames".
-            if ((m_eDetectMode & E_MODEL) == E_MODEL)
+            if (m_eDetectMode & FrameAnalyzerFlags::Model)
             {
                 css::uno::Reference< css::frame::XController > xController = 
xFrame->getController();
                 css::uno::Reference< css::frame::XModel >      xModel;
@@ -229,7 +226,7 @@ void FrameListAnalyzer::impl_analyze()
             //    visible state ... if it's allowed to do so.
 
             bool bHidden = false;
-            if ((m_eDetectMode & E_HIDDEN) == E_HIDDEN )
+            if (m_eDetectMode & FrameAnalyzerFlags::Hidden)
             {
                 xSet.set(xFrame, css::uno::UNO_QUERY);
                 if (xSet.is())
diff --git a/framework/source/loadenv/loadenv.cxx 
b/framework/source/loadenv/loadenv.cxx
index 4687489..c98fb8b 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -914,9 +914,9 @@ bool LoadEnv::impl_furtherDocsAllowed()
 
             FrameListAnalyzer aAnalyzer(xDesktop,
                                         css::uno::Reference< 
css::frame::XFrame >(),
-                                        FrameListAnalyzer::E_HELP |
-                                        FrameListAnalyzer::E_BACKINGCOMPONENT |
-                                        FrameListAnalyzer::E_HIDDEN);
+                                        FrameAnalyzerFlags::Help |
+                                        FrameAnalyzerFlags::BackingComponent |
+                                        FrameAnalyzerFlags::Hidden);
 
             sal_Int32 nOpenDocuments = aAnalyzer.m_lOtherVisibleFrames.size();
                       bAllowed       = (nOpenDocuments < nMaxOpenDocuments);
@@ -1352,7 +1352,7 @@ css::uno::Reference< css::frame::XFrame > 
LoadEnv::impl_searchRecycleTarget()
         return css::uno::Reference< css::frame::XFrame >();
 
     css::uno::Reference< css::frame::XFramesSupplier > xSupplier( 
css::frame::Desktop::create( m_xContext ), css::uno::UNO_QUERY);
-    FrameListAnalyzer aTasksAnalyzer(xSupplier, css::uno::Reference< 
css::frame::XFrame >(), FrameListAnalyzer::E_BACKINGCOMPONENT);
+    FrameListAnalyzer aTasksAnalyzer(xSupplier, css::uno::Reference< 
css::frame::XFrame >(), FrameAnalyzerFlags::BackingComponent);
     if (aTasksAnalyzer.m_xBackingComponent.is())
     {
         if 
(!impl_isFrameAlreadyUsedForLoading(aTasksAnalyzer.m_xBackingComponent))
diff --git a/framework/source/services/frame.cxx 
b/framework/source/services/frame.cxx
index 3bdda77..f18f850 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -3254,7 +3254,7 @@ void Frame::impl_checkMenuCloser()
     FrameListAnalyzer aAnalyzer(
         xTaskSupplier,
         this,
-        FrameListAnalyzer::E_HIDDEN | FrameListAnalyzer::E_HELP | 
FrameListAnalyzer::E_BACKINGCOMPONENT);
+        FrameAnalyzerFlags::Hidden | FrameAnalyzerFlags::Help | 
FrameAnalyzerFlags::BackingComponent);
 
     // specify the new frame, which must have this special state ...
     css::uno::Reference< css::frame::XFrame2 > xNewCloserFrame;
diff --git a/include/framework/framelistanalyzer.hxx 
b/include/framework/framelistanalyzer.hxx
index fe4798e..ce44de6 100644
--- a/include/framework/framelistanalyzer.hxx
+++ b/include/framework/framelistanalyzer.hxx
@@ -21,10 +21,30 @@
 #define INCLUDED_FRAMEWORK_FRAMELISTANALYZER_HXX
 
 #include <com/sun/star/frame/XFrame.hpp>
-
 #include <framework/fwedllapi.h>
+#include <o3tl/typed_flags_set.hxx>
+
 #include <vector>
 
+/** These enums can be combined as flags to enable/disable
+    special search algorithm during analyze phase.
+    see impl_analyze() for further information.
+    But note: To be useable as flags, these enums
+    must be values of range [2^n]! */
+enum class FrameAnalyzerFlags
+{
+    Model             =     1,
+    Help              =     2,
+    BackingComponent  =     4,
+    Hidden            =     8,
+    All               =    15,
+    Zombie            = 32768 // use it for special test scenarios only!!!
+};
+namespace o3tl {
+    template<> struct typed_flags<FrameAnalyzerFlags> : 
is_typed_flags<FrameAnalyzerFlags, 32768+15> {};
+}
+
+
 namespace framework{
 
 /** analyze and split the current available frame list of a given frames 
supplier
@@ -41,22 +61,6 @@ class FWE_DLLPUBLIC FrameListAnalyzer final
 
     public:
 
-        /** These enums can be combined as flags to enable/disable
-            special search algorithm during analyze phase.
-            see impl_analyze() for further information.
-            But note: To be useable as flags, these enums
-            must be values of range [2^n]! */
-        enum EDetect
-        {
-            E_MODEL             =     1,
-            E_HELP              =     2,
-            E_BACKINGCOMPONENT  =     4,
-            E_HIDDEN            =     8,
-            E_ALL               =    15,
-            E_ZOMBIE            = 32768 // use it for special test scenarios 
only!!!
-        };
-
-
     // member
 
     public:
@@ -69,10 +73,10 @@ class FWE_DLLPUBLIC FrameListAnalyzer final
 
         /** enable/disable some special analyzing steps.
             see impl_analyze() for further information. */
-        sal_uInt32 m_eDetectMode;
+        FrameAnalyzerFlags m_eDetectMode;
 
         /** contains all frames, which uses the same model like the reference 
frame.
-            Will be filled only if m_eDetectMode has set the flag E_MODEL.
+            Will be filled only if m_eDetectMode has set the flag 
FrameAnalyzerFlags::Model.
             The reference frame is never part of this list! */
         std::vector< css::uno::Reference< css::frame::XFrame > > 
m_lModelFrames;
 
@@ -140,17 +144,17 @@ class FWE_DLLPUBLIC FrameListAnalyzer final
         css::uno::Reference< css::frame::XFrame > m_xBackingComponent;
 
         /** is set to true only, if the reference frame is a hidden one.
-            This value is undefined if m_eDetectMode doesn't have set the flag 
E_HIDDEN! */
+            This value is undefined if m_eDetectMode doesn't have set the flag 
FrameAnalyzerFlags::Hidden! */
         bool m_bReferenceIsHidden;
 
         /** is set to true only, if the reference frame contains the help 
component.
             In this case the member m_xHelp is set to NULL every time.
-            This value is undefined if m_eDetectMode doesn't have set the flag 
E_HELP! */
+            This value is undefined if m_eDetectMode doesn't have set the flag 
FrameAnalyzerFlags::Help! */
         bool m_bReferenceIsHelp;
 
         /** is set to true only, if the reference frame contains the backing 
component.
             In this case the member m_xBackingComponent is set to NULL every 
time.
-            This value is undefined if m_eDetectMode doesn't have set the flag 
E_BACKINGCOMPONENT! */
+            This value is undefined if m_eDetectMode doesn't have set the flag 
FrameAnalyzerFlags::BackingComponent! */
         bool m_bReferenceIsBacking;
 
 
@@ -176,7 +180,7 @@ class FWE_DLLPUBLIC FrameListAnalyzer final
          */
                  FrameListAnalyzer( const css::uno::Reference< 
css::frame::XFramesSupplier >& xSupplier       ,
                                     const css::uno::Reference< 
css::frame::XFrame >&          xReferenceFrame ,
-                                          sal_uInt32                           
               eDetectMode     );
+                                          FrameAnalyzerFlags                   
               eDetectMode     );
                  ~FrameListAnalyzer();
 
 
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index f61d6e9..5b03bb7 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1748,7 +1748,7 @@ SfxViewFrame* 
SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell
                 try
                 {
                     // if there is a backing component, use it
-                    ::framework::FrameListAnalyzer aAnalyzer( xDesktop, 
Reference< XFrame >(), ::framework::FrameListAnalyzer::E_BACKINGCOMPONENT );
+                    ::framework::FrameListAnalyzer aAnalyzer( xDesktop, 
Reference< XFrame >(), FrameAnalyzerFlags::BackingComponent );
 
                     if ( aAnalyzer.m_xBackingComponent.is() )
                         xFrame = aAnalyzer.m_xBackingComponent;
commit ce3441c2d5b6267c437b7af362fc8d29e38c1dd4
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Feb 15 15:44:07 2017 +0200

    convert HelpProcessingErrorClass to scoped enum
    
    and drop unused HELPPROCESSING_INTERNAL_ERROR enumerator
    
    Change-Id: I0f2cf063a3f1472e1d52bab5039b1c3158d4865e

diff --git a/compilerplugins/clang/unusedenumconstants.py 
b/compilerplugins/clang/unusedenumconstants.py
index 122e591..64aaa59 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -159,6 +159,7 @@ for d in definitionSet:
          "sd/source/ui/dlg/PhotoAlbumDialog.hxx", # SlideImageLayout (from UI)
          "sd/inc/pres.hxx", # AutoLayout (from UI)
          "sc/source/ui/inc/scuitphfedit.hxx", # ScHFEntryId (from UI)
+         "include/i18nlangtag/languagetag.hxx", # LanguageTag::ScriptType
         # represents constants from an external API
          "opencl/inc/opencl_device_selection.h",
          "vcl/inc/sft.hxx",
@@ -166,6 +167,7 @@ for d in definitionSet:
          "vcl/unx/gtk/xid_fullscreen_on_all_monitors.c",
          "vcl/unx/gtk/salnativewidgets-gtk.cxx",
          "sc/inc/callform.hxx", # ParamType
+         "include/i18nlangtag/applelangid.hxx", # AppleLanguageId
          ]):
         continue
 
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx 
b/desktop/source/deployment/registry/help/dp_help.cxx
index e84676c..5c265a4 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -486,9 +486,8 @@ void BackendImpl::implProcessHelp(
                             sal_uInt16 nErrStrId = 0;
                             switch( aErrorInfo.m_eErrorClass )
                             {
-                            case HELPPROCESSING_GENERAL_ERROR:
-                            case HELPPROCESSING_INTERNAL_ERROR:     nErrStrId 
= RID_STR_HELPPROCESSING_GENERAL_ERROR; break;
-                            case HELPPROCESSING_XMLPARSING_ERROR:   nErrStrId 
= RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break;
+                            case HelpProcessingErrorClass::General:      
nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break;
+                            case HelpProcessingErrorClass::XmlParsing:   
nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break;
                             default: ;
                             };
 
diff --git a/helpcompiler/inc/HelpCompiler.hxx 
b/helpcompiler/inc/HelpCompiler.hxx
index e0c1b67..0e49754 100644
--- a/helpcompiler/inc/HelpCompiler.hxx
+++ b/helpcompiler/inc/HelpCompiler.hxx
@@ -199,7 +199,7 @@ struct HelpProcessingException
         , m_nXMLParsingLine( 0 )
     {}
     HelpProcessingException( const std::string& aErrorMsg, const std::string& 
aXMLParsingFile, int nXMLParsingLine )
-        : m_eErrorClass( HELPPROCESSING_XMLPARSING_ERROR )
+        : m_eErrorClass( HelpProcessingErrorClass::XmlParsing )
         , m_aErrorMsg( aErrorMsg )
         , m_aXMLParsingFile( aXMLParsingFile )
         , m_nXMLParsingLine( nXMLParsingLine )
diff --git a/helpcompiler/source/HelpCompiler.cxx 
b/helpcompiler/source/HelpCompiler.cxx
index 0eb8953..e456f5a 100644
--- a/helpcompiler/source/HelpCompiler.cxx
+++ b/helpcompiler/source/HelpCompiler.cxx
@@ -449,7 +449,7 @@ bool HelpCompiler::compile()
         {
             std::stringstream aStrStream;
             aStrStream << "ERROR: file not existing: " << 
inputFile.native_file_string().c_str() << std::endl;
-            throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+            throw HelpProcessingException( HelpProcessingErrorClass::General, 
aStrStream.str() );
         }
     }
 
diff --git a/helpcompiler/source/HelpLinker.cxx 
b/helpcompiler/source/HelpLinker.cxx
index 243a5fb2..b06295f 100644
--- a/helpcompiler/source/HelpLinker.cxx
+++ b/helpcompiler/source/HelpLinker.cxx
@@ -387,7 +387,7 @@ void HelpLinker::link()
                         << "' for language '"
                         << lang
                         << "' failed!";
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
 
             if (!m_bCreateIndex)
@@ -567,7 +567,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "extension source missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
             extsource = args[i];
         }
@@ -580,7 +580,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "extension destination missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
             extdestination = args[i];
         }
@@ -591,7 +591,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "sourceroot missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
             bSrcOption = true;
             sourceRoot = fs::path(args[i], fs::native);
@@ -603,7 +603,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "compactStylesheet missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
 
             compactStylesheet = fs::path(args[i], fs::native);
@@ -615,7 +615,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "embeddingStylesheet missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
 
             embeddStylesheet = fs::path(args[i], fs::native);
@@ -627,7 +627,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "idxtemp missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
 
             zipdir = fs::path(args[i], fs::native);
@@ -639,7 +639,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "idxcaption stylesheet missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
 
             idxCaptionStylesheet = fs::path(args[i], fs::native);
@@ -651,7 +651,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "idxcontent stylesheet missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
 
             idxContentStylesheet = fs::path(args[i], fs::native);
@@ -663,7 +663,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "outputfilename missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
 
             outputFile = fs::path(args[i], fs::native);
@@ -675,7 +675,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "module name missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
 
             module = args[i];
@@ -687,7 +687,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "language name missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
 
             lang = args[i];
@@ -695,7 +695,7 @@ void HelpLinker::main( std::vector<std::string> &args,
         else if (args[i].compare("-hid") == 0)
         {
             ++i;
-            throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
"obsolete -hid argument used" );
+            throw HelpProcessingException( HelpProcessingErrorClass::General, 
"obsolete -hid argument used" );
         }
         else if (args[i].compare("-add") == 0)
         {
@@ -705,7 +705,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "pathname missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
 
             addFileUnderPath = args[i];
@@ -714,7 +714,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "pathname missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
             addFile = args[i];
             if (!addFileUnderPath.empty() && !addFile.empty())
@@ -746,7 +746,7 @@ void HelpLinker::main( std::vector<std::string> &args,
             {
                 std::stringstream aStrStream;
                 aStrStream << "-extlangdest is missing" << std::endl;
-                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+                throw HelpProcessingException( 
HelpProcessingErrorClass::General, aStrStream.str() );
             }
             else
             {
@@ -767,7 +767,7 @@ void HelpLinker::main( std::vector<std::string> &args,
         {
             std::stringstream aStrStream;
             aStrStream << "-src must not be used together with -extsource 
missing" << std::endl;
-            throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+            throw HelpProcessingException( HelpProcessingErrorClass::General, 
aStrStream.str() );
         }
     }
 
@@ -775,7 +775,7 @@ void HelpLinker::main( std::vector<std::string> &args,
     {
         std::stringstream aStrStream;
         aStrStream << "no index dir given" << std::endl;
-        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+        throw HelpProcessingException( HelpProcessingErrorClass::General, 
aStrStream.str() );
     }
 
     if ( (!bExtensionMode && idxCaptionStylesheet.empty())
@@ -786,7 +786,7 @@ void HelpLinker::main( std::vector<std::string> &args,
         // -idxcaption parameter is required
         std::stringstream aStrStream;
         aStrStream << "no index caption stylesheet given" << std::endl;
-        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+        throw HelpProcessingException( HelpProcessingErrorClass::General, 
aStrStream.str() );
     }
     else if ( bExtensionMode &&  extsource.empty())
     {
@@ -810,7 +810,7 @@ void HelpLinker::main( std::vector<std::string> &args,
         // -idxcontent parameter is required
         std::stringstream aStrStream;
         aStrStream << "no index content stylesheet given" << std::endl;
-        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+        throw HelpProcessingException( HelpProcessingErrorClass::General, 
aStrStream.str() );
     }
     else if ( bExtensionMode && extsource.empty())
     {
@@ -830,31 +830,31 @@ void HelpLinker::main( std::vector<std::string> &args,
     {
         std::stringstream aStrStream;
         aStrStream << "no embedding resolving file given" << std::endl;
-        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+        throw HelpProcessingException( HelpProcessingErrorClass::General, 
aStrStream.str() );
     }
     if (sourceRoot.empty())
     {
         std::stringstream aStrStream;
         aStrStream << "no sourceroot given" << std::endl;
-        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+        throw HelpProcessingException( HelpProcessingErrorClass::General, 
aStrStream.str() );
     }
     if (!bExtensionMode && outputFile.empty())
     {
         std::stringstream aStrStream;
         aStrStream << "no output file given" << std::endl;
-        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+        throw HelpProcessingException( HelpProcessingErrorClass::General, 
aStrStream.str() );
     }
     if (module.empty())
     {
         std::stringstream aStrStream;
         aStrStream << "module missing" << std::endl;
-        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+        throw HelpProcessingException( HelpProcessingErrorClass::General, 
aStrStream.str() );
     }
     if (!bExtensionMode && lang.empty())
     {
         std::stringstream aStrStream;
         aStrStream << "language missing" << std::endl;
-        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, 
aStrStream.str() );
+        throw HelpProcessingException( HelpProcessingErrorClass::General, 
aStrStream.str() );
     }
     link();
 }
@@ -974,7 +974,7 @@ bool compileExtensionHelp
         if (XML_STATUS_ERROR == parsed)
         {
             XML_Error nError = XML_GetErrorCode( parser );
-            o_rHelpProcessingErrorInfo.m_eErrorClass = 
HELPPROCESSING_XMLPARSING_ERROR;
+            o_rHelpProcessingErrorInfo.m_eErrorClass = 
HelpProcessingErrorClass::XmlParsing;
             o_rHelpProcessingErrorInfo.m_aErrorMsg = 
OUString::createFromAscii( XML_ErrorString( nError ) );
             o_rHelpProcessingErrorInfo.m_aXMLParsingFile = aTreeFileURL;
             // CRASHES!!! o_rHelpProcessingErrorInfo.m_nXMLParsingLine = 
XML_GetCurrentLineNumber( parser );
diff --git a/include/helpcompiler/compilehelp.hxx 
b/include/helpcompiler/compilehelp.hxx
index c9643ac..04c573a 100644
--- a/include/helpcompiler/compilehelp.hxx
+++ b/include/helpcompiler/compilehelp.hxx
@@ -31,23 +31,22 @@
 
 #include <rtl/ustring.hxx>
 
-enum HelpProcessingErrorClass
+enum class HelpProcessingErrorClass
 {
-    HELPPROCESSING_NO_ERROR,
-    HELPPROCESSING_GENERAL_ERROR,       // Missing files, options etc.
-    HELPPROCESSING_INTERNAL_ERROR,      // Unexpected problems
-    HELPPROCESSING_XMLPARSING_ERROR     // Errors thrown by libxml
+    NONE,
+    General,       // Missing files, options etc.
+    XmlParsing     // Errors thrown by libxml
 };
 
 struct HelpProcessingErrorInfo
 {
-    HelpProcessingErrorClass        m_eErrorClass;
+    HelpProcessingErrorClass   m_eErrorClass;
     OUString                   m_aErrorMsg;
     OUString                   m_aXMLParsingFile;
-    sal_Int32                       m_nXMLParsingLine;
+    sal_Int32                  m_nXMLParsingLine;
 
     HelpProcessingErrorInfo()
-        : m_eErrorClass( HELPPROCESSING_NO_ERROR )
+        : m_eErrorClass( HelpProcessingErrorClass::NONE )
         , m_nXMLParsingLine( -1 )
     {}
 
commit 1b9f6808531207d0280bc80374ef75551e3fb732
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Feb 15 15:34:08 2017 +0200

    fix comments
    
    Change-Id: Id3aea25d882b68ad81f68fced24f833146c13252

diff --git a/include/i18nutil/paper.hxx b/include/i18nutil/paper.hxx
index b942cbc..adb539f 100644
--- a/include/i18nutil/paper.hxx
+++ b/include/i18nutil/paper.hxx
@@ -24,7 +24,7 @@
 #include <rtl/string.hxx>
 #include <com/sun/star/lang/Locale.hpp>
 
-//!! WARNING: be aware of cui/source/tabpages/page.h where someone had the 
broken idea
+//!! WARNING: be aware of svx/source/dialog/page.h where someone had the 
broken idea
 //!! of duplicating the values of this enum in order to use those defines 
within
 //!! src files.
 //!! Thus don't reorder the enum values here without changing the code there 
as well.
diff --git a/svx/source/dialog/page.h b/svx/source/dialog/page.h
index 2528e04..266f82e 100644
--- a/svx/source/dialog/page.h
+++ b/svx/source/dialog/page.h
@@ -23,7 +23,7 @@
 
 //!! the values of the following defines must correspond to the array position
 //!! of the respective paper size in the file i18nutil/source/utility/paper.cxx
-//!! There are enums for them in i18nutil/inc/i18nutil/paper.hxx but 
unfortunately
+//!! There are enums for them in include/i18nutil/paper.hxx but unfortunately
 //!! the resource compiler does not understand enums, thus the enum values need
 //!! to be duplicated here for use in the src file.
 #define PAPERSIZE_A0            0
commit 23ea9fb1ddea133bcfed2851f5d520127c7c7c2c
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Feb 15 15:34:00 2017 +0200

    remove unused enumerators from SymbolType enum
    
    Change-Id: I63af4ab93dfd021f88f03fad2c065f5a0e9eeed9

diff --git a/compilerplugins/clang/unusedenumconstants.py 
b/compilerplugins/clang/unusedenumconstants.py
index 20686d0..122e591 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -130,6 +130,8 @@ for d in definitionSet:
          "include/svtools/htmltokn.h",
          "include/sfx2/sidebar/Theme.hxx", # ThemeItem
          "sc/source/ui/docshell/impex.cxx", # SylkVersion
+         "include/rsc/rsc-vcl-shared-types.hxx", # KeyFuncType
+         "include/i18nutil/paper.hxx", # Paper
         # Windows or OSX only
          "include/canvas/rendering/icolorbuffer.hxx",
          "include/vcl/commandevent.hxx",
diff --git a/include/rsc/rsc-vcl-shared-types.hxx 
b/include/rsc/rsc-vcl-shared-types.hxx
index 3603cde..3e23887 100644
--- a/include/rsc/rsc-vcl-shared-types.hxx
+++ b/include/rsc/rsc-vcl-shared-types.hxx
@@ -94,20 +94,12 @@ enum class SymbolType : sal_uInt16
     PAGEUP           = 14,
     PAGEDOWN         = 15,
     PLAY             = 16,
-    REVERSEPLAY      = 17,
-    RECORD           = 18,
     STOP             = 19,
-    PAUSE            = 20,
-    WINDSTART        = 21,
-    WINDEND          = 22,
-    WINDBACKWARD     = 23,
-    WINDFORWARD      = 24,
     CLOSE            = 25,
     ROLLUP           = 26,
     ROLLDOWN         = 27,
     CHECKMARK        = 28,
     RADIOCHECKMARK   = 29,
-    SPIN_UPDOWN      = 30,
     FLOAT            = 31,
     DOCK             = 32,
     HIDE             = 33,
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 46b8d78..70589e9 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -145,7 +145,6 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, 
const SymbolType eType
         case SymbolType::SPIN_LEFT:
         case SymbolType::FIRST:
         case SymbolType::PREV:
-        case SymbolType::REVERSEPLAY:
             nRect.Left() += n4;
             if ( eType==SymbolType::FIRST )
             {
@@ -209,7 +208,6 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, 
const SymbolType eType
             break;
 
         case SymbolType::RADIOCHECKMARK:
-        case SymbolType::RECORD:
             {
                 // Midpoint circle algorithm
                 long x = 0;
@@ -245,49 +243,6 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, 
const SymbolType eType
             pDev->DrawRect( nRect );
             break;
 
-        case SymbolType::PAUSE:
-            pDev->DrawRect( Rectangle ( nRect.Left(), nRect.Top(),
-                                        aCenter.X()-n8, nRect.Bottom() ) );
-            pDev->DrawRect( Rectangle ( aCenter.X()+n8, nRect.Top(),
-                                        nRect.Right(), nRect.Bottom() ) );
-            break;
-
-        case SymbolType::WINDSTART:
-            pDev->DrawLine( Point( nRect.Left(), aCenter.Y()-n2+1 ),
-                            Point( nRect.Left(), aCenter.Y()+n2-1 ) );
-            ++nRect.Left();
-            SAL_FALLTHROUGH;
-        case SymbolType::WINDBACKWARD:
-            pDev->DrawPixel( Point( nRect.Left(), aCenter.Y() ) );
-            pDev->DrawPixel( Point( nRect.Left()+n2, aCenter.Y() ) );
-            for ( long i=1; i < n2; ++i )
-            {
-                ++nRect.Left();
-                pDev->DrawLine( Point( nRect.Left(), aCenter.Y()-i ),
-                                Point( nRect.Left(), aCenter.Y()+i ) );
-                pDev->DrawLine( Point( nRect.Left()+n2, aCenter.Y()-i ),
-                                Point( nRect.Left()+n2, aCenter.Y()+i ) );
-            }
-            break;
-
-        case SymbolType::WINDEND:
-            pDev->DrawLine( Point( nRect.Right(), aCenter.Y()-n2+1 ),
-                            Point( nRect.Right(), aCenter.Y()+n2-1 ) );
-            --nRect.Right();
-            SAL_FALLTHROUGH;
-        case SymbolType::WINDFORWARD:
-            pDev->DrawPixel( Point( nRect.Right(), aCenter.Y() ) );
-            pDev->DrawPixel( Point( nRect.Right()-n2, aCenter.Y() ) );
-            for ( long i=1; i < n2; ++i )
-            {
-                --nRect.Right();
-                pDev->DrawLine( Point( nRect.Right(), aCenter.Y()-i ),
-                                Point( nRect.Right(), aCenter.Y()+i ) );
-                pDev->DrawLine( Point( nRect.Right()-n2, aCenter.Y()-i ),
-                                Point( nRect.Right()-n2, aCenter.Y()+i ) );
-            }
-            break;
-
         case SymbolType::CLOSE:
             pDev->DrawLine( Point( nRect.Left(), nRect.Top() ),
                             Point( nRect.Right(), nRect.Bottom() ) );
@@ -356,20 +311,6 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, 
const SymbolType eType
             }
             break;
 
-        case SymbolType::SPIN_UPDOWN:
-            pDev->DrawPixel( Point( aCenter.X(), nRect.Top() ) );
-            pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom() ) );
-            for ( long i=1; i < n2; ++i )
-            {
-                ++nRect.Top();
-                --nRect.Bottom();
-                pDev->DrawLine( Point( aCenter.X()-i, nRect.Top() ),
-                                Point( aCenter.X()+i, nRect.Top() ) );
-                pDev->DrawLine( Point( aCenter.X()-i, nRect.Bottom() ),
-                                Point( aCenter.X()+i, nRect.Bottom() ) );
-            }
-            break;
-
         case SymbolType::FLOAT:
             nRect.Right() -= n4;
             nRect.Top() += n4+1;
commit e52b83ec3f820333e052d0d756268e878086611d
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Feb 15 14:15:07 2017 +0200

    convert DlgEdMode to scoped enum
    
    and drop unused RPTUI_READONLY enumerator
    
    Change-Id: I863ffc40b3b8f065d01e9570134ee1e2cef400c1

diff --git a/reportdesign/source/ui/inc/ReportDefines.hxx 
b/reportdesign/source/ui/inc/ReportDefines.hxx
index 0cca0d8..1b8438f 100644
--- a/reportdesign/source/ui/inc/ReportDefines.hxx
+++ b/reportdesign/source/ui/inc/ReportDefines.hxx
@@ -21,7 +21,7 @@
 
 namespace rptui
 {
-    enum DlgEdMode { RPTUI_INSERT, RPTUI_SELECT, RPTUI_TEST, RPTUI_READONLY };
+    enum class DlgEdMode { Insert, Select, Test };
 
 #define REPORT_STARTMARKER_WIDTH    120
 #define REPORT_ENDMARKER_WIDTH       10
diff --git a/reportdesign/source/ui/report/DesignView.cxx 
b/reportdesign/source/ui/report/DesignView.cxx
index a409d5f..265c73b 100644
--- a/reportdesign/source/ui/report/DesignView.cxx
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -94,7 +94,7 @@ ODesignView::ODesignView(   vcl::Window* pParent,
     ,m_pAddField(nullptr)
     ,m_pCurrentView(nullptr)
     ,m_pReportExplorer(nullptr)
-    ,m_eMode( RPTUI_SELECT )
+    ,m_eMode( DlgEdMode::Select )
     ,m_eActObj( OBJ_NONE )
     ,m_aGridSizeCoarse( 1000, 1000 )    // #i93595# 100TH_MM changed to grid 
using coarse 1 cm grid
     ,m_aGridSizeFine( 250, 250 )        // and a 0,25 cm subdivision for 
better visualisation
@@ -284,7 +284,7 @@ IMPL_LINK_NOARG(ODesignView, MarkTimeout, Timer *, void)
 void ODesignView::SetMode( DlgEdMode _eNewMode )
 {
     m_eMode = _eNewMode;
-    if ( m_eMode == RPTUI_SELECT )
+    if ( m_eMode == DlgEdMode::Select )
         m_eActObj = OBJ_NONE;
 
     m_aScrollWindow->SetMode(_eNewMode);
diff --git a/reportdesign/source/ui/report/ReportController.cxx 
b/reportdesign/source/ui/report/ReportController.cxx
index 29ffb27..ef0fd07 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -536,7 +536,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) 
const
                 aReturn.bEnabled = getCurrentSectionView() != nullptr;
             break;
         case SID_ESCAPE:
-            aReturn.bEnabled = getDesignView()->GetMode() == RPTUI_INSERT;
+            aReturn.bEnabled = getDesignView()->GetMode() == DlgEdMode::Insert;
             break;
         case SID_TERMINATE_INPLACEACTIVATION:
             aReturn.bEnabled = true;
@@ -592,7 +592,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) 
const
             break;
         case SID_OBJECT_SELECT:
             aReturn.bEnabled = true;
-            aReturn.bChecked = getDesignView()->GetMode() == RPTUI_SELECT;
+            aReturn.bChecked = getDesignView()->GetMode() == DlgEdMode::Select;
             break;
         case SID_INSERT_DIAGRAM:
             aReturn.bEnabled = isEditable();
@@ -1103,7 +1103,7 @@ void OReportController::Execute(sal_uInt16 _nId, const 
Sequence< PropertyValue >
             }
             break;
         case SID_ESCAPE:
-            getDesignView()->SetMode(RPTUI_SELECT);
+            getDesignView()->SetMode(DlgEdMode::Select);
             InvalidateFeature( SID_OBJECT_SELECT );
             break;
         case SID_SELECT_ALL_EDITS:
@@ -1176,41 +1176,41 @@ void OReportController::Execute(sal_uInt16 _nId, const 
Sequence< PropertyValue >
             getDesignView()->showRuler(m_bShowRuler = !m_bShowRuler);
             break;
         case SID_OBJECT_SELECT:
-            getDesignView()->SetMode(RPTUI_SELECT);
+            getDesignView()->SetMode(DlgEdMode::Select);
             InvalidateAll();
             break;
         case SID_INSERT_DIAGRAM:
-            getDesignView()->SetMode( RPTUI_INSERT );
+            getDesignView()->SetMode( DlgEdMode::Insert );
             getDesignView()->SetInsertObj( OBJ_OLE2);
             createDefaultControl(aArgs);
             InvalidateAll();
             break;
         case SID_FM_FIXEDTEXT:
-            getDesignView()->SetMode( RPTUI_INSERT );
+            getDesignView()->SetMode( DlgEdMode::Insert );
             getDesignView()->SetInsertObj( OBJ_DLG_FIXEDTEXT );
             createDefaultControl(aArgs);
             InvalidateAll();
             break;
         case SID_INSERT_HFIXEDLINE:
-            getDesignView()->SetMode( RPTUI_INSERT );
+            getDesignView()->SetMode( DlgEdMode::Insert );
             getDesignView()->SetInsertObj( OBJ_DLG_HFIXEDLINE );
             createDefaultControl(aArgs);
             InvalidateAll();
             break;
         case SID_INSERT_VFIXEDLINE:
-            getDesignView()->SetMode( RPTUI_INSERT );
+            getDesignView()->SetMode( DlgEdMode::Insert );
             getDesignView()->SetInsertObj( OBJ_DLG_VFIXEDLINE );
             createDefaultControl(aArgs);
             InvalidateAll();
             break;
         case SID_FM_EDIT:
-            getDesignView()->SetMode( RPTUI_INSERT );
+            getDesignView()->SetMode( DlgEdMode::Insert );
             getDesignView()->SetInsertObj( OBJ_DLG_FORMATTEDFIELD );
             createDefaultControl(aArgs);
             InvalidateAll();
             break;
         case SID_FM_IMAGECONTROL:
-            getDesignView()->SetMode( RPTUI_INSERT );
+            getDesignView()->SetMode( DlgEdMode::Insert );
             getDesignView()->SetInsertObj( OBJ_DLG_IMAGECONTROL );
             createDefaultControl(aArgs);
             InvalidateAll();
@@ -1334,7 +1334,7 @@ void OReportController::Execute(sal_uInt16 _nId, const 
Sequence< PropertyValue >
         case SID_DRAWTBX_CS_FLOWCHART:
         case SID_DRAWTBX_CS_CALLOUT:
         case SID_DRAWTBX_CS_STAR:
-            getDesignView()->SetMode( RPTUI_INSERT );
+            getDesignView()->SetMode( DlgEdMode::Insert );
             {
                 URL aUrl = getURLForId(_nId);
                 sal_Int32 nIndex = 1;
@@ -3044,7 +3044,7 @@ sal_Bool SAL_CALL OReportController::select( const Any& 
aSelection )
     if ( getDesignView() )
     {
         getDesignView()->unmarkAllObjects();
-        getDesignView()->SetMode(RPTUI_SELECT);
+        getDesignView()->SetMode(DlgEdMode::Select);
 
         uno::Sequence< uno::Reference<report::XReportComponent> > aElements;
         if ( aSelection >>= aElements )
diff --git a/reportdesign/source/ui/report/ReportSection.cxx 
b/reportdesign/source/ui/report/ReportSection.cxx
index 8f23373..684384e 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -86,7 +86,7 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const 
uno::Reference< re
     , m_pReportListener(nullptr)
     , m_xSection(_xSection)
     , m_nPaintEntranceCount(0)
-    , m_eMode(RPTUI_SELECT)
+    , m_eMode(DlgEdMode::Select)
 {
     //EnableChildTransparentMode();
     SetHelpId(HID_REPORTSECTION);
@@ -313,7 +313,7 @@ void OReportSection::SetMode( DlgEdMode eNewMode )
 {
     if ( eNewMode != m_eMode )
     {
-        if ( eNewMode == RPTUI_INSERT )
+        if ( eNewMode == DlgEdMode::Insert )
         {
             m_pFunc.reset(new DlgEdFuncInsert( this ));
         }
@@ -322,7 +322,7 @@ void OReportSection::SetMode( DlgEdMode eNewMode )
             m_pFunc.reset(new DlgEdFuncSelect( this ));
         }
         m_pFunc->setOverlappedControlColor(lcl_getOverlappedControlColor( ) );
-        m_pModel->SetReadOnly(eNewMode == RPTUI_READONLY);
+        m_pModel->SetReadOnly(false);
         m_eMode = eNewMode;
     }
 }
diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx 
b/reportdesign/source/ui/report/dlgedfunc.cxx
index 1502d62..009d686 100644
--- a/reportdesign/source/ui/report/dlgedfunc.cxx
+++ b/reportdesign/source/ui/report/dlgedfunc.cxx
@@ -170,20 +170,17 @@ bool DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt )
         if ( rMEvt.GetClicks() > 1 )
         {
             // show property browser
-            if ( m_pParent->GetMode() != RPTUI_READONLY )
-            {
-                uno::Sequence<beans::PropertyValue> aArgs(1);
-                aArgs[0].Name = "ShowProperties";
-                aArgs[0].Value <<= true;
-                
m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController().executeUnChecked(SID_SHOW_PROPERTYBROWSER,aArgs);
-                
m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView);
-                // TODO character in shapes
-                //    SdrViewEvent aVEvt;
-                // m_rView.PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, 
aVEvt);
-                //    if ( aVEvt.pRootObj && aVEvt.pRootObj->ISA(SdrTextObj) )
-                //        SetInEditMode(static_cast<SdrTextObj 
*>(aVEvt.pRootObj),rMEvt, sal_False);
-                bHandled = true;
-            }
+            uno::Sequence<beans::PropertyValue> aArgs(1);
+            aArgs[0].Name = "ShowProperties";
+            aArgs[0].Value <<= true;
+            
m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController().executeUnChecked(SID_SHOW_PROPERTYBROWSER,aArgs);
+            
m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView);
+            // TODO character in shapes
+            //    SdrViewEvent aVEvt;
+            // m_rView.PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, 
aVEvt);
+            //    if ( aVEvt.pRootObj && aVEvt.pRootObj->ISA(SdrTextObj) )
+            //        SetInEditMode(static_cast<SdrTextObj 
*>(aVEvt.pRootObj),rMEvt, sal_False);
+            bHandled = true;
         }
         else
         {
commit 4ca9e8fa3a040c18221c947a651469a89029282e
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Feb 15 14:12:03 2017 +0200

    remove unused Exist from oslCheckMode enum
    
    Change-Id: I1ad187342444c5e92b61578d2a67cce2ae5ac428

diff --git a/compilerplugins/clang/unusedenumconstants.py 
b/compilerplugins/clang/unusedenumconstants.py
index 5a71bf4..20686d0 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -163,6 +163,7 @@ for d in definitionSet:
          "vcl/inc/unx/XIM.h",
          "vcl/unx/gtk/xid_fullscreen_on_all_monitors.c",
          "vcl/unx/gtk/salnativewidgets-gtk.cxx",
+         "sc/inc/callform.hxx", # ParamType
          ]):
         continue
 
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 1cffa30..b55e49a 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -297,7 +297,6 @@ inline void deleteTestDirectory( const ::rtl::OUString& 
basename, const ::rtl::O
 /** Check for the file and directory access right.
 */
 enum class oslCheckMode {
-    Exist,
     OpenAccess,
     ReadAccess,
     WriteAccess
@@ -345,10 +344,6 @@ inline bool checkDirectory( const ::rtl::OUString & str, 
oslCheckMode nCheckMode
     if ( ( ::osl::FileBase::E_NOENT != rc ) && ( ::osl::FileBase::E_ACCES != 
rc ) ){
 
         switch ( nCheckMode ) {
-            case oslCheckMode::Exist:
-                if ( rc == ::osl::FileBase::E_None )
-                    bCheckResult = true;
-                break;
             case oslCheckMode::OpenAccess:
                 if ( rc == ::osl::FileBase::E_None )
                     bCheckResult = true;
commit 44cfdda29b3bcd0b583645238cd0211e93390c95
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Feb 15 13:47:16 2017 +0200

    remove unused HEADER from ScDBDataPortion enum
    
    Change-Id: I744a945f9aab152c8cddac2bd88567610540471c

diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 328dd2a..a5b761e 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -42,7 +42,6 @@ struct ScImportParam;
 enum class ScDBDataPortion
 {
     TOP_LEFT,   ///< top left cell of area
-    HEADER,     ///< header row of area, if headers are present
     AREA        ///< entire area
 };
 
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index aa4a74c..2b7b05a 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -487,8 +487,6 @@ bool ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB 
nTab, ScDBDataPortion
         {
             case ScDBDataPortion::TOP_LEFT:
                 return nCol == nStartCol && nRow == nStartRow;
-            case ScDBDataPortion::HEADER:
-                return HasHeader() && nRow == nStartRow && nCol >= nStartCol 
&& nCol <= nEndCol;
             case ScDBDataPortion::AREA:
                 return nCol >= nStartCol && nCol <= nEndCol && nRow >= 
nStartRow && nRow <= nEndRow;
         }
commit 9aed81ca1ed542552f82eab041208bef78abd6c8
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Feb 15 13:43:17 2017 +0200

    convert ScDetectiveDelete to scoped enum
    
    and drop unused SC_DET_ALL enumerator
    
    Change-Id: I67b729cfcf71c0e7bc406b205b56d74923617098

diff --git a/sc/inc/detfunc.hxx b/sc/inc/detfunc.hxx
index 553a611..47e8a4f 100644
--- a/sc/inc/detfunc.hxx
+++ b/sc/inc/detfunc.hxx
@@ -37,7 +37,7 @@ class ScRange;
 
 #define SC_DET_MAXCIRCLE    1000
 
-enum ScDetectiveDelete { SC_DET_ALL, SC_DET_DETECTIVE, SC_DET_CIRCLES, 
SC_DET_ARROWS };
+enum class ScDetectiveDelete { Detective, Circles, Arrows };
 
 enum ScDetectiveObjType
 {
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index a80aaf3..0186c0c 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -1243,20 +1243,17 @@ bool ScDetectiveFunc::DeleteAll( ScDetectiveDelete 
eWhat )
             if ( pObject->GetLayer() == SC_LAYER_INTERN )
             {
                 bool bDoThis = true;
-                if ( eWhat != SC_DET_ALL )
+                bool bCircle = ( dynamic_cast<const SdrCircObj*>( pObject) !=  
nullptr );
+                bool bCaption = ScDrawLayer::IsNoteCaption( pObject );
+                if ( eWhat == ScDetectiveDelete::Detective )      // 
detective, from menu
+                    bDoThis = !bCaption;                          // also 
circles
+                else if ( eWhat == ScDetectiveDelete::Circles )   // circles, 
if new created
+                    bDoThis = bCircle;
+                else if ( eWhat == ScDetectiveDelete::Arrows )    // 
DetectiveRefresh
+                    bDoThis = !bCaption && !bCircle;              // don't 
include circles
+                else
                 {
-                    bool bCircle = ( dynamic_cast<const SdrCircObj*>( pObject) 
!=  nullptr );
-                    bool bCaption = ScDrawLayer::IsNoteCaption( pObject );
-                    if ( eWhat == SC_DET_DETECTIVE )        // detektive, from 
menue
-                        bDoThis = !bCaption;                // also circles
-                    else if ( eWhat == SC_DET_CIRCLES )     // circles, if new 
created
-                        bDoThis = bCircle;
-                    else if ( eWhat == SC_DET_ARROWS )      // DetectiveRefresh
-                        bDoThis = !bCaption && !bCircle;    // don't include 
circles
-                    else
-                    {
-                        OSL_FAIL("what?");
-                    }
+                    OSL_FAIL("what?");
                 }
                 if ( bDoThis )
                     ppObj[nDelCount++] = pObject;
@@ -1286,7 +1283,7 @@ bool ScDetectiveFunc::MarkInvalid(bool& rOverflow)
     if (!pModel)
         return false;
 
-    bool bDeleted = DeleteAll( SC_DET_CIRCLES );        // just circles
+    bool bDeleted = DeleteAll( ScDetectiveDelete::Circles );        // just 
circles
 
     ScDetectiveData aData( pModel );
     long nInsCount = 0;
diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index 6c5dbe7..37111fa 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -416,7 +416,7 @@ bool ScDocFunc::DetectiveDelAll(SCTAB nTab)
 
     if (bUndo)
         pModel->BeginCalcUndo(false);
-    bool bDone = ScDetectiveFunc( &rDoc,nTab ).DeleteAll( SC_DET_DETECTIVE );
+    bool bDone = ScDetectiveFunc( &rDoc,nTab ).DeleteAll( 
ScDetectiveDelete::Detective );
     SdrUndoGroup* pUndo = nullptr;
     if (bUndo)
         pUndo = pModel->GetCalcUndo();
@@ -463,7 +463,7 @@ bool ScDocFunc::DetectiveRefresh( bool bAutomatic )
 
         SCTAB nTabCount = rDoc.GetTableCount();
         for (SCTAB nTab=0; nTab<nTabCount; nTab++)
-            ScDetectiveFunc( &rDoc,nTab ).DeleteAll( SC_DET_ARROWS );    // 
don't remove circles
+            ScDetectiveFunc( &rDoc,nTab ).DeleteAll( ScDetectiveDelete::Arrows 
);    // don't remove circles
 
         //  repeat
 
commit ce7cdf53ae1310622bd10e60f493ba7bfab2d8e2
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Feb 15 13:40:01 2017 +0200

    convert DrawPosMode to scoped enum
    
    and drop unused enumerators
    
    Change-Id: If61605d1b234664ba9264997cc3c4ec40608cc99

diff --git a/sc/inc/detfunc.hxx b/sc/inc/detfunc.hxx
index 14fb1b1..553a611 100644
--- a/sc/inc/detfunc.hxx
+++ b/sc/inc/detfunc.hxx
@@ -58,13 +58,11 @@ class SC_DLLPUBLIC ScDetectiveFunc
     ScDocument*     pDoc;
     SCTAB           nTab;
 
-    enum DrawPosMode
+    enum class DrawPosMode
     {
-        DRAWPOS_TOPLEFT,        ///< Top-left edge of the cell.
-        DRAWPOS_BOTTOMRIGHT,    ///< Bottom-right edge of the cell.
-        DRAWPOS_DETARROW,       ///< Position inside cell for detective arrows.
-        DRAWPOS_CAPTIONLEFT,    ///< Top-left edge of the cell for captions.
-        DRAWPOS_CAPTIONRIGHT    ///< Top-right edge of the cell for captions 
(incl. merged cells).
+        TopLeft,        ///< Top-left edge of the cell.
+        BottomRight,    ///< Bottom-right edge of the cell.
+        DetectiveArrow, ///< Position inside cell for detective arrows.
     };
 
     /** @return a drawing layer position for the passed cell address. */
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index bec2788..a80aaf3 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -312,30 +312,16 @@ Point ScDetectiveFunc::GetDrawPos( SCCOL nCol, SCROW 
nRow, DrawPosMode eMode ) c
 
     switch( eMode )
     {
-        case DRAWPOS_TOPLEFT:
+        case DrawPosMode::TopLeft:
         break;
-        case DRAWPOS_BOTTOMRIGHT:
+        case DrawPosMode::BottomRight:
             ++nCol;
             ++nRow;
         break;
-        case DRAWPOS_DETARROW:
+        case DrawPosMode::DetectiveArrow:
             aPos.X() += pDoc->GetColWidth( nCol, nTab ) / 4;
             aPos.Y() += pDoc->GetRowHeight( nRow, nTab ) / 2;
         break;
-        case DRAWPOS_CAPTIONLEFT:
-            aPos.X() += 6;
-        break;
-        case DRAWPOS_CAPTIONRIGHT:
-        {
-            // find right end of passed cell position
-            const ScMergeAttr* pMerge = static_cast< const ScMergeAttr* >( 
pDoc->GetAttr( nCol, nRow, nTab, ATTR_MERGE ) );
-            if ( pMerge->GetColMerge() > 1 )
-                nCol = nCol + pMerge->GetColMerge();
-            else
-                ++nCol;
-            aPos.X() -= 6;
-        }
-        break;
     }
 
     for ( SCCOL i = 0; i < nCol; ++i )
@@ -354,8 +340,8 @@ Point ScDetectiveFunc::GetDrawPos( SCCOL nCol, SCROW nRow, 
DrawPosMode eMode ) c
 Rectangle ScDetectiveFunc::GetDrawRect( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2 ) const
 {
     Rectangle aRect(
-        GetDrawPos( ::std::min( nCol1, nCol2 ), ::std::min( nRow1, nRow2 ), 
DRAWPOS_TOPLEFT ),
-        GetDrawPos( ::std::max( nCol1, nCol2 ), ::std::max( nRow1, nRow2 ), 
DRAWPOS_BOTTOMRIGHT ) );
+        GetDrawPos( ::std::min( nCol1, nCol2 ), ::std::min( nRow1, nRow2 ), 
DrawPosMode::TopLeft ),
+        GetDrawPos( ::std::max( nCol1, nCol2 ), ::std::max( nRow1, nRow2 ), 
DrawPosMode::BottomRight ) );
     aRect.Justify();    // reorder left/right in RTL sheets
     return aRect;
 }
@@ -483,8 +469,8 @@ bool ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow,
         pData->maEnd.Set( nRefEndCol, nRefEndRow, nTab);
     }
 
-    Point aStartPos = GetDrawPos( nRefStartCol, nRefStartRow, DRAWPOS_DETARROW 
);
-    Point aEndPos = GetDrawPos( nCol, nRow, DRAWPOS_DETARROW );
+    Point aStartPos = GetDrawPos( nRefStartCol, nRefStartRow, 
DrawPosMode::DetectiveArrow );
+    Point aEndPos = GetDrawPos( nCol, nRow, DrawPosMode::DetectiveArrow );
 
     if (bFromOtherTab)
     {
@@ -559,7 +545,7 @@ bool ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, 
SCROW nStartRow,
     bool bNegativePage = pDoc->IsNegativePage( nTab );
     long nPageSign = bNegativePage ? -1 : 1;
 
-    Point aStartPos = GetDrawPos( nStartCol, nStartRow, DRAWPOS_DETARROW );
+    Point aStartPos = GetDrawPos( nStartCol, nStartRow, 
DrawPosMode::DetectiveArrow );
     Point aEndPos   = Point( aStartPos.X() + 1000 * nPageSign, aStartPos.Y() - 
1000 );
     if (aEndPos.Y() < 0)
         aEndPos.Y() += 2000;
commit 2a9b0e435147929b4cd55ed9adf4d879e8b8a484
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Feb 15 13:36:47 2017 +0200

    drop ReferencedFlag enum
    
    since we never use the REFERENCED_PERMANENT enumerator, we can represent
    this as a simple bool
    
    Change-Id: I34cccad34b90834f285c44d2e44aa1cdc33276d1

diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx
index 434685c0..417ef65 100644
--- a/sc/inc/externalrefmgr.hxx
+++ b/sc/inc/externalrefmgr.hxx
@@ -134,13 +134,6 @@ public:
     {
     public:
 
-        enum ReferencedFlag
-        {
-            UNREFERENCED,
-            REFERENCED_MARKED,      // marked as referenced during store to 
file
-            REFERENCED_PERMANENT    // permanently marked, e.g. from within 
interpreter
-        };
-
         Table();
         ~Table();
 
@@ -159,9 +152,6 @@ public:
         /** Set/clear referenced status flag only if current status is not
             REFERENCED_PERMANENT. */
         void setReferenced( bool bReferenced );
-        /// Unconditionally set the reference status flag.
-        void setReferencedFlag( ReferencedFlag eFlag );
-        ReferencedFlag getReferencedFlag() const { return meReferenced;}
         bool isReferenced() const;
         /// Obtain a sorted vector of rows.
         void getAllRows(::std::vector<SCROW>& rRows, SCROW nLow = 0, SCROW 
nHigh = MAXROW) const;
@@ -195,7 +185,7 @@ public:
         /** Collection of individual cached ranges.  The table ranges are
          *  not used & always zero. */
         ScRangeList                     maCachedRanges;
-        ReferencedFlag                  meReferenced;
+        bool                            mbReferenced;
     };
 
     typedef std::shared_ptr<Table> TableTypeRef;
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index fa08f94..3ea22d2 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -245,7 +245,7 @@ void removeRangeNamesBySrcDoc(ScRangeName& rRanges, 
sal_uInt16 nFileId)
 }
 
 ScExternalRefCache::Table::Table()
-    : meReferenced( REFERENCED_MARKED )
+    : mbReferenced( true )
       // Prevent accidental data loss due to lack of knowledge.
 {
 }
@@ -258,23 +258,17 @@ void ScExternalRefCache::Table::clear()
 {
     maRows.clear();
     maCachedRanges.RemoveAll();
-    meReferenced = REFERENCED_MARKED;
-}
-
-void ScExternalRefCache::Table::setReferencedFlag( 
ScExternalRefCache::Table::ReferencedFlag eFlag )
-{
-    meReferenced = eFlag;
+    mbReferenced = true;
 }
 
 void ScExternalRefCache::Table::setReferenced( bool bReferenced )
 {
-    if (meReferenced != REFERENCED_PERMANENT)
-        meReferenced = (bReferenced ? REFERENCED_MARKED : UNREFERENCED);
+    mbReferenced = bReferenced;
 }
 
 bool ScExternalRefCache::Table::isReferenced() const
 {
-    return meReferenced != UNREFERENCED;
+    return mbReferenced;
 }
 
 void ScExternalRefCache::Table::setCell(SCCOL nCol, SCROW nRow, TokenRef const 
& pToken, sal_uLong nFmtIndex, bool bSetCacheRange)
@@ -1158,11 +1152,9 @@ bool ScExternalRefCache::setCacheTableReferenced( 
sal_uInt16 nFileId, const OUSt
                 TableTypeRef pTab = pDoc->maTables[i];
                 if (pTab.get())
                 {
-                    Table::ReferencedFlag eNewFlag = Table::REFERENCED_MARKED;
-                    Table::ReferencedFlag eOldFlag = pTab->getReferencedFlag();
-                    if (eOldFlag != Table::REFERENCED_PERMANENT && eNewFlag != 
eOldFlag)
+                    if (!pTab->isReferenced())
                     {
-                        pTab->setReferencedFlag( eNewFlag);
+                        pTab->setReferenced(true);
                         addCacheTableToReferenced( nFileId, i);
                     }
                 }
@@ -1213,17 +1205,12 @@ void 
ScExternalRefCache::setAllCacheTableReferencedStati( bool bReferenced )
                 TableTypeRef & xTab = rDocItem.maTables[i];
                 if (xTab.get())
                 {
-                    if (xTab->getReferencedFlag() == 
Table::REFERENCED_PERMANENT)
-                        addCacheTableToReferenced( nFileId, i);
-                    else
-                    {
-                        xTab->setReferencedFlag( Table::UNREFERENCED);
-                        rDocReferenced.maTables[i] = false;
-                        rDocReferenced.mbAllTablesReferenced = false;
-                        // An addCacheTableToReferenced() actually may have
-                        // resulted in mbAllReferenced been set. Clear it.
-                        maReferenced.mbAllReferenced = false;
-                    }
+                    xTab->setReferenced(false);
+                    rDocReferenced.maTables[i] = false;
+                    rDocReferenced.mbAllTablesReferenced = false;
+                    // An addCacheTableToReferenced() actually may have
+                    // resulted in mbAllReferenced been set. Clear it.
+                    maReferenced.mbAllReferenced = false;
                 }
             }
         }
commit 1b7bc018c850471a34563348c81877b6cf2d6793
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Feb 15 13:28:33 2017 +0200

    convert ScGetDBSelection to scoped enum
    
    and drop unused SC_DBSEL_SHRINK_TO_SHEET_DATA enumerator
    
    Change-Id: I083f65fba450fd0a9abebcaaae3b18c8d0b6c808

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index e7bb936..77f929f 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -394,26 +394,23 @@ enum ScGetDBMode
 };
 
 /// For ScDBFunc::GetDBData()
-enum ScGetDBSelection
+enum class ScGetDBSelection
 {
     /** Keep selection as is, expand to used data area if no selection. */
-    SC_DBSEL_KEEP,
-
-    /** Shrink selection to sheet's data area. */
-    SC_DBSEL_SHRINK_TO_SHEET_DATA,
+    Keep,
 
     /** Shrink selection to actually used data area within the selection. */
-    SC_DBSEL_SHRINK_TO_USED_DATA,
+    ShrinkToUsedData,
 
     /** If only one row or portion thereof is selected, shrink row to used data
         columns and select further rows down until end of data. If an area is
         selected, shrink rows to actually used columns. Else, no selection,
         expand to used data area. */
-    SC_DBSEL_ROW_DOWN,
+    RowDown,
 
     /** Behave as if the range corresponding to a ScDBData area was selected,
         for API use. */
-    SC_DBSEL_FORCE_MARK
+    ForceMark
 };
 
 enum ScLkUpdMode    // modes for updating links
diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index a069024..86680d8 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -890,7 +890,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& 
rQueryParam,
             pNewData = rDocShell.GetDBData(
                             ScRange( aLocalParam.nCol1, aLocalParam.nRow1, 
nDestTab,
                                      aLocalParam.nCol2, aLocalParam.nRow2, 
nDestTab ),
-                            SC_DB_MAKE, SC_DBSEL_FORCE_MARK );
+                            SC_DB_MAKE, ScGetDBSelection::ForceMark );
 
         if (pNewData)
         {
diff --git a/sc/source/ui/docshell/dbdocimp.cxx 
b/sc/source/ui/docshell/dbdocimp.cxx
index f752045..11e7cc0 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -107,7 +107,7 @@ bool ScDBDocFunc::DoImportUno( const ScAddress& rPos,
     svx::ODataAccessDescriptor aDesc( aArgs );      // includes selection and 
result set
 
     //  create database range
-    ScDBData* pDBData = rDocShell.GetDBData( ScRange(rPos), SC_DB_IMPORT, 
SC_DBSEL_KEEP );
+    ScDBData* pDBData = rDocShell.GetDBData( ScRange(rPos), SC_DB_IMPORT, 
ScGetDBSelection::Keep );
     DBG_ASSERT(pDBData, "can't create DB data");
     OUString sTarget = pDBData->GetName();
 
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 207b37b..77eccb6 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -208,7 +208,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
                                 GetUndoManager()->EnterListAction( aStrImport, 
aStrImport, 0, nViewShellId );
                             }
 
-                            ScDBData* pDBData = GetDBData( ScRange(aPos), 
SC_DB_IMPORT, SC_DBSEL_KEEP );
+                            ScDBData* pDBData = GetDBData( ScRange(aPos), 
SC_DB_IMPORT, ScGetDBSelection::Keep );
                             OSL_ENSURE(pDBData, "kann DB-Daten nicht anlegen");
                             sTarget = pDBData->GetName();
                         }
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 9322a38..66d7cc5 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -124,9 +124,9 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, 
ScGetDBMode eMode, ScGe
     if (!pData)
         pData = pColl->GetDBNearCursor(nCol, nRow, nTab );
 
-    bool bSelected = ( eSel == SC_DBSEL_FORCE_MARK ||
-            (rMarked.aStart != rMarked.aEnd && eSel != SC_DBSEL_ROW_DOWN) );
-    bool bOnlyDown = (!bSelected && eSel == SC_DBSEL_ROW_DOWN && 
rMarked.aStart.Row() == rMarked.aEnd.Row());
+    bool bSelected = ( eSel == ScGetDBSelection::ForceMark ||
+            (rMarked.aStart != rMarked.aEnd && eSel != 
ScGetDBSelection::RowDown) );
+    bool bOnlyDown = (!bSelected && eSel == ScGetDBSelection::RowDown && 
rMarked.aStart.Row() == rMarked.aEnd.Row());
 
     bool bUseThis = false;
     if (pData)
diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx
index e407580..0a65374 100644
--- a/sc/source/ui/inc/dbfunc.hxx
+++ b/sc/source/ui/inc/dbfunc.hxx
@@ -66,7 +66,7 @@ public:
     void GotoDBArea( const OUString& rDBName );
 
                     // DB range from Cursor
-    ScDBData*       GetDBData( bool bMarkArea = true, ScGetDBMode eMode = 
SC_DB_MAKE, ScGetDBSelection eSel = SC_DBSEL_KEEP);
+    ScDBData*       GetDBData( bool bMarkArea = true, ScGetDBMode eMode = 
SC_DB_MAKE, ScGetDBSelection eSel = ScGetDBSelection::Keep);
     ScDBData*       GetAnonymousDBData();
 
     void            Consolidate( const ScConsolidateParam& rParam );
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 1f18651..0c25562 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -5448,7 +5448,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL 
ScCellRangeObj::createSortDescripto
     if ( pDocSh )
     {
         // DB-Bereich anlegen erst beim Ausfuehren, per API immer genau den 
Bereich
-        ScDBData* pData = pDocSh->GetDBData( aRange, SC_DB_OLD, 
SC_DBSEL_FORCE_MARK );
+        ScDBData* pData = pDocSh->GetDBData( aRange, SC_DB_OLD, 
ScGetDBSelection::ForceMark );
         if (pData)
         {
             pData->GetSortParam(aParam);
@@ -5478,7 +5478,7 @@ void SAL_CALL ScCellRangeObj::sort( const 
uno::Sequence<beans::PropertyValue>& a
     {
         sal_uInt16 i;
         ScSortParam aParam;
-        ScDBData* pData = pDocSh->GetDBData( aRange, SC_DB_MAKE, 
SC_DBSEL_FORCE_MARK ); // ggf. Bereich anlegen
+        ScDBData* pData = pDocSh->GetDBData( aRange, SC_DB_MAKE, 
ScGetDBSelection::ForceMark ); // ggf. Bereich anlegen
         if (pData)
         {
             //  alten Einstellungen holen, falls nicht alles neu gesetzt wird
@@ -5515,7 +5515,7 @@ void SAL_CALL ScCellRangeObj::sort( const 
uno::Sequence<beans::PropertyValue>& a
         aParam.nCol2 = aRange.aEnd.Col();
         aParam.nRow2 = aRange.aEnd.Row();
 
-        pDocSh->GetDBData( aRange, SC_DB_MAKE, SC_DBSEL_FORCE_MARK );       // 
ggf. Bereich anlegen
+        pDocSh->GetDBData( aRange, SC_DB_MAKE, ScGetDBSelection::ForceMark );  
     // ggf. Bereich anlegen
 
         ScDBDocFunc aFunc(*pDocSh); // Bereich muss angelegt sein
         (void)aFunc.Sort( nTab, aParam, true, true, true );
@@ -5533,7 +5533,7 @@ uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL 
ScCellRangeObj::createFil
     if ( !bEmpty && pDocSh )
     {
         // DB-Bereich anlegen erst beim Ausfuehren, per API immer genau den 
Bereich
-        ScDBData* pData = pDocSh->GetDBData( aRange, SC_DB_OLD, 
SC_DBSEL_FORCE_MARK );
+        ScDBData* pData = pDocSh->GetDBData( aRange, SC_DB_OLD, 
ScGetDBSelection::ForceMark );
         if (pData)
         {
             ScQueryParam aParam;
@@ -5619,7 +5619,7 @@ void SAL_CALL ScCellRangeObj::filter( const 
uno::Reference<sheet::XSheetFilterDe
         aParam.nCol2 = aRange.aEnd.Col();
         aParam.nRow2 = aRange.aEnd.Row();
 
-        pDocSh->GetDBData( aRange, SC_DB_MAKE, SC_DBSEL_FORCE_MARK );   // 
ggf. Bereich anlegen
+        pDocSh->GetDBData( aRange, SC_DB_MAKE, ScGetDBSelection::ForceMark );  
 // ggf. Bereich anlegen
 
         //! keep source range in filter descriptor
         //! if created by createFilterDescriptorByObject ???
@@ -5700,7 +5700,7 @@ uno::Reference<sheet::XSubTotalDescriptor> SAL_CALL 
ScCellRangeObj::createSubTot
     if ( !bEmpty && pDocSh )
     {
         // DB-Bereich anlegen erst beim Ausfuehren, per API immer genau den 
Bereich
-        ScDBData* pData = pDocSh->GetDBData( aRange, SC_DB_OLD, 
SC_DBSEL_FORCE_MARK );
+        ScDBData* pData = pDocSh->GetDBData( aRange, SC_DB_OLD, 
ScGetDBSelection::ForceMark );
         if (pData)
         {
             ScSubTotalParam aParam;
@@ -5763,7 +5763,7 @@ void SAL_CALL ScCellRangeObj::applySubTotals(
         aParam.nCol2 = aRange.aEnd.Col();
         aParam.nRow2 = aRange.aEnd.Row();
 
-        pDocSh->GetDBData( aRange, SC_DB_MAKE, SC_DBSEL_FORCE_MARK );   // 
ggf. Bereich anlegen
+        pDocSh->GetDBData( aRange, SC_DB_MAKE, ScGetDBSelection::ForceMark );  
 // ggf. Bereich anlegen
 
         ScDBDocFunc aFunc(*pDocSh);
         aFunc.DoSubTotals( nTab, aParam, true, true );    // Bereich muss 
angelegt sein
@@ -5778,7 +5778,7 @@ void SAL_CALL ScCellRangeObj::removeSubTotals()
     if (pDocSh)
     {
         ScSubTotalParam aParam;
-        ScDBData* pData = pDocSh->GetDBData( aRange, SC_DB_OLD, 
SC_DBSEL_FORCE_MARK );
+        ScDBData* pData = pDocSh->GetDBData( aRange, SC_DB_OLD, 
ScGetDBSelection::ForceMark );
         if (pData)
             pData->GetSubTotalParam(aParam);    // auch bei Remove die 
Feld-Eintraege behalten
 
@@ -5790,7 +5790,7 @@ void SAL_CALL ScCellRangeObj::removeSubTotals()
         aParam.nCol2 = aRange.aEnd.Col();
         aParam.nRow2 = aRange.aEnd.Row();
 
-        pDocSh->GetDBData( aRange, SC_DB_MAKE, SC_DBSEL_FORCE_MARK );   // 
ggf. Bereich anlegen
+        pDocSh->GetDBData( aRange, SC_DB_MAKE, ScGetDBSelection::ForceMark );  
 // ggf. Bereich anlegen
 
         ScDBDocFunc aFunc(*pDocSh);
         aFunc.DoSubTotals( nTab, aParam, true, true );    // Bereich muss 
angelegt sein
@@ -5805,7 +5805,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL 
ScCellRangeObj::createImportDescrip
     if ( !bEmpty && pDocSh )
     {
         // DB-Bereich anlegen erst beim Ausfuehren, per API immer genau den 
Bereich
-        ScDBData* pData = pDocSh->GetDBData( aRange, SC_DB_OLD, 
SC_DBSEL_FORCE_MARK );
+        ScDBData* pData = pDocSh->GetDBData( aRange, SC_DB_OLD, 
ScGetDBSelection::ForceMark );
         if (pData)
             pData->GetImportParam(aParam);
     }
@@ -5832,7 +5832,7 @@ void SAL_CALL ScCellRangeObj::doImport( const 
uno::Sequence<beans::PropertyValue
 
         //! TODO: could we get passed a valid result set by any means?
 
-        pDocSh->GetDBData( aRange, SC_DB_MAKE, SC_DBSEL_FORCE_MARK );       // 
ggf. Bereich anlegen
+        pDocSh->GetDBData( aRange, SC_DB_MAKE, ScGetDBSelection::ForceMark );  
     // ggf. Bereich anlegen
 
         ScDBDocFunc aFunc(*pDocSh);                         // Bereich muss 
angelegt sein
         aFunc.DoImport( nTab, aParam, nullptr );         //! Api-Flag as 
parameter
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index 35c52e6..860268a 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -85,7 +85,7 @@ ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode eMode, 
ScGetDBSelection e
     if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED )
     {
         bool bShrinkColumnsOnly = false;
-        if (eSel == SC_DBSEL_ROW_DOWN)
+        if (eSel == ScGetDBSelection::RowDown)
         {
             // Don't alter row range, additional rows may have been selected on
             // purpose to append data, or to have a fake header row.
@@ -96,7 +96,7 @@ ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode eMode, 
ScGetDBSelection e
             {
                 // If an area is selected shrink that to the actual used
                 // columns, don't draw filter buttons for empty columns.
-                eSel = SC_DBSEL_SHRINK_TO_USED_DATA;
+                eSel = ScGetDBSelection::ShrinkToUsedData;
             }
             else if (aRange.aStart.Col() == aRange.aEnd.Col())
             {
@@ -104,28 +104,13 @@ ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode 
eMode, ScGetDBSelection e
                 // area.
                 const ScMarkData& rMarkData = GetViewData().GetMarkData();
                 if (!(rMarkData.IsMarked() || rMarkData.IsMultiMarked()))
-                    eSel = SC_DBSEL_KEEP;
+                    eSel = ScGetDBSelection::Keep;
             }
         }
         switch (eSel)
         {
-            case SC_DBSEL_SHRINK_TO_SHEET_DATA:
-                {
-                    // Shrink the selection to sheet data area.
-                    ScDocument& rDoc = pDocSh->GetDocument();
-                    SCCOL nCol1 = aRange.aStart.Col(), nCol2 = 
aRange.aEnd.Col();
-                    SCROW nRow1 = aRange.aStart.Row(), nRow2 = 
aRange.aEnd.Row();
-                    if (rDoc.ShrinkToDataArea( aRange.aStart.Tab(), nCol1, 
nRow1, nCol2, nRow2))
-                    {
-                        aRange.aStart.SetCol(nCol1);
-                        aRange.aEnd.SetCol(nCol2);
-                        aRange.aStart.SetRow(nRow1);
-                        aRange.aEnd.SetRow(nRow2);
-                    }
-                }
-                break;
-            case SC_DBSEL_SHRINK_TO_USED_DATA:
-            case SC_DBSEL_ROW_DOWN:
+            case ScGetDBSelection::ShrinkToUsedData:
+            case ScGetDBSelection::RowDown:
                 {
                     // Shrink the selection to actual used area.
                     ScDocument& rDoc = pDocSh->GetDocument();
@@ -152,7 +137,7 @@ ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode 
eMode, ScGetDBSelection e
         pData = pDocSh->GetDBData(
                     ScRange( GetViewData().GetCurX(), GetViewData().GetCurY(),
                              GetViewData().GetTabNo() ),
-                    eMode, SC_DBSEL_KEEP );
+                    eMode, ScGetDBSelection::Keep );
 
     if (!pData)
         return nullptr;
@@ -288,7 +273,7 @@ void ScDBFunc::ToggleAutoFilter()
 
     ScQueryParam    aParam;
     ScDocument*     pDoc    = GetViewData().GetDocument();
-    ScDBData*       pDBData = GetDBData(false, SC_DB_AUTOFILTER, 
SC_DBSEL_ROW_DOWN);
+    ScDBData*       pDBData = GetDBData(false, SC_DB_AUTOFILTER, 
ScGetDBSelection::RowDown);
 
     pDBData->SetByRow( true );              //! undo, retrieve beforehand ??
     pDBData->GetQueryParam( aParam );
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 0c478f4..b3f4c1a 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -254,7 +254,7 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
                                      SCITEM_QUERYDATA,
                                      SCITEM_QUERYDATA );
 
-            ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, 
SC_DBSEL_ROW_DOWN);
+            ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, 
ScGetDBSelection::RowDown);
             pDBData->ExtendDataArea(pDoc);
             pDBData->GetQueryParam( aQueryParam );
 
@@ -284,7 +284,7 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
                                      SCITEM_QUERYDATA,
                                      SCITEM_QUERYDATA );
 
-            ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, 
SC_DBSEL_ROW_DOWN);
+            ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, 
ScGetDBSelection::RowDown);
             pDBData->ExtendDataArea(pDoc);
             pDBData->GetQueryParam( aQueryParam );
 
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index ac66ce8..6034d89 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -390,7 +390,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId 
nFormatId,
             //  Creation of database area "Import1" isn't here, but in the 
DocShell
             //  slot execute, so it can be added to the undo action
 
-            ScDBData* pDBData = pDocSh->GetDBData( ScRange(nPosX,nPosY,nTab), 
SC_DB_OLD, SC_DBSEL_KEEP );
+            ScDBData* pDBData = pDocSh->GetDBData( ScRange(nPosX,nPosY,nTab), 
SC_DB_OLD, ScGetDBSelection::Keep );
             OUString sTarget;
             if (pDBData)
                 sTarget = pDBData->GetName();
commit f5d15f418fa1be0f73fbb4eef1bf7fa06a43c969
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Feb 15 13:03:33 2017 +0200

    convert ListenerGroupType to scoped enum
    
    Change-Id: If561c82e9535d5ee5898966e5a2b3d7e2754d145

diff --git a/sc/inc/types.hxx b/sc/inc/types.hxx
index 1398393..4777c00 100644
--- a/sc/inc/types.hxx
+++ b/sc/inc/types.hxx
@@ -106,11 +106,11 @@ enum AreaOverlapType
     OneColumnInsideArea
 };
 
-enum ListenerGroupType
+enum class ListenerGroupType
 {
-    ListenerSingle,
-    ListenerGroup,
-    ListenerBoth
+    Single,
+    Group,
+    Both
 };
 
 enum StartListeningType
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index b47940e..12ad933 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -528,15 +528,15 @@ void ScBroadcastAreaSlot::GetAllListeners(
         const ScRange& rAreaRange = pArea->GetRange();
         switch (eGroup)
         {
-            case sc::ListenerSingle:
+            case sc::ListenerGroupType::Single:
                 if (pArea->IsGroupListening())
                     continue;
             break;
-            case sc::ListenerGroup:
+            case sc::ListenerGroupType::Group:
                 if (!pArea->IsGroupListening())
                     continue;
             break;
-            case sc::ListenerBoth:
+            case sc::ListenerGroupType::Both:
             default:
                 ;
         }
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index e5f0739..cc6477b 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1207,7 +1207,7 @@ void ScTable::SortReorderByRowRefUpdate(
         ScBroadcastAreaSlotMachine* pBASM = pDocument->GetBASM();
         std::vector<sc::AreaListener> aGrpListeners =
             pBASM->GetAllListeners(
-                aMoveRange, sc::AreaInsideOrOverlap, sc::ListenerGroup);
+                aMoveRange, sc::AreaInsideOrOverlap, 
sc::ListenerGroupType::Group);
 
         {
             std::vector<sc::AreaListener>::iterator it = 
aGrpListeners.begin(), itEnd = aGrpListeners.end();
diff --git a/sc/source/core/inc/bcaslot.hxx b/sc/source/core/inc/bcaslot.hxx
index fd91de8..654edc0 100644
--- a/sc/source/core/inc/bcaslot.hxx
+++ b/sc/source/core/inc/bcaslot.hxx
@@ -340,7 +340,7 @@ public:
 
     std::vector<sc::AreaListener> GetAllListeners(
         const ScRange& rRange, sc::AreaOverlapType eType,
-        sc::ListenerGroupType eGroup = sc::ListenerBoth );
+        sc::ListenerGroupType eGroup = sc::ListenerGroupType::Both );
 
 #if DEBUG_AREA_BROADCASTER
     void Dump() const;
commit a676bb5701f2c9d4526203b5fe8a1838da984373
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Feb 15 12:43:08 2017 +0200

    convert ScPasteFlags to o3tl::typed_flags
    
    Change-Id: I6619c034680a4bab6a19bd4c92504fb34570ac6f

diff --git a/sc/inc/viewdata.hxx b/sc/inc/viewdata.hxx
index 6a8eb4c..1e765ec 100644
--- a/sc/inc/viewdata.hxx
+++ b/sc/inc/viewdata.hxx
@@ -78,12 +78,15 @@ enum ScMarkType
 #endif
 };
 
-enum ScPasteFlags
+enum class ScPasteFlags
 {
-    SC_PASTE_NONE   = 0,    // No flags specified
-    SC_PASTE_MODE   = 1,    // Enable paste-mode
-    SC_PASTE_BORDER = 2,    // Show a border around the source cells
+    NONE   = 0,    // No flags specified
+    Mode   = 1,    // Enable paste-mode
+    Border = 2,    // Show a border around the source cells
 };
+namespace o3tl {
+    template<> struct typed_flags<ScPasteFlags> : is_typed_flags<ScPasteFlags, 
0x03> {};
+}
 
 // for internal Drag&Drop:
 enum class ScDragSrc{
@@ -307,8 +310,8 @@ public:
     SCROW           GetMaxTiledRow() const                  { return 
pThisTab->nMaxTiledRow; }
 
     bool            IsPagebreakMode() const                 { return 
bPagebreak; }
-    bool            IsPasteMode() const                     { return 
(nPasteFlags & SC_PASTE_MODE) != 0; }
-    bool            ShowPasteSource() const                 { return 
(nPasteFlags & SC_PASTE_BORDER) != 0; }
+    bool            IsPasteMode() const                     { return 
bool(nPasteFlags & ScPasteFlags::Mode); }
+    bool            ShowPasteSource() const                 { return 
bool(nPasteFlags & ScPasteFlags::Border); }
 
     void            SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX );
     void            SetPosY( ScVSplitPos eWhich, SCROW nNewPosY );
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 7d6e6ed..3ae6c6f 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2260,7 +2260,7 @@ IMPL_LINK_NOARG(ScInputHandler, ModifyHdl, 
LinkParamNone*, void)
 bool ScInputHandler::DataChanging( sal_Unicode cTyped, bool bFromCommand )
 {
     if (pActiveViewSh)
-        pActiveViewSh->GetViewData().SetPasteMode( SC_PASTE_NONE );
+        pActiveViewSh->GetViewData().SetPasteMode( ScPasteFlags::NONE );
     bInOwnChange = true; // disable ModifyHdl (reset in DataChanged)
 
     if ( eMode == SC_INPUT_NONE )
@@ -2498,7 +2498,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode, const 
OUString* pInitText )
 
     if (eNewMode != SC_INPUT_NONE && pActiveViewSh)
         // Disable paste mode when edit mode starts.
-        pActiveViewSh->GetViewData().SetPasteMode( SC_PASTE_NONE );
+        pActiveViewSh->GetViewData().SetPasteMode( ScPasteFlags::NONE );
 
     bInOwnChange = true; // disable ModifyHdl (reset below)
 
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index 474871b..fc9095a 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -677,7 +677,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* 
pMousePixel,
                     //  Toggle out of paste mode if we are in it, otherwise
                     //  pressing return in this object will instead go to the
                     //  sheet and be considered an overwrite-cell instruction
-                    pViewShell->GetViewData().SetPasteMode(SC_PASTE_NONE);
+                    pViewShell->GetViewData().SetPasteMode(ScPasteFlags::NONE);
                     pViewShell->UpdateCopySourceOverlay();
 
                     //  EditEngine-UndoManager anmelden
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 00f51e1..861effc 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1269,7 +1269,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 WaitObject aWait( GetViewData()->GetDialogParent() );
                 pTabViewShell->CopyToClip( nullptr, false, false, true );
                 rReq.Done();
-                GetViewData()->SetPasteMode( (ScPasteFlags) (SC_PASTE_MODE | 
SC_PASTE_BORDER) );
+                GetViewData()->SetPasteMode( ScPasteFlags::Mode | 
ScPasteFlags::Border );
                 pTabViewShell->ShowCursor();
                 pTabViewShell->UpdateCopySourceOverlay();
             }
@@ -1280,7 +1280,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 WaitObject aWait( GetViewData()->GetDialogParent() );
                 pTabViewShell->CutToClip();
                 rReq.Done();
-                GetViewData()->SetPasteMode( (ScPasteFlags)(SC_PASTE_MODE | 
SC_PASTE_BORDER));
+                GetViewData()->SetPasteMode( ScPasteFlags::Mode | 
ScPasteFlags::Border );
                 pTabViewShell->ShowCursor();
                 pTabViewShell->UpdateCopySourceOverlay();
             }
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index e4c3b6b..aedbf73 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3299,7 +3299,7 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt)
         }
 
         // hide the border around the copy source
-        pViewData->SetPasteMode( SC_PASTE_NONE );
+        pViewData->SetPasteMode( ScPasteFlags::NONE );
         // Clear CopySourceOverlay in each window of a split/frozen tabview
         pViewData->GetView()->UpdateCopySourceOverlay();
         return;
@@ -3309,7 +3309,7 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt)
     {
         if (rKeyCode.GetCode() == KEY_ESCAPE)
         {
-            pViewData->SetPasteMode( SC_PASTE_NONE );
+            pViewData->SetPasteMode( ScPasteFlags::NONE );
             // Clear CopySourceOverlay in each window of a split/frozen tabview
             pViewData->GetView()->UpdateCopySourceOverlay();
         }
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index a608f67..e875f10 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -346,7 +346,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* 
pViewSh ) :
         nFillStartY(0),
         nFillEndX(0),
         nFillEndY(0),
-        nPasteFlags ( SC_PASTE_NONE ),
+        nPasteFlags ( ScPasteFlags::NONE ),
         eEditActivePart( SC_SPLIT_BOTTOMLEFT ),
         nFillMode   ( ScFillMode::NONE ),
         eEditAdjust ( SVX_ADJUST_LEFT ),
@@ -438,7 +438,7 @@ ScViewData::ScViewData( const ScViewData& rViewData ) :
         nFillStartY(0),
         nFillEndX(0),
         nFillEndY(0),
-        nPasteFlags ( SC_PASTE_NONE ),
+        nPasteFlags ( ScPasteFlags::NONE ),
         eEditActivePart( rViewData.eEditActivePart ),
         nFillMode   ( ScFillMode::NONE ),
         eEditAdjust ( rViewData.eEditAdjust ),
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index fbc2203..bc8469b 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1739,7 +1739,7 @@ void ScViewFunc::DeleteMulti( bool bRows )
 void ScViewFunc::DeleteContents( InsertDeleteFlags nFlags )
 {
     ScViewData& rViewData = GetViewData();
-    rViewData.SetPasteMode( SC_PASTE_NONE );
+    rViewData.SetPasteMode( ScPasteFlags::NONE );
     rViewData.GetViewShell()->UpdateCopySourceOverlay();
 
     // not editable because of matrix only? attribute OK nonetheless
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to