[Libreoffice-commits] core.git: 5 commits - avmedia/source canvas/source cui/source include/svtools include/vcl reportdesign/source sc/source sd/source sfx2/source slideshow/source svtools/source svx/source sw/source toolkit/source vcl/inc vcl/source

Noel Grandin noel at peralex.com
Thu May 28 03:48:15 PDT 2015


 avmedia/source/framework/mediacontrol.cxx            |    2 
 canvas/source/directx/dx_9rm.cxx                     |    2 
 cui/source/dialogs/iconcdlg.cxx                      |    4 
 cui/source/options/optcolor.cxx                      |    2 
 include/svtools/editbrowsebox.hxx                    |    2 
 include/vcl/button.hxx                               |    2 
 include/vcl/window.hxx                               |  107 +++++++++++++------
 reportdesign/source/ui/report/EndMarker.cxx          |    2 
 reportdesign/source/ui/report/ReportSection.cxx      |    2 
 reportdesign/source/ui/report/SectionWindow.cxx      |    2 
 reportdesign/source/ui/report/StartMarker.cxx        |    2 
 sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx       |    2 
 sc/source/ui/dbgui/csvgrid.cxx                       |    2 
 sc/source/ui/dbgui/csvruler.cxx                      |    2 
 sc/source/ui/view/preview.cxx                        |    4 
 sd/source/ui/presenter/PresenterHelper.cxx           |    4 
 sfx2/source/dialog/backingwindow.cxx                 |    6 -
 slideshow/source/engine/shapes/viewmediashape.cxx    |    2 
 svtools/source/brwbox/editbrowsebox.cxx              |   10 -
 svtools/source/brwbox/editbrowsebox2.cxx             |    8 -
 svtools/source/contnr/imivctl1.cxx                   |   12 +-
 svtools/source/control/calendar.cxx                  |    2 
 svtools/source/control/valueset.cxx                  |    2 
 svx/source/accessibility/AccessibleFrameSelector.cxx |   16 +-
 svx/source/fmcomp/gridcell.cxx                       |    2 
 sw/source/ui/dbui/createaddresslistdialog.cxx        |    2 
 sw/source/ui/dbui/mmaddressblockpage.cxx             |    2 
 sw/source/ui/index/cnttab.cxx                        |    2 
 toolkit/source/awt/vclxtoolkit.cxx                   |    3 
 toolkit/source/awt/vclxwindow.cxx                    |    4 
 vcl/inc/svdata.hxx                                   |    4 
 vcl/inc/window.h                                     |    6 -
 vcl/source/app/help.cxx                              |    2 
 vcl/source/control/button.cxx                        |   22 +--
 vcl/source/control/edit.cxx                          |    4 
 vcl/source/control/fixed.cxx                         |   16 +-
 vcl/source/control/group.cxx                         |    4 
 vcl/source/control/ilstbox.cxx                       |    4 
 vcl/source/control/prgsbar.cxx                       |    2 
 vcl/source/control/scrbar.cxx                        |   12 +-
 vcl/source/control/slider.cxx                        |   13 +-
 vcl/source/control/tabctrl.cxx                       |    6 -
 vcl/source/opengl/OpenGLContext.cxx                  |    6 -
 vcl/source/window/clipping.cxx                       |   16 +-
 vcl/source/window/cursor.cxx                         |    6 -
 vcl/source/window/dialog.cxx                         |    2 
 vcl/source/window/dlgctrl.cxx                        |   46 ++++----
 vcl/source/window/dockmgr.cxx                        |    4 
 vcl/source/window/dockwin.cxx                        |    2 
 vcl/source/window/menubarwindow.cxx                  |    6 -
 vcl/source/window/mouse.cxx                          |   10 -
 vcl/source/window/paint.cxx                          |    2 
 vcl/source/window/scrwnd.cxx                         |   18 +--
 vcl/source/window/stacking.cxx                       |    2 
 vcl/source/window/syschild.cxx                       |    2 
 vcl/source/window/tabpage.cxx                        |    4 
 vcl/source/window/taskpanelist.cxx                   |    6 -
 vcl/source/window/toolbox.cxx                        |   28 ++--
 vcl/source/window/window.cxx                         |    8 -
 vcl/source/window/window2.cxx                        |   36 +++---
 vcl/source/window/winproc.cxx                        |    8 -
 61 files changed, 282 insertions(+), 241 deletions(-)

New commits:
commit f3331f7694e74f349375c223ce7ed84838e92d89
Author: Noel Grandin <noel at peralex.com>
Date:   Wed May 27 16:09:43 2015 +0200

    convert PARENTCLIPMODE constants to scoped enum
    
    Change-Id: I36a53112e75fca9208b2f91e224a7c671695509b

diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index 4c019e5..4a33e59 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -79,7 +79,7 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
 
     SetBackground();
     SetPaintTransparent( true );
-    SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+    SetParentClipMode( ParentClipMode::NoClip );
 
     if( MEDIACONTROLSTYLE_SINGLELINE != meControlStyle )
     {
diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx
index ba03c53..6d4157b 100644
--- a/canvas/source/directx/dx_9rm.cxx
+++ b/canvas/source/directx/dx_9rm.cxx
@@ -673,7 +673,7 @@ namespace dxcanvas
             mpWindow->SetMouseTransparent( TRUE );
 
             // parent should receive paint messages as well
-            // [PARENTCLIPMODE_NOCLIP], the argument is here
+            // [ParentClipMode::NoClip], the argument is here
             // passed as plain numeric value since the stupid
             // define utilizes a USHORT cast.
             mpWindow->SetParentClipMode(0x0002);
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 0b77226..686734d 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -98,14 +98,14 @@ void IconChoicePage::ImplInitSettings()
     if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
     {
         EnableChildTransparentMode( true );
-        SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+        SetParentClipMode( ParentClipMode::NoClip );
         SetPaintTransparent( true );
         SetBackground();
     }
     else
     {
         EnableChildTransparentMode( false );
-        SetParentClipMode( 0 );
+        SetParentClipMode( ParentClipMode::NONE );
         SetPaintTransparent( false );
 
         if ( IsControlBackground() )
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 9654d34..9f9f73d 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -269,8 +269,16 @@ namespace o3tl
 }
 
 // Flags for ParentClipMode
-#define PARENTCLIPMODE_CLIP             ((sal_uInt16)0x0001)
-#define PARENTCLIPMODE_NOCLIP           ((sal_uInt16)0x0002)
+enum class ParentClipMode
+{
+    NONE             = 0x0000,
+    Clip             = 0x0001,
+    NoClip           = 0x0002,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<ParentClipMode> : is_typed_flags<ParentClipMode, 0x0003> {};
+}
 
 // Flags for Invert()
 enum class InvertFlags
@@ -1001,8 +1009,8 @@ public:
     bool IsControlBackground() const;
     void ApplyControlBackground(vcl::RenderContext& rRenderContext, const Color& rDefaultColor);
 
-    void                                SetParentClipMode( sal_uInt16 nMode = 0 );
-    sal_uInt16                          GetParentClipMode() const;
+    void                                SetParentClipMode( ParentClipMode nMode = ParentClipMode::NONE );
+    ParentClipMode                      GetParentClipMode() const;
 
     void                                SetWindowRegionPixel();
     void                                SetWindowRegionPixel( const vcl::Region& rRegion );
diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx
index a1ebc7a..d6137e3 100644
--- a/reportdesign/source/ui/report/EndMarker.cxx
+++ b/reportdesign/source/ui/report/EndMarker.cxx
@@ -80,7 +80,7 @@ void OEndMarker::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rR
 void OEndMarker::ImplInitSettings()
 {
     EnableChildTransparentMode( true );
-    SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+    SetParentClipMode( ParentClipMode::NoClip );
     SetPaintTransparent( true );
 
     SetBackground( Wallpaper( svtools::ColorConfig().GetColorValue(::svtools::APPBACKGROUND).nColor)  );
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index c6b9204..81850df 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -92,7 +92,7 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re
     //EnableChildTransparentMode();
     SetHelpId(HID_REPORTSECTION);
     SetMapMode(MapMode(MAP_100TH_MM));
-    SetParentClipMode(PARENTCLIPMODE_CLIP);
+    SetParentClipMode(ParentClipMode::Clip);
     EnableChildTransparentMode( false );
     SetPaintTransparent( false );
 
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx
index 9d7b08d..a495fe1 100644
--- a/reportdesign/source/ui/report/SectionWindow.cxx
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -208,7 +208,7 @@ void OSectionWindow::ImplInitSettings()
     if ( t )
     {
     EnableChildTransparentMode( true );
-    SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+    SetParentClipMode( ParentClipMode::NoClip );
     SetPaintTransparent( true );
     }
     SetBackground( );
diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx
index 01f2fdb..1409feb 100644
--- a/reportdesign/source/ui/report/StartMarker.cxx
+++ b/reportdesign/source/ui/report/StartMarker.cxx
@@ -74,7 +74,7 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry
     const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
     m_aVRuler->SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH);
     EnableChildTransparentMode( true );
-    SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+    SetParentClipMode( ParentClipMode::NoClip );
     SetPaintTransparent( true );
 }
 
diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx
index 3de26d6..390ea2b 100644
--- a/sd/source/ui/presenter/PresenterHelper.cxx
+++ b/sd/source/ui/presenter/PresenterHelper.cxx
@@ -101,12 +101,12 @@ Reference<awt::XWindow> SAL_CALL PresenterHelper::createWindow (
     pWindow->SetBackground();
     if ( ! bEnableParentClip)
     {
-        pWindow->SetParentClipMode(PARENTCLIPMODE_NOCLIP);
+        pWindow->SetParentClipMode(ParentClipMode::NoClip);
         pWindow->SetPaintTransparent(true);
     }
     else
     {
-        pWindow->SetParentClipMode(PARENTCLIPMODE_CLIP);
+        pWindow->SetParentClipMode(ParentClipMode::Clip);
         pWindow->SetPaintTransparent(false);
     }
 
diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx
index f026b21..6e481d3 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -489,7 +489,7 @@ namespace slideshow
                                                            Size( aAWTRect.Width, aAWTRect.Height ) );
                             }
                             mpMediaWindow->SetBackground( Color( COL_BLACK ) );
-                            mpMediaWindow->SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+                            mpMediaWindow->SetParentClipMode( ParentClipMode::NoClip );
                             mpMediaWindow->EnableEraseBackground( false );
                             mpMediaWindow->EnablePaint( false );
                             mpMediaWindow->SetForwardKey( true );
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index 1b6cc55..dfa9a5f 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -61,6 +61,7 @@ enum class MouseNotifyEvent;
 enum class ActivateModeFlags;
 enum class DialogControlFlags;
 enum class GetFocusFlags;
+enum class ParentClipMode;
 
 namespace com { namespace sun { namespace star {
 
@@ -276,7 +277,7 @@ public:
     sal_uInt16          mnWaitCount;
     sal_uInt16          mnPaintFlags;
     GetFocusFlags       mnGetFocusFlags;
-    sal_uInt16          mnParentClipMode;
+    ParentClipMode      mnParentClipMode;
     ActivateModeFlags   mnActivateMode;
     DialogControlFlags  mnDlgCtrlFlags;
     sal_uInt16          mnLockCount;
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 0ad533a..6483a97 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -279,7 +279,7 @@ void HelpTextWindow::ApplySettings(vcl::RenderContext& rRenderContext)
     if (rRenderContext.IsNativeControlSupported(CTRL_TOOLTIP, PART_ENTIRE_CONTROL))
     {
         EnableChildTransparentMode(true);
-        SetParentClipMode(PARENTCLIPMODE_NOCLIP);
+        SetParentClipMode(ParentClipMode::NoClip);
         SetPaintTransparent(true);
         rRenderContext.SetBackground();
     }
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index b13ac6f..35c0262 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -691,13 +691,13 @@ void PushButton::ImplInitSettings( bool bFont,
     {
         SetBackground();
         // #i38498#: do not check for GetParent()->IsChildTransparentModeEnabled()
-        // otherwise the formcontrol button will be overdrawn due to PARENTCLIPMODE_NOCLIP
+        // otherwise the formcontrol button will be overdrawn due to ParentClipMode::NoClip
         // for radio and checkbox this is ok as they should appear transparent in documents
         if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) ||
              (GetStyle() & WB_FLATBUTTON) != 0 )
         {
             EnableChildTransparentMode( true );
-            SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+            SetParentClipMode( ParentClipMode::NoClip );
             SetPaintTransparent( true );
             mpWindowImpl->mbUseNativeFocus = (GetStyle() & WB_FLATBUTTON) == 0
                 && ImplGetSVData()->maNWFData.mbNoFocusRects;
@@ -705,7 +705,7 @@ void PushButton::ImplInitSettings( bool bFont,
         else
         {
             EnableChildTransparentMode( false );
-            SetParentClipMode( 0 );
+            SetParentClipMode( ParentClipMode::NONE );
             SetPaintTransparent( false );
         }
     }
@@ -1855,7 +1855,7 @@ void RadioButton::ImplInitSettings( bool bFont,
             (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) ) )
         {
             EnableChildTransparentMode( true );
-            SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+            SetParentClipMode( ParentClipMode::NoClip );
             SetPaintTransparent( true );
             SetBackground();
             if( IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) )
@@ -1864,7 +1864,7 @@ void RadioButton::ImplInitSettings( bool bFont,
         else
         {
             EnableChildTransparentMode( false );
-            SetParentClipMode( 0 );
+            SetParentClipMode( ParentClipMode::NONE );
             SetPaintTransparent( false );
 
             if ( IsControlBackground() )
@@ -2993,7 +2993,7 @@ void CheckBox::ImplInitSettings( bool bFont,
             (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) ) )
         {
             EnableChildTransparentMode( true );
-            SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+            SetParentClipMode( ParentClipMode::NoClip );
             SetPaintTransparent( true );
             SetBackground();
             if( IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) )
@@ -3002,7 +3002,7 @@ void CheckBox::ImplInitSettings( bool bFont,
         else
         {
             EnableChildTransparentMode( false );
-            SetParentClipMode( 0 );
+            SetParentClipMode( ParentClipMode::NONE );
             SetPaintTransparent( false );
 
             if ( IsControlBackground() )
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index c891061..214db26 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -211,14 +211,14 @@ void FixedText::ApplySettings(vcl::RenderContext& rRenderContext)
     if (pParent->IsChildTransparentModeEnabled() && !IsControlBackground())
     {
         EnableChildTransparentMode(true);
-        SetParentClipMode(PARENTCLIPMODE_NOCLIP);
+        SetParentClipMode(ParentClipMode::NoClip);
         SetPaintTransparent(true);
         rRenderContext.SetBackground();
     }
     else
     {
         EnableChildTransparentMode(false);
-        SetParentClipMode(0);
+        SetParentClipMode(ParentClipMode::NONE);
         SetPaintTransparent(false);
 
         if (IsControlBackground())
@@ -619,14 +619,14 @@ void FixedLine::ApplySettings(vcl::RenderContext& rRenderContext)
     if (pParent->IsChildTransparentModeEnabled() && !IsControlBackground())
     {
         EnableChildTransparentMode(true);
-        SetParentClipMode(PARENTCLIPMODE_NOCLIP);
+        SetParentClipMode(ParentClipMode::NoClip);
         SetPaintTransparent(true);
         rRenderContext.SetBackground();
     }
     else
     {
         EnableChildTransparentMode(false);
-        SetParentClipMode(0);
+        SetParentClipMode(ParentClipMode::NONE);
         SetPaintTransparent(false);
 
         if (IsControlBackground())
@@ -751,14 +751,14 @@ void FixedBitmap::ApplySettings(vcl::RenderContext& rRenderContext)
     if (pParent->IsChildTransparentModeEnabled() && !IsControlBackground())
     {
         EnableChildTransparentMode(true);
-        SetParentClipMode(PARENTCLIPMODE_NOCLIP);
+        SetParentClipMode(ParentClipMode::NoClip);
         SetPaintTransparent(true);
         rRenderContext.SetBackground();
     }
     else
     {
         EnableChildTransparentMode(false);
-        SetParentClipMode(0);
+        SetParentClipMode(ParentClipMode::NONE);
         SetPaintTransparent(false);
 
         if (IsControlBackground())
@@ -921,14 +921,14 @@ void FixedImage::ApplySettings(vcl::RenderContext& rRenderContext)
     if (pParent && pParent->IsChildTransparentModeEnabled() && !IsControlBackground())
     {
         EnableChildTransparentMode(true);
-        SetParentClipMode(PARENTCLIPMODE_NOCLIP);
+        SetParentClipMode(ParentClipMode::NoClip);
         SetPaintTransparent(true);
         rRenderContext.SetBackground();
     }
     else
     {
         EnableChildTransparentMode(false);
-        SetParentClipMode(0);
+        SetParentClipMode(ParentClipMode::NONE);
         SetPaintTransparent(false);
 
         if (IsControlBackground())
diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx
index 69dcca5..1c2ca0c 100644
--- a/vcl/source/control/group.cxx
+++ b/vcl/source/control/group.cxx
@@ -68,14 +68,14 @@ void GroupBox::ImplInitSettings( bool bFont,
              !IsControlBackground() )
         {
             EnableChildTransparentMode( true );
-            SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+            SetParentClipMode( ParentClipMode::NoClip );
             SetPaintTransparent( true );
             SetBackground();
         }
         else
         {
             EnableChildTransparentMode( false );
-            SetParentClipMode( 0 );
+            SetParentClipMode( ParentClipMode::NONE );
             SetPaintTransparent( false );
 
             if ( IsControlBackground() )
diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx
index b9e8cb9..723a5e8 100644
--- a/vcl/source/control/prgsbar.cxx
+++ b/vcl/source/control/prgsbar.cxx
@@ -83,7 +83,7 @@ void ProgressBar::ImplInitSettings( bool bFont,
             EnableChildTransparentMode( true );
             SetPaintTransparent( true );
             SetBackground();
-            SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+            SetParentClipMode( ParentClipMode::NoClip );
         }
         else
         {
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index db264ee..4feabab 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -99,14 +99,14 @@ void Slider::ImplInitSettings()
     if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
     {
         EnableChildTransparentMode( true );
-        SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+        SetParentClipMode( ParentClipMode::NoClip );
         SetPaintTransparent( true );
         SetBackground();
     }
     else
     {
         EnableChildTransparentMode( false );
-        SetParentClipMode( 0 );
+        SetParentClipMode( ParentClipMode::NONE );
         SetPaintTransparent( false );
 
         if ( IsControlBackground() )
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 76b9e39..3216d90 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -145,7 +145,7 @@ void TabControl::ImplInitSettings( bool bFont,
             // set transparent mode for NWF tabcontrols to have
             // the background always cleared properly
             EnableChildTransparentMode( true );
-            SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+            SetParentClipMode( ParentClipMode::NoClip );
             SetPaintTransparent( true );
             SetBackground();
             ImplGetWindowImpl()->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
@@ -153,7 +153,7 @@ void TabControl::ImplInitSettings( bool bFont,
         else
         {
             EnableChildTransparentMode( false );
-            SetParentClipMode( 0 );
+            SetParentClipMode( ParentClipMode::NONE );
             SetPaintTransparent( false );
 
             if ( IsControlBackground() )
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 9beed93..ef6e1ac 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1088,7 +1088,7 @@ bool OpenGLContext::initWindow()
     if( m_pChildWindow )
     {
         m_pChildWindow->SetMouseTransparent( true );
-        m_pChildWindow->SetParentClipMode(PARENTCLIPMODE_CLIP);
+        m_pChildWindow->SetParentClipMode(ParentClipMode::Clip);
         m_pChildWindow->EnableEraseBackground( false );
         m_pChildWindow->SetControlForeground();
         m_pChildWindow->SetControlBackground();
@@ -1115,7 +1115,7 @@ bool OpenGLContext::initWindow()
     if( m_pChildWindow )
     {
         m_pChildWindow->SetMouseTransparent( true );
-        m_pChildWindow->SetParentClipMode(PARENTCLIPMODE_CLIP);
+        m_pChildWindow->SetParentClipMode(ParentClipMode::Clip);
         m_pChildWindow->EnableEraseBackground( false );
         m_pChildWindow->SetControlForeground();
         m_pChildWindow->SetControlBackground();
@@ -1152,7 +1152,7 @@ bool OpenGLContext::initWindow()
         return false;
 
     m_pChildWindow->SetMouseTransparent( true );
-    m_pChildWindow->SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+    m_pChildWindow->SetParentClipMode( ParentClipMode::NoClip );
     m_pChildWindow->EnableEraseBackground( false );
     m_pChildWindow->SetControlForeground();
     m_pChildWindow->SetControlBackground();
diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx
index ef56b63cf..9b088c3 100644
--- a/vcl/source/window/clipping.cxx
+++ b/vcl/source/window/clipping.cxx
@@ -63,9 +63,8 @@ void Window::InitClipRegion()
     mbInitClipRegion = false;
 }
 
-void Window::SetParentClipMode( sal_uInt16 nMode )
+void Window::SetParentClipMode( ParentClipMode nMode )
 {
-
     if ( mpWindowImpl->mpBorderWindow )
         mpWindowImpl->mpBorderWindow->SetParentClipMode( nMode );
     else
@@ -73,15 +72,14 @@ void Window::SetParentClipMode( sal_uInt16 nMode )
         if ( !ImplIsOverlapWindow() )
         {
             mpWindowImpl->mnParentClipMode = nMode;
-            if ( nMode & PARENTCLIPMODE_CLIP )
+            if ( nMode & ParentClipMode::Clip )
                 mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = true;
         }
     }
 }
 
-sal_uInt16 Window::GetParentClipMode() const
+ParentClipMode Window::GetParentClipMode() const
 {
-
     if ( mpWindowImpl->mpBorderWindow )
         return mpWindowImpl->mpBorderWindow->GetParentClipMode();
     else
@@ -207,9 +205,9 @@ bool Window::ImplClipChildren( vcl::Region& rRegion )
         if ( pWindow->mpWindowImpl->mbReallyVisible )
         {
             // read-out ParentClipMode-Flags
-            sal_uInt16 nClipMode = pWindow->GetParentClipMode();
-            if ( !(nClipMode & PARENTCLIPMODE_NOCLIP) &&
-                 ((nClipMode & PARENTCLIPMODE_CLIP) || (GetStyle() & WB_CLIPCHILDREN)) )
+            ParentClipMode nClipMode = pWindow->GetParentClipMode();
+            if ( !(nClipMode & ParentClipMode::NoClip) &&
+                 ((nClipMode & ParentClipMode::Clip) || (GetStyle() & WB_CLIPCHILDREN)) )
                 pWindow->ImplExcludeWindowRegion( rRegion );
             else
                 bOtherClip = true;
@@ -488,7 +486,7 @@ bool Window::ImplSetClipFlag( bool bSysObjOnlySmaller )
 
         vcl::Window* pParent = ImplGetParent();
         if ( pParent &&
-             ((pParent->GetStyle() & WB_CLIPCHILDREN) || (mpWindowImpl->mnParentClipMode & PARENTCLIPMODE_CLIP)) )
+             ((pParent->GetStyle() & WB_CLIPCHILDREN) || (mpWindowImpl->mnParentClipMode & ParentClipMode::Clip)) )
         {
             pParent->mbInitClipRegion = true;
             pParent->mpWindowImpl->mbInitChildRegion = true;
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index fc266f2..1f690fc 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -144,7 +144,7 @@ MenuBarWindow::MenuBarWindow( vcl::Window* pParent ) :
         aCloseBtn->SetOutStyle(TOOLBOX_STYLE_FLAT);
         aCloseBtn->SetBackground();
         aCloseBtn->SetPaintTransparent(true);
-        aCloseBtn->SetParentClipMode(PARENTCLIPMODE_NOCLIP);
+        aCloseBtn->SetParentClipMode(ParentClipMode::NoClip);
 
         aCloseBtn->InsertItem(IID_DOCUMENTCLOSE, aCloseBtn->maImage, ToolBoxItemBits::NONE);
         aCloseBtn->SetSelectHdl(LINK(this, MenuBarWindow, CloseHdl));
@@ -1036,7 +1036,7 @@ void MenuBarWindow::ApplySettings(vcl::RenderContext& rRenderContext)
 
         rRenderContext.SetBackground(aWallpaper);
         SetPaintTransparent(false);
-        SetParentClipMode(0);
+        SetParentClipMode(ParentClipMode::NONE);
     }
     else if (rRenderContext.IsNativeControlSupported(CTRL_MENUBAR, PART_ENTIRE_CONTROL))
     {
@@ -1048,7 +1048,7 @@ void MenuBarWindow::ApplySettings(vcl::RenderContext& rRenderContext)
         aWallpaper.SetStyle(WALLPAPER_APPLICATIONGRADIENT);
         rRenderContext.SetBackground(aWallpaper);
         SetPaintTransparent(false);
-        SetParentClipMode(0);
+        SetParentClipMode(ParentClipMode::NONE);
     }
 
     rRenderContext.SetTextColor(rStyleSettings.GetMenuBarTextColor());
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index fd50a20..074f895 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1359,7 +1359,7 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
     // do the actual paint
 
     // background
-    if( ! IsPaintTransparent() && IsBackground() && ! (GetParentClipMode() & PARENTCLIPMODE_NOCLIP ) )
+    if( ! IsPaintTransparent() && IsBackground() && ! (GetParentClipMode() & ParentClipMode::NoClip ) )
         Erase(*this);
     // foreground
     Paint(*this, aPaintRect);
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index 71b7a99..0059b55 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -941,7 +941,7 @@ void Window::SetParent( vcl::Window* pNewParent )
     }
     ImplRemoveWindow( bNewFrame );
     ImplInsertWindow( pNewParent );
-    if ( mpWindowImpl->mnParentClipMode & PARENTCLIPMODE_CLIP )
+    if ( mpWindowImpl->mnParentClipMode & ParentClipMode::Clip )
         pNewParent->mpWindowImpl->mbClipChildren = true;
     ImplUpdateWindowPtr();
     if ( ImplUpdatePos() )
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index c02cfc6..0f16a49 100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -114,7 +114,7 @@ void SystemChildWindow::ImplInitSysChild( vcl::Window* pParent, WinBits nStyle,
     if ( GetSystemData() )
     {
         mpWindowImpl->mpSysObj->SetCallback( this, ImplSysChildProc );
-        SetParentClipMode( PARENTCLIPMODE_CLIP );
+        SetParentClipMode( ParentClipMode::Clip );
         SetBackground();
     }
 }
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index 170dbca..d2c432e 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -52,14 +52,14 @@ void TabPage::ImplInitSettings()
     if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
     {
         EnableChildTransparentMode( true );
-        SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+        SetParentClipMode( ParentClipMode::NoClip );
         SetPaintTransparent( true );
         SetBackground();
     }
     else
     {
         EnableChildTransparentMode( false );
-        SetParentClipMode( 0 );
+        SetParentClipMode( ParentClipMode::NONE );
         SetPaintTransparent( false );
 
         if ( IsControlBackground() )
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index a983800..18f4f83 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1450,7 +1450,7 @@ void ToolBox::ApplySettings(vcl::RenderContext& rRenderContext)
         aColor = GetControlBackground();
         SetBackground( aColor );
         SetPaintTransparent(false);
-        SetParentClipMode( 0 );
+        SetParentClipMode( ParentClipMode::NONE );
     }
     else
     {
@@ -1461,7 +1461,7 @@ void ToolBox::ApplySettings(vcl::RenderContext& rRenderContext)
             rRenderContext.SetBackground();
             rRenderContext.SetTextColor(rStyleSettings.GetMenuBarTextColor());
             SetPaintTransparent(true);
-            SetParentClipMode(PARENTCLIPMODE_NOCLIP);
+            SetParentClipMode(ParentClipMode::NoClip);
             mpData->maDisplayBackground = Wallpaper(rStyleSettings.GetFaceColor());
         }
         else
@@ -1473,7 +1473,7 @@ void ToolBox::ApplySettings(vcl::RenderContext& rRenderContext)
 
             rRenderContext.SetBackground(aColor);
             SetPaintTransparent(false);
-            SetParentClipMode(0);
+            SetParentClipMode(ParentClipMode::NONE);
         }
     }
 }
@@ -1513,7 +1513,7 @@ void ToolBox::ImplInitSettings(bool bFont, bool bForeground, bool bBackground)
             aColor = GetControlBackground();
             SetBackground( aColor );
             SetPaintTransparent(false);
-            SetParentClipMode( 0 );
+            SetParentClipMode( ParentClipMode::NONE );
         }
         else
         {
@@ -1524,7 +1524,7 @@ void ToolBox::ImplInitSettings(bool bFont, bool bForeground, bool bBackground)
                 SetBackground();
                 SetTextColor(rStyleSettings.GetMenuBarTextColor());
                 SetPaintTransparent( true );
-                SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+                SetParentClipMode( ParentClipMode::NoClip );
                 mpData->maDisplayBackground = Wallpaper( rStyleSettings.GetFaceColor() );
             }
             else
@@ -1536,7 +1536,7 @@ void ToolBox::ImplInitSettings(bool bFont, bool bForeground, bool bBackground)
 
                 SetBackground(aColor);
                 SetPaintTransparent(false);
-                SetParentClipMode(0);
+                SetParentClipMode(ParentClipMode::NONE);
             }
         }
     }
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index a26e42e..c9129b6 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -646,7 +646,7 @@ WindowImpl::WindowImpl( WindowType nType )
     mnGetFocusFlags                     = GetFocusFlags::NONE;       // Flags fuer GetFocus()-Aufruf
     mnWaitCount                         = 0;                         // Wait-Count (>1 == Warte-MousePointer)
     mnPaintFlags                        = 0;                         // Flags for ImplCallPaint
-    mnParentClipMode                    = 0;                         // Flags for Parent-ClipChildren-Mode
+    mnParentClipMode                    = ParentClipMode::NONE;      // Flags for Parent-ClipChildren-Mode
     mnActivateMode                      = ActivateModeFlags::NONE;   // Will be converted in System/Overlap-Windows
     mnDlgCtrlFlags                      = DialogControlFlags::NONE;  // DialogControl-Flags
     mnLockCount                         = 0;                         // LockCount
commit 173aa749d50f904887e4aa1ce425c6807668bff0
Author: Noel Grandin <noel at peralex.com>
Date:   Wed May 27 16:01:34 2015 +0200

    convert INVERT flags to scoped enum
    
    Change-Id: Iad8faee927de1ad646975157e36c3027c0ba8149

diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 62f7a12..9654d34 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -273,8 +273,16 @@ namespace o3tl
 #define PARENTCLIPMODE_NOCLIP           ((sal_uInt16)0x0002)
 
 // Flags for Invert()
-#define INVERT_HIGHLIGHT                ((sal_uInt16)0x0001)
-#define INVERT_50                       ((sal_uInt16)0x0002)
+enum class InvertFlags
+{
+    NONE                    = 0x0000,
+    Highlight               = 0x0001,
+    N50                     = 0x0002,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<InvertFlags> : is_typed_flags<InvertFlags, 0x0003> {};
+}
 
 // Flags for ShowTracking()
 #define SHOWTRACK_SMALL                 ((sal_uInt16)0x0001)
@@ -1239,8 +1247,8 @@ public:
     virtual void                        ShowFocus(const Rectangle& rRect);
     void                                HideFocus();
 
-    void                                Invert( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
-    void                                Invert( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
+    void                                Invert( const Rectangle& rRect, InvertFlags nFlags = InvertFlags::NONE );
+    void                                Invert( const Polygon& rPoly, InvertFlags nFlags = InvertFlags::NONE );
 
     // transparent background for selected or checked items in toolboxes etc.
     void                                DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder, bool bDrawExtBorderOnly );
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 020f740..4336099 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -1567,12 +1567,12 @@ void ScPreview::DrawInvert( long nDragPos, PointerStyle nFlags )
     if( nFlags == PointerStyle::HSizeBar || nFlags == PointerStyle::HSplit )
     {
         Rectangle aRect( nDragPos, -aOffset.Y(), nDragPos + 1,(long)( ( nHeight * HMM_PER_TWIPS ) - aOffset.Y()));
-        Invert( aRect,INVERT_50 );
+        Invert( aRect, InvertFlags::N50 );
     }
     else if( nFlags == PointerStyle::VSizeBar )
     {
         Rectangle aRect( -aOffset.X(), nDragPos,(long)( ( nWidth * HMM_PER_TWIPS ) - aOffset.X() ), nDragPos + 1 );
-        Invert( aRect,INVERT_50 );
+        Invert( aRect, InvertFlags::N50 );
     }
 }
 
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 699f8e8..31986b9 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -1160,7 +1160,7 @@ void ScrollBar::ImplInvert()
         aRect.Bottom() -= 2;
     }
 
-    Invert( aRect, 0 );
+    Invert( aRect );
 }
 
 void ScrollBar::GetFocus()
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index bd96802..b665be7 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -46,11 +46,11 @@ static void ImplCursorInvert( ImplCursorData* pData )
     vcl::Window* pWindow  = pData->mpWindow;
     bool    bMapMode = pWindow->IsMapModeEnabled();
     pWindow->EnableMapMode( false );
-    sal_uInt16 nInvertStyle;
+    InvertFlags nInvertStyle;
     if ( pData->mnStyle & CURSOR_SHADOW )
-        nInvertStyle = INVERT_50;
+        nInvertStyle = InvertFlags::N50;
     else
-        nInvertStyle = 0;
+        nInvertStyle = InvertFlags::NONE;
 
     Rectangle aRect( pData->maPixPos, pData->maPixSize );
     if ( pData->mnDirection != CursorDirection::NONE || pData->mnOrientation || pData->mnPixSlant )
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index bed0306..717f5d7 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -127,7 +127,7 @@ void Window::HideFocus()
     mpWindowImpl->mbInHideFocus = false;
 }
 
-void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags )
+void Window::Invert( const Rectangle& rRect, InvertFlags nFlags )
 {
     if ( !IsDeviceOutputNecessary() )
         return;
@@ -153,14 +153,14 @@ void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags )
         return;
 
     SalInvert nSalFlags = 0;
-    if ( nFlags & INVERT_HIGHLIGHT )
+    if ( nFlags & InvertFlags::Highlight )
         nSalFlags |= SAL_INVERT_HIGHLIGHT;
-    if ( nFlags & INVERT_50 )
+    if ( nFlags & InvertFlags::N50 )
         nSalFlags |= SAL_INVERT_50;
     mpGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), nSalFlags, this );
 }
 
-void Window::Invert( const Polygon& rPoly, sal_uInt16 nFlags )
+void Window::Invert( const Polygon& rPoly, InvertFlags nFlags )
 {
     if ( !IsDeviceOutputNecessary() )
         return;
@@ -187,9 +187,9 @@ void Window::Invert( const Polygon& rPoly, sal_uInt16 nFlags )
         return;
 
     SalInvert nSalFlags = 0;
-    if ( nFlags & INVERT_HIGHLIGHT )
+    if ( nFlags & InvertFlags::Highlight )
         nSalFlags |= SAL_INVERT_HIGHLIGHT;
-    if ( nFlags & INVERT_50 )
+    if ( nFlags & InvertFlags::N50 )
         nSalFlags |= SAL_INVERT_50;
     const SalPoint* pPtAry = reinterpret_cast<const SalPoint*>(aPoly.GetConstPointAry());
     mpGraphics->Invert( nPoints, pPtAry, nSalFlags, this );
commit 79db3fc0ee41a6284eb2175a4780f4157cb708f6
Author: Noel Grandin <noel at peralex.com>
Date:   Wed May 27 15:09:52 2015 +0200

    convert STARTTRACK constants to scoped enum
    
    Change-Id: I9b441688eb59ffd3540b014716a9abe7969c9be4

diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index f3f3b4d..62f7a12 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -286,13 +286,21 @@ namespace o3tl
 #define SHOWTRACK_STYLE                 ((sal_uInt16)0x000F)
 
 // Flags for StartTracking()
-#define STARTTRACK_KEYINPUT             ((sal_uInt16)0x0001)
-#define STARTTRACK_KEYMOD               ((sal_uInt16)0x0002)
-#define STARTTRACK_NOKEYCANCEL          ((sal_uInt16)0x0004)
-#define STARTTRACK_SCROLLREPEAT         ((sal_uInt16)0x0008)
-#define STARTTRACK_BUTTONREPEAT         ((sal_uInt16)0x0010)
-#define STARTTRACK_MOUSEBUTTONDOWN      ((sal_uInt16)0x0020)
-#define STARTTRACK_FOCUSCANCEL          ((sal_uInt16)0x0040)
+enum class StartTrackingFlags
+{
+    NONE                 = 0x0000,
+    KeyInput             = 0x0001,
+    KeyMod               = 0x0002,
+    NoKeyCancel          = 0x0004,
+    ScrollRepeat         = 0x0008,
+    ButtonRepeat         = 0x0010,
+    MouseButtonDown      = 0x0020,
+    FocusCancel          = 0x0040,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<StartTrackingFlags> : is_typed_flags<StartTrackingFlags, 0x007f> {};
+}
 
 // Flags for StartAutoScroll()
 enum class StartAutoScrollFlags
@@ -1248,7 +1256,7 @@ public:
                                                         sal_uInt16 nFlags = SHOWTRACK_SMALL );
     void                                InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
 
-    void                                StartTracking( sal_uInt16 nFlags = 0 );
+    void                                StartTracking( StartTrackingFlags nFlags = StartTrackingFlags::NONE );
     void                                EndTracking( TrackingEventFlags nFlags = TrackingEventFlags::NONE );
     bool                                IsTracking() const;
 
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 7d61724..069edcf 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -863,7 +863,7 @@ void ScCsvGrid::MouseButtonDown( const MouseEvent& rMEvt )
             DoSelectAction( nColIx, rMEvt.GetModifier() );
             mnMTCurrCol = nColIx;
             mbMTSelecting = IsSelected( nColIx );
-            StartTracking( STARTTRACK_BUTTONREPEAT );
+            StartTracking( StartTrackingFlags::ButtonRepeat );
         }
     }
     EnableRepaint();
diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx
index aab46e9..d6ad878 100644
--- a/sc/source/ui/dbgui/csvruler.cxx
+++ b/sc/source/ui/dbgui/csvruler.cxx
@@ -476,7 +476,7 @@ void ScCsvRuler::StartMouseTracking( sal_Int32 nPos )
     maOldSplits = maSplits;
     Execute( CSVCMD_INSERTSPLIT, nPos );
     if( HasSplit( nPos ) )
-        StartTracking( STARTTRACK_BUTTONREPEAT );
+        StartTracking( StartTrackingFlags::ButtonRepeat );
 }
 
 void ScCsvRuler::MoveMouseTracking( sal_Int32 nPos )
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 118008c..ca994b6 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -776,7 +776,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
         }
 
         if( !pEntry && !(nWinBits & WB_NODRAGSELECTION))
-            pView->StartTracking( STARTTRACK_SCROLLREPEAT );
+            pView->StartTracking( StartTrackingFlags::ScrollRepeat );
         return true;
     }
     else
@@ -796,7 +796,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
                 else
                     nFlags |= F_ADD_MODE;
                 aCurSelectionRect.SetPos( aDocPos );
-                pView->StartTracking( STARTTRACK_SCROLLREPEAT );
+                pView->StartTracking( StartTrackingFlags::ScrollRepeat );
             }
             else
                 bHandled = false;
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index e560bcd..e9d60b3 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -1398,7 +1398,7 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt )
                     // it should really read BUTTONREPEAT, therefore do not
                     // change it to SCROLLREPEAT, check with TH,
                     // why it could be different (71775)
-                    StartTracking( STARTTRACK_BUTTONREPEAT );
+                    StartTracking( StartTrackingFlags::ButtonRepeat );
                 }
                 else
                 {
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 2180346..4866dc3 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1216,7 +1216,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMouseEvent )
                     mbHighlight  = true;
                     mnHighItemId = mnSelItemId;
                     ImplHighlightItem( pItem->mnId );
-                    StartTracking( STARTTRACK_SCROLLREPEAT );
+                    StartTracking( StartTrackingFlags::ScrollRepeat );
                 }
                 else if ( rMouseEvent.GetClicks() == 2 )
                     DoubleClick();
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 59306f2..595812a 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -195,7 +195,7 @@ struct ImplSVWinData
     AutoTimer*              mpTrackTimer;                   // tracking timer
     ImageList*              mpMsgBoxImgList;                // ImageList for MessageBox
     VclPtr<vcl::Window>     mpAutoScrollWin;                // window, that is in AutoScrollMode mode
-    sal_uInt16              mnTrackFlags;                   // tracking flags
+    StartTrackingFlags      mnTrackFlags;                   // tracking flags
     StartAutoScrollFlags    mnAutoScrollFlags;              // auto scroll flags
     bool                    mbNoDeactivate;                 // true: do not execute Deactivate
     bool                    mbNoSaveFocus;                  // true: menus must not save/restore focus
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 9998c22..b13ac6f 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1200,17 +1200,17 @@ void PushButton::MouseButtonDown( const MouseEvent& rMEvt )
     if ( rMEvt.IsLeft() &&
          ImplHitTestPushButton( this, rMEvt.GetPosPixel() ) )
     {
-        sal_uInt16 nTrackFlags = 0;
+        StartTrackingFlags nTrackFlags = StartTrackingFlags::NONE;
 
         if ( ( GetStyle() & WB_REPEAT ) &&
              ! ( GetStyle() & WB_TOGGLE ) )
-            nTrackFlags |= STARTTRACK_BUTTONREPEAT;
+            nTrackFlags |= StartTrackingFlags::ButtonRepeat;
 
         ImplGetButtonState() |= DrawButtonFlags::Pressed;
         Invalidate();
         StartTracking( nTrackFlags );
 
-        if ( nTrackFlags & STARTTRACK_BUTTONREPEAT )
+        if ( nTrackFlags & StartTrackingFlags::ButtonRepeat )
             Click();
     }
 }
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index e83ae50..9ff20ba 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1375,7 +1375,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
             ImplSetCursorPos( nCharPos, rMEvt.IsShift() );
 
         if ( !mbClickedInSelection && rMEvt.IsLeft() && ( rMEvt.GetClicks() == 1 ) )
-            StartTracking( STARTTRACK_SCROLLREPEAT );
+            StartTracking( StartTrackingFlags::ScrollRepeat );
     }
 
     mbInMBDown = true;  // then do not select all in GetFocus
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index f7d4592..2cf7dfb 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -859,7 +859,7 @@ void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt )
                 if ( mbGrabFocus )
                     GrabFocus();
 
-                StartTracking( STARTTRACK_SCROLLREPEAT );
+                StartTracking( StartTrackingFlags::ScrollRepeat );
             }
         }
         if( rMEvt.GetClicks() == 2 )
@@ -946,7 +946,7 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt )
                 if ( mbStackMode && ( mpEntryList->GetSelectionAnchor() == LISTBOX_ENTRY_NOTFOUND ) )
                     mpEntryList->SetSelectionAnchor( 0 );
 
-                StartTracking( STARTTRACK_SCROLLREPEAT );
+                StartTracking( StartTrackingFlags::ScrollRepeat );
             }
         }
     }
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 2d7fdc3..699f8e8 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -898,7 +898,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
     if (rMEvt.IsLeft() || rMEvt.IsMiddle() || rMEvt.IsRight())
     {
         const Point&        rMousePos = rMEvt.GetPosPixel();
-        sal_uInt16          nTrackFlags = 0;
+        StartTrackingFlags  nTrackFlags = StartTrackingFlags::NONE;
         bool                bHorizontal = ( GetStyle() & WB_HORZ ) != 0;
         bool                bIsInside = false;
         bool                bDragToMouse = false;
@@ -913,7 +913,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
         {
             if (rMEvt.IsLeft() && !(mnStateFlags & SCRBAR_STATE_BTN1_DISABLE) )
             {
-                nTrackFlags     = STARTTRACK_BUTTONREPEAT;
+                nTrackFlags     = StartTrackingFlags::ButtonRepeat;
                 meScrollType    = SCROLL_LINEUP;
                 mnDragDraw      = SCRBAR_DRAW_BTN1;
             }
@@ -925,7 +925,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
         {
             if (rMEvt.IsLeft() && !(mnStateFlags & SCRBAR_STATE_BTN2_DISABLE) )
             {
-                nTrackFlags     = STARTTRACK_BUTTONREPEAT;
+                nTrackFlags     = StartTrackingFlags::ButtonRepeat;
                 meScrollType    = SCROLL_LINEDOWN;
                 mnDragDraw      = SCRBAR_DRAW_BTN2;
             }
@@ -953,7 +953,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
 
                 if ( mnVisibleSize < mnMaxRange-mnMinRange )
                 {
-                    nTrackFlags     = 0;
+                    nTrackFlags     = StartTrackingFlags::NONE;
                     meScrollType    = SCROLL_DRAG;
                     mnDragDraw      = SCRBAR_DRAW_THUMB;
 
@@ -982,7 +982,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
                                            aControlRegion, rMousePos, bIsInside ) ||
                 bIsInside) )
             {
-                nTrackFlags = STARTTRACK_BUTTONREPEAT;
+                nTrackFlags = StartTrackingFlags::ButtonRepeat;
 
                 // HitTestNativeControl, see remark at top of file
                 if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER,
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index f30e0c0..db264ee 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -658,12 +658,11 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
 {
     if ( rMEvt.IsLeft() )
     {
-        const Point&    rMousePos = rMEvt.GetPosPixel();
-        sal_uInt16          nTrackFlags = 0;
+        const Point&       rMousePos = rMEvt.GetPosPixel();
+        StartTrackingFlags nTrackFlags = StartTrackingFlags::NONE;
 
         if ( maThumbRect.IsInside( rMousePos ) )
         {
-            nTrackFlags     = 0;
             meScrollType    = SCROLL_DRAG;
             mnDragDraw      = SLIDER_DRAW_THUMB;
 
@@ -680,7 +679,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
                 meScrollType = SCROLL_SET;
             else
             {
-                nTrackFlags = STARTTRACK_BUTTONREPEAT;
+                nTrackFlags = StartTrackingFlags::ButtonRepeat;
                 meScrollType = SCROLL_PAGEUP;
             }
 
@@ -692,7 +691,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
                 meScrollType = SCROLL_SET;
             else
             {
-                nTrackFlags = STARTTRACK_BUTTONREPEAT;
+                nTrackFlags = StartTrackingFlags::ButtonRepeat;
                 meScrollType = SCROLL_PAGEDOWN;
             }
 
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 84a0834..a1cd734 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -730,7 +730,7 @@ void ImplPopupFloatWin::MouseMove( const MouseEvent& rMEvt )
         {
             // start window move
             mbMoving = true;
-            StartTracking( STARTTRACK_NOKEYCANCEL );
+            StartTracking( StartTrackingFlags::NoKeyCancel );
             return;
         }
         if( !mbHighlight && GetDragRect().IsInside( aMousePos ) )
@@ -891,7 +891,7 @@ bool ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos )
     GetWindow()->ImplUpdateAll();
     GetWindow()->ImplGetFrameWindow()->ImplUpdateAll();
 
-    GetWindow()->StartTracking( STARTTRACK_KEYMOD );
+    GetWindow()->StartTracking( StartTrackingFlags::KeyMod );
     return true;
 }
 
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 348af89..658e8db 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -299,7 +299,7 @@ bool DockingWindow::ImplStartDocking( const Point& rPos )
         ImplGetFrameWindow()->ImplUpdateAll();
     }
 
-    StartTracking( STARTTRACK_KEYMOD );
+    StartTracking( StartTrackingFlags::KeyMod );
     return true;
 }
 
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index 9114ac0..3582ed6 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -352,7 +352,7 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
         if ( pOldFocusWindow && ! aOldFocusDel.IsDead() )
         {
             if ( pOldFocusWindow->IsTracking() &&
-                 (pSVData->maWinData.mnTrackFlags & STARTTRACK_FOCUSCANCEL) )
+                 (pSVData->maWinData.mnTrackFlags & StartTrackingFlags::FocusCancel) )
                 pOldFocusWindow->EndTracking( TrackingEventFlags::Cancel | TrackingEventFlags::Focus );
             NotifyEvent aNEvt( MouseNotifyEvent::LOSEFOCUS, pOldFocusWindow );
             if ( !ImplCallPreNotify( aNEvt ) )
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 53ef7fa..a983800 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3871,14 +3871,14 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
             }
 
             // update actual data
-            sal_uInt16 nTrackFlags = 0;
+            StartTrackingFlags nTrackFlags = StartTrackingFlags::NONE;
             mnCurPos         = i;
             mnCurItemId      = it->mnId;
             mnDownItemId     = mnCurItemId;
             mnMouseClicks    = rMEvt.GetClicks();
             mnMouseModifier  = rMEvt.GetModifier();
             if ( it->mnBits & ToolBoxItemBits::REPEAT )
-                nTrackFlags |= STARTTRACK_BUTTONREPEAT;
+                nTrackFlags |= StartTrackingFlags::ButtonRepeat;
 
             if ( mbSelection )
             {
@@ -3939,7 +3939,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
                     Click();
 
                 // also call Select handler at repeat
-                if ( nTrackFlags & STARTTRACK_BUTTONREPEAT )
+                if ( nTrackFlags & StartTrackingFlags::ButtonRepeat )
                     Select();
 
                 // if the actions was not aborted in Click handler
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index a177383..bed0306 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -350,7 +350,7 @@ IMPL_LINK_TYPED( Window, ImplTrackTimerHdl, Timer*, pTimer, void )
     ImplSVData* pSVData = ImplGetSVData();
 
     // Bei Button-Repeat muessen wir den Timeout umsetzen
-    if ( pSVData->maWinData.mnTrackFlags & STARTTRACK_BUTTONREPEAT )
+    if ( pSVData->maWinData.mnTrackFlags & StartTrackingFlags::ButtonRepeat )
         pTimer->SetTimeout( GetSettings().GetMouseSettings().GetButtonRepeat() );
 
     // Tracking-Event erzeugen
@@ -369,7 +369,7 @@ IMPL_LINK_TYPED( Window, ImplTrackTimerHdl, Timer*, pTimer, void )
     Tracking( aTEvt );
 }
 
-void Window::StartTracking( sal_uInt16 nFlags )
+void Window::StartTracking( StartTrackingFlags nFlags )
 {
     ImplSVData* pSVData = ImplGetSVData();
 
@@ -379,11 +379,11 @@ void Window::StartTracking( sal_uInt16 nFlags )
             pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Cancel );
     }
 
-    if ( nFlags & (STARTTRACK_SCROLLREPEAT | STARTTRACK_BUTTONREPEAT) )
+    if ( nFlags & (StartTrackingFlags::ScrollRepeat | StartTrackingFlags::ButtonRepeat) )
     {
         pSVData->maWinData.mpTrackTimer = new AutoTimer;
 
-        if ( nFlags & STARTTRACK_SCROLLREPEAT )
+        if ( nFlags & StartTrackingFlags::ScrollRepeat )
             pSVData->maWinData.mpTrackTimer->SetTimeout( GetSettings().GetMouseSettings().GetScrollRepeat() );
         else
             pSVData->maWinData.mpTrackTimer->SetTimeout( GetSettings().GetMouseSettings().GetButtonStartRepeat() );
@@ -413,7 +413,7 @@ void Window::EndTracking( TrackingEventFlags nFlags )
         }
 
         pSVData->maWinData.mpTrackWin    = NULL;
-        pSVData->maWinData.mnTrackFlags  = 0;
+        pSVData->maWinData.mnTrackFlags  = StartTrackingFlags::NONE;
         ReleaseMouse();
         }
 
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index a56f94d..9278c2b 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -687,7 +687,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool
                 {
                     // When ScrollRepeat, we restart the timer
                     if ( pSVData->maWinData.mpTrackTimer &&
-                         (pSVData->maWinData.mnTrackFlags & STARTTRACK_SCROLLREPEAT) )
+                         (pSVData->maWinData.mnTrackFlags & StartTrackingFlags::ScrollRepeat) )
                         pSVData->maWinData.mpTrackTimer->Start();
                 }
                 bCallHelpRequest = false;
@@ -717,7 +717,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool
         else if ( nSVEvent == MouseNotifyEvent::MOUSEBUTTONDOWN )
         {
             if ( pSVData->maWinData.mpTrackWin &&
-                 !(pSVData->maWinData.mnTrackFlags & STARTTRACK_MOUSEBUTTONDOWN) )
+                 !(pSVData->maWinData.mnTrackFlags & StartTrackingFlags::MouseButtonDown) )
                 bRet = true;
             else
             {
@@ -947,7 +947,7 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
         {
             sal_uInt16 nOrigCode = aKeyCode.GetCode();
 
-            if ( (nOrigCode == KEY_ESCAPE) && !(pSVData->maWinData.mnTrackFlags & STARTTRACK_NOKEYCANCEL) )
+            if ( (nOrigCode == KEY_ESCAPE) && !(pSVData->maWinData.mnTrackFlags & StartTrackingFlags::NoKeyCancel) )
             {
                 pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Cancel | TrackingEventFlags::Key );
                 if ( pSVData->maWinData.mpFirstFloat )
@@ -968,7 +968,7 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
                 pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Key );
                 return true;
             }
-            else if ( !(pSVData->maWinData.mnTrackFlags & STARTTRACK_KEYINPUT) )
+            else if ( !(pSVData->maWinData.mnTrackFlags & StartTrackingFlags::KeyInput) )
                 return true;
         }
 
commit a086ca18987a91543a65a3965b2bbc4c022400f8
Author: Noel Grandin <noel at peralex.com>
Date:   Wed May 27 14:05:45 2015 +0200

    convert AUTOSCROLL constants to scoped enum
    
    Change-Id: Id1d2b5c13ad6af05314cba60ba5b9a62e0683f5e

diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index c3be2c6..f3f3b4d 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -295,8 +295,16 @@ namespace o3tl
 #define STARTTRACK_FOCUSCANCEL          ((sal_uInt16)0x0040)
 
 // Flags for StartAutoScroll()
-#define AUTOSCROLL_VERT                 ((sal_uInt16)0x0001)
-#define AUTOSCROLL_HORZ                 ((sal_uInt16)0x0002)
+enum class StartAutoScrollFlags
+{
+    NONE                 = 0x0000,
+    Vert                 = 0x0001,
+    Horz                 = 0x0002,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<StartAutoScrollFlags> : is_typed_flags<StartAutoScrollFlags, 0x0003> {};
+}
 
 // Flags for StateChanged()
 enum class StateChangedType : sal_uInt16
@@ -1244,7 +1252,7 @@ public:
     void                                EndTracking( TrackingEventFlags nFlags = TrackingEventFlags::NONE );
     bool                                IsTracking() const;
 
-    void                                StartAutoScroll( sal_uInt16 nFlags );
+    void                                StartAutoScroll( StartAutoScrollFlags nFlags );
     void                                EndAutoScroll();
 
     bool                                HandleScrollCommand( const CommandEvent& rCmd,
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 07221d5..118008c 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2143,12 +2143,12 @@ bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
         case CommandEventId::StartAutoScroll:
         {
             pView->EndTracking();
-            sal_uInt16 nScrollFlags = 0;
+            StartAutoScrollFlags nScrollFlags = StartAutoScrollFlags::NONE;
             if( bHor )
-                nScrollFlags |= AUTOSCROLL_HORZ;
+                nScrollFlags |= StartAutoScrollFlags::Horz;
             if( bVer )
-                nScrollFlags |= AUTOSCROLL_VERT;
-            if( nScrollFlags )
+                nScrollFlags |= StartAutoScrollFlags::Vert;
+            if( nScrollFlags != StartAutoScrollFlags::NONE )
             {
                 pView->StartAutoScroll( nScrollFlags );
                 return true;
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index a54f6cc..59306f2 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -196,7 +196,7 @@ struct ImplSVWinData
     ImageList*              mpMsgBoxImgList;                // ImageList for MessageBox
     VclPtr<vcl::Window>     mpAutoScrollWin;                // window, that is in AutoScrollMode mode
     sal_uInt16              mnTrackFlags;                   // tracking flags
-    sal_uInt16              mnAutoScrollFlags;              // auto scroll flags
+    StartAutoScrollFlags    mnAutoScrollFlags;              // auto scroll flags
     bool                    mbNoDeactivate;                 // true: do not execute Deactivate
     bool                    mbNoSaveFocus;                  // true: menus must not save/restore focus
     bool                    mbNoSaveBackground;             // true: save background is unnecessary or even less performant
diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx
index 8ddc748..88e1cf1 100644
--- a/vcl/source/window/scrwnd.cxx
+++ b/vcl/source/window/scrwnd.cxx
@@ -49,9 +49,9 @@ ImplWheelWindow::ImplWheelWindow( vcl::Window* pParent ) :
     DBG_ASSERT( pParent, "ImplWheelWindow::ImplWheelWindow(): Parent not set!" );
 
     const Size      aSize( pParent->GetOutputSizePixel() );
-    const sal_uInt16    nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
-    const bool      bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
-    const bool      bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+    const StartAutoScrollFlags nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+    const bool      bHorz( nFlags & StartAutoScrollFlags::Horz );
+    const bool      bVert( nFlags & StartAutoScrollFlags::Vert );
 
     // calculate maximum speed distance
     mnMaxWidth = (sal_uLong) ( 0.4 * hypot( (double) aSize.Width(), aSize.Height() ) );
@@ -237,9 +237,9 @@ void ImplWheelWindow::ImplRecalcScrollValues()
 PointerStyle ImplWheelWindow::ImplGetMousePointer( long nDistX, long nDistY )
 {
     PointerStyle    eStyle;
-    const sal_uInt16    nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
-    const bool      bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
-    const bool      bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+    const StartAutoScrollFlags nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+    const bool      bHorz( nFlags & StartAutoScrollFlags::Horz );
+    const bool      bVert( nFlags & StartAutoScrollFlags::Vert );
 
     if( bHorz || bVert )
     {
@@ -316,9 +316,9 @@ void ImplWheelWindow::MouseMove( const MouseEvent& rMEvt )
     mnActDist = (sal_uLong) hypot( (double) nDistX, nDistY );
 
     const PointerStyle  eActStyle = ImplGetMousePointer( nDistX, nDistY );
-    const sal_uInt16        nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
-    const bool          bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
-    const bool          bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+    const StartAutoScrollFlags nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+    const bool          bHorz( nFlags & StartAutoScrollFlags::Horz );
+    const bool          bVert( nFlags & StartAutoScrollFlags::Vert );
     const bool          bOuter = mnActDist > WHEEL_RADIUS;
 
     if( bOuter && ( maLastMousePos != aMousePos ) )
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 7b2974e..a177383 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -443,7 +443,7 @@ bool Window::IsTracking() const
     return (ImplGetSVData()->maWinData.mpTrackWin == this);
 }
 
-void Window::StartAutoScroll( sal_uInt16 nFlags )
+void Window::StartAutoScroll( StartAutoScrollFlags nFlags )
 {
     ImplSVData* pSVData = ImplGetSVData();
 
@@ -465,7 +465,7 @@ void Window::EndAutoScroll()
     if ( pSVData->maWinData.mpAutoScrollWin.get() == this )
     {
         pSVData->maWinData.mpAutoScrollWin = NULL;
-        pSVData->maWinData.mnAutoScrollFlags = 0;
+        pSVData->maWinData.mnAutoScrollFlags = StartAutoScrollFlags::NONE;
         pSVData->maAppData.mpWheelWindow->ImplStop();
         pSVData->maAppData.mpWheelWindow->doLazyDelete();
         pSVData->maAppData.mpWheelWindow = NULL;
@@ -787,21 +787,21 @@ bool Window::HandleScrollCommand( const CommandEvent& rCmd,
         {
             case CommandEventId::StartAutoScroll:
             {
-                sal_uInt16 nFlags = 0;
+                StartAutoScrollFlags nFlags = StartAutoScrollFlags::NONE;
                 if ( pHScrl )
                 {
                     if ( (pHScrl->GetVisibleSize() < pHScrl->GetRangeMax()) &&
                          pHScrl->IsEnabled() && pHScrl->IsInputEnabled() && ! pHScrl->IsInModalMode() )
-                        nFlags |= AUTOSCROLL_HORZ;
+                        nFlags |= StartAutoScrollFlags::Horz;
                 }
                 if ( pVScrl )
                 {
                     if ( (pVScrl->GetVisibleSize() < pVScrl->GetRangeMax()) &&
                          pVScrl->IsEnabled() && pVScrl->IsInputEnabled() && ! pVScrl->IsInModalMode() )
-                        nFlags |= AUTOSCROLL_VERT;
+                        nFlags |= StartAutoScrollFlags::Vert;
                 }
 
-                if ( nFlags )
+                if ( nFlags != StartAutoScrollFlags::NONE )
                 {
                     StartAutoScroll( nFlags );
                     bRet = true;
commit 4c93c30c79ae885d488a8a04d383fe5308a1d520
Author: Noel Grandin <noel at peralex.com>
Date:   Wed May 27 13:47:57 2015 +0200

    convert GETFOCUS constants to scoped enum
    
    Change-Id: I7c324bb6358be28c119592850eb7607479279f09

diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index fd4bcab..9487c9a 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -1024,7 +1024,7 @@ IMPL_LINK(ColorConfigCtrl_Impl, ControlFocusHdl, Control*, pCtrl)
     long aCtrlPosY = pCtrl->GetPosPixel().Y();
     unsigned const nWinHeight = m_pScrollWindow->GetSizePixel().Height();
     unsigned const nEntryHeight = m_pScrollWindow->GetEntryHeight();
-    if (0 != (GETFOCUS_TAB & pCtrl->GetGetFocusFlags()) &&
+    if ((GetFocusFlags::Tab & pCtrl->GetGetFocusFlags()) &&
         (aCtrlPosY < 0 || nWinHeight < aCtrlPosY + nEntryHeight)
     ) {
         long nThumbPos = m_pVScroll->GetThumbPos();
diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx
index 2e4bac8..27c2495 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -667,7 +667,7 @@ namespace svt
                                 sal_uInt16 nColumnId ) const SAL_OVERRIDE;
         using Control::ImplInitSettings;
         SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
-        SVT_DLLPRIVATE void DetermineFocus( const sal_uInt16 _nGetFocusFlags = 0);
+        SVT_DLLPRIVATE void DetermineFocus( const GetFocusFlags _nGetFocusFlags = GetFocusFlags::NONE);
         static inline void HideAndDisable(CellControllerRef& rController);
         inline void EnableAndShow() const;
 
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 183b2b1..b34ed2e 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -317,7 +317,7 @@ protected:
     SAL_DLLPRIVATE void     ImplLoadRes( const ResId& rResId );
 
 public:
-    SAL_DLLPRIVATE void     ImplCallClick( bool bGrabFocus = false, sal_uInt16 nFocusFlags = 0 );
+    SAL_DLLPRIVATE void     ImplCallClick( bool bGrabFocus = false, GetFocusFlags nFocusFlags = GetFocusFlags::NONE );
     SAL_DLLPRIVATE void     ImplSetMinimumNWFSize();
 
 protected:
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 8caf63f..c3be2c6 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -325,16 +325,25 @@ enum class StateChangedType : sal_uInt16
 };
 
 // GetFocusFlags
-#define GETFOCUS_TAB                    ((sal_uInt16)0x0001)
-#define GETFOCUS_CURSOR                 ((sal_uInt16)0x0002)
-#define GETFOCUS_MNEMONIC               ((sal_uInt16)0x0004)
-#define GETFOCUS_F6                     ((sal_uInt16)0x0008)
-#define GETFOCUS_FORWARD                ((sal_uInt16)0x0010)
-#define GETFOCUS_BACKWARD               ((sal_uInt16)0x0020)
-#define GETFOCUS_AROUND                 ((sal_uInt16)0x0040)
-#define GETFOCUS_UNIQUEMNEMONIC         ((sal_uInt16)0x0100)
-#define GETFOCUS_INIT                   ((sal_uInt16)0x0200)
-#define GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0400)
+// must match constants in css:awt::FocusChangeReason
+enum class GetFocusFlags
+{
+    NONE                   = 0x0000,
+    Tab                    = 0x0001,
+    Cursor                 = 0x0002,
+    Mnemonic               = 0x0004,
+    F6                     = 0x0008,
+    Forward                = 0x0010,
+    Backward               = 0x0020,
+    Around                 = 0x0040,
+    UniqueMnemonic         = 0x0100,
+    Init                   = 0x0200,
+    FloatWinPopupModeEndCancel = 0x0400,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<GetFocusFlags> : is_typed_flags<GetFocusFlags, 0x077f> {};
+}
 
 
 // Flags for Draw()
@@ -563,8 +572,8 @@ public:
 
     SAL_DLLPRIVATE Point                ImplFrameToOutput( const Point& rPos );
 
-    SAL_DLLPRIVATE void                 ImplGrabFocus( sal_uInt16 nFlags );
-    SAL_DLLPRIVATE void                 ImplGrabFocusToDocument( sal_uInt16 nFlags );
+    SAL_DLLPRIVATE void                 ImplGrabFocus( GetFocusFlags nFlags );
+    SAL_DLLPRIVATE void                 ImplGrabFocusToDocument( GetFocusFlags nFlags );
     SAL_DLLPRIVATE void                 ImplInvertFocus( const Rectangle& rRect );
 
     SAL_DLLPRIVATE PointerStyle         ImplGetMousePointer() const;
@@ -578,7 +587,7 @@ public:
 
     SAL_DLLPRIVATE void                 ImplDeleteOverlapBackground();
 
-    SAL_DLLPRIVATE void                 ImplControlFocus( sal_uInt16 nFlags = 0 );
+    SAL_DLLPRIVATE void                 ImplControlFocus( GetFocusFlags nFlags = GetFocusFlags::NONE );
 
     SAL_DLLPRIVATE void                 ImplMirrorFramePos( Point &pt ) const;
 
@@ -1134,7 +1143,7 @@ public:
     bool                                HasChildPathFocus( bool bSystemWindow = false ) const;
     bool                                IsActive() const;
     bool                                HasActiveChildFrame();
-    sal_uInt16                          GetGetFocusFlags() const;
+    GetFocusFlags                       GetGetFocusFlags() const;
     void                                GrabFocusToDocument();
 
     /**
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
index c3927578c..376e28d 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
@@ -128,7 +128,7 @@ void ScPivotLayoutTreeListBase::GetFocus()
 {
     SvTreeListBox::GetFocus();
 
-    if( GetGetFocusFlags() & GETFOCUS_MNEMONIC )
+    if( GetGetFocusFlags() & GetFocusFlags::Mnemonic )
     {
         SvTreeListEntry* pEntry = mpParent->mpPreviouslyFocusedListBox->GetCurEntry();
         if (pEntry)
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index d58f856..6e156eb 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -463,10 +463,10 @@ bool BackingWindow::Notify( NotifyEvent& rNEvt )
 
 void BackingWindow::GetFocus()
 {
-    sal_uInt16 nFlags = GetParent()->GetGetFocusFlags();
-    if( nFlags & GETFOCUS_F6 )
+    GetFocusFlags nFlags = GetParent()->GetGetFocusFlags();
+    if( nFlags & GetFocusFlags::F6 )
     {
-        if( nFlags & GETFOCUS_FORWARD ) // F6
+        if( nFlags & GetFocusFlags::Forward ) // F6
         {
             mpOpenButton->GrabFocus();
             return;
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index 56155dd..3764de7 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -47,10 +47,10 @@ namespace svt
     namespace
     {
 
-        sal_uInt16 getRealGetFocusFlags( vcl::Window* _pWindow )
+        GetFocusFlags getRealGetFocusFlags( vcl::Window* _pWindow )
         {
-            sal_uInt16 nFlags = 0;
-            while ( _pWindow && !nFlags )
+            GetFocusFlags nFlags = GetFocusFlags::NONE;
+            while ( _pWindow && nFlags == GetFocusFlags::NONE )
             {
                 nFlags = _pWindow->GetGetFocusFlags( );
                 _pWindow = _pWindow->GetParent();
@@ -228,7 +228,7 @@ namespace svt
     void EditBrowseBox::LoseFocus()
     {
         BrowseBox::LoseFocus();
-        DetermineFocus( 0 );
+        DetermineFocus( GetFocusFlags::NONE );
     }
 
 
@@ -747,7 +747,7 @@ namespace svt
                 break;
 
             case MouseNotifyEvent::LOSEFOCUS:
-                DetermineFocus( 0 );
+                DetermineFocus( GetFocusFlags::NONE );
                 break;
 
             default:
diff --git a/svtools/source/brwbox/editbrowsebox2.cxx b/svtools/source/brwbox/editbrowsebox2.cxx
index e3c6d34..8a659ee 100644
--- a/svtools/source/brwbox/editbrowsebox2.cxx
+++ b/svtools/source/brwbox/editbrowsebox2.cxx
@@ -133,7 +133,7 @@ void EditBrowseBox::GrabTableFocus()
         aController->GetWindow().GrabFocus();
 }
 
-void EditBrowseBox::DetermineFocus( const sal_uInt16 _nGetFocusFlags )
+void EditBrowseBox::DetermineFocus( const GetFocusFlags _nGetFocusFlags )
 {
     bool bFocus = false;
     for (vcl::Window* pWindow = Application::GetFocusWindow();
@@ -148,7 +148,7 @@ void EditBrowseBox::DetermineFocus( const sal_uInt16 _nGetFocusFlags )
         if ( GetBrowserFlags( ) & EditBrowseBoxFlags::SMART_TAB_TRAVEL )
         {
             if  (   bHasFocus                           // we got the focus
-                &&  ( _nGetFocusFlags & GETFOCUS_TAB )  // using the TAB key
+                &&  ( _nGetFocusFlags & GetFocusFlags::Tab )  // using the TAB key
                 )
             {
                 long nRows = GetRowCount();
@@ -156,7 +156,7 @@ void EditBrowseBox::DetermineFocus( const sal_uInt16 _nGetFocusFlags )
 
                 if ( ( nRows > 0 ) && ( nCols > 0 ) )
                 {
-                    if ( _nGetFocusFlags & GETFOCUS_FORWARD )
+                    if ( _nGetFocusFlags & GetFocusFlags::Forward )
                     {
                         if ( GetColumnId( 0 ) != HandleColumnId )
                         {
@@ -168,7 +168,7 @@ void EditBrowseBox::DetermineFocus( const sal_uInt16 _nGetFocusFlags )
                                 GoToRowColumnId( 0, GetColumnId( 1 ) );
                         }
                     }
-                    else if ( _nGetFocusFlags & GETFOCUS_BACKWARD )
+                    else if ( _nGetFocusFlags & GetFocusFlags::Backward )
                     {
                         GoToRowColumnId( nRows - 1, GetColumnId( nCols -1 ) );
                     }
diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx
index 40c175f..2227951 100644
--- a/svx/source/accessibility/AccessibleFrameSelector.cxx
+++ b/svx/source/accessibility/AccessibleFrameSelector.cxx
@@ -465,20 +465,20 @@ void    AccFrameSelector::NotifyFocusListeners(bool bGetFocus)
     aEvent.FocusFlags = 0;
     if(bGetFocus)
     {
-        sal_uInt16 nFocusFlags = mpFrameSel->GetGetFocusFlags();
-        if(nFocusFlags&GETFOCUS_TAB)
+        GetFocusFlags nFocusFlags = mpFrameSel->GetGetFocusFlags();
+        if(nFocusFlags & GetFocusFlags::Tab)
             aEvent.FocusFlags |= AwtFocusChangeReason::TAB;
-        if(nFocusFlags&GETFOCUS_CURSOR)
+        if(nFocusFlags & GetFocusFlags::Cursor)
             aEvent.FocusFlags |= AwtFocusChangeReason::CURSOR;
-        if(nFocusFlags&GETFOCUS_MNEMONIC)
+        if(nFocusFlags & GetFocusFlags::Mnemonic)
             aEvent.FocusFlags |= AwtFocusChangeReason::MNEMONIC;
-        if(nFocusFlags&GETFOCUS_FORWARD)
+        if(nFocusFlags & GetFocusFlags::Forward)
             aEvent.FocusFlags |= AwtFocusChangeReason::FORWARD;
-        if(nFocusFlags&GETFOCUS_BACKWARD)
+        if(nFocusFlags & GetFocusFlags::Backward)
             aEvent.FocusFlags |= AwtFocusChangeReason::BACKWARD;
-        if(nFocusFlags&GETFOCUS_AROUND)
+        if(nFocusFlags & GetFocusFlags::Around)
             aEvent.FocusFlags |= AwtFocusChangeReason::AROUND;
-        if(nFocusFlags&GETFOCUS_UNIQUEMNEMONIC)
+        if(nFocusFlags & GetFocusFlags::UniqueMnemonic)
             aEvent.FocusFlags |= AwtFocusChangeReason::UNIQUEMNEMONIC;
     }
     aEvent.Temporary = sal_False;
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 27763ce..3ea3c54 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -3441,7 +3441,7 @@ void FmXGridCell::onWindowEvent( const sal_uIntPtr _nEventId, const vcl::Window&
 
             awt::FocusEvent aEvent;
             aEvent.Source = *this;
-            aEvent.FocusFlags = _rWindow.GetGetFocusFlags();
+            aEvent.FocusFlags = static_cast<sal_Int16>(_rWindow.GetGetFocusFlags());
             aEvent.Temporary = sal_False;
 
             if ( bFocusGained )
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 7e9046d..4486925 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -272,7 +272,7 @@ IMPL_LINK(SwAddressControl_Impl, ScrollHdl_Impl, ScrollBar*, pScroll)
 
 IMPL_LINK(SwAddressControl_Impl, GotFocusHdl_Impl, Edit*, pEdit)
 {
-    if(0 != (GETFOCUS_TAB & pEdit->GetGetFocusFlags()))
+    if(GetFocusFlags::Tab & pEdit->GetGetFocusFlags())
     {
         Rectangle aRect(pEdit->GetPosPixel(), pEdit->GetSizePixel());
         MakeVisible(aRect);
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 5a04751c..91dd110 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1151,7 +1151,7 @@ IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox)
 
 IMPL_LINK(SwAssignFieldsControl, GotFocusHdl_Impl, ListBox*, pBox)
 {
-    if(0 != (GETFOCUS_TAB & pBox->GetGetFocusFlags()))
+    if(GetFocusFlags::Tab & pBox->GetGetFocusFlags())
     {
         sal_Int32 nIndex = 0;
         for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter, ++nIndex)
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 4dcb18d..0324d6f 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -3576,7 +3576,7 @@ IMPL_LINK(SwTokenWindow, TbxFocusBtnHdl, SwTOXButton*, pBtn )
 
 void SwTokenWindow::GetFocus()
 {
-    if(GETFOCUS_TAB & GetGetFocusFlags())
+    if(GetFocusFlags::Tab & GetGetFocusFlags())
     {
         if (!aControlList.empty())
         {
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 5962c95..b148173 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -1835,7 +1835,8 @@ void VCLXToolkit::callFocusListeners(::VclSimpleEvent const * pEvent,
                 xNext = pFocus->GetComponentInterface(true);
             css::awt::FocusEvent aAwtEvent(
                 static_cast< css::awt::XWindow * >(pWindow->GetWindowPeer()),
-                pWindow->GetGetFocusFlags(), xNext, false);
+                static_cast<sal_Int16>(pWindow->GetGetFocusFlags()),
+                xNext, false);
             for (::sal_Int32 i = 0; i < aListeners.getLength(); ++i)
             {
                 css::uno::Reference< css::awt::XFocusListener > xListener(
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index f293581..bf49bbe 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -582,7 +582,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
                 {
                     ::com::sun::star::awt::FocusEvent aEvent;
                     aEvent.Source = (::cppu::OWeakObject*)this;
-                    aEvent.FocusFlags = rVclWindowEvent.GetWindow()->GetGetFocusFlags();
+                    aEvent.FocusFlags = static_cast<sal_Int16>(rVclWindowEvent.GetWindow()->GetGetFocusFlags());
                     aEvent.Temporary = sal_False;
                     mpImpl->getFocusListeners().focusGained( aEvent );
                 }
@@ -604,7 +604,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
                 {
                     ::com::sun::star::awt::FocusEvent aEvent;
                     aEvent.Source = (::cppu::OWeakObject*)this;
-                    aEvent.FocusFlags = rVclWindowEvent.GetWindow()->GetGetFocusFlags();
+                    aEvent.FocusFlags = static_cast<sal_Int16>(rVclWindowEvent.GetWindow()->GetGetFocusFlags());
                     aEvent.Temporary = sal_False;
 
                     vcl::Window* pNext = Application::GetFocusWindow();
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index bcb6f06..1b6cc55 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -60,6 +60,7 @@ enum class MouseEventModifiers;
 enum class MouseNotifyEvent;
 enum class ActivateModeFlags;
 enum class DialogControlFlags;
+enum class GetFocusFlags;
 
 namespace com { namespace sun { namespace star {
 
@@ -274,7 +275,7 @@ public:
     ControlPart         mnNativeBackground;
     sal_uInt16          mnWaitCount;
     sal_uInt16          mnPaintFlags;
-    sal_uInt16          mnGetFocusFlags;
+    GetFocusFlags       mnGetFocusFlags;
     sal_uInt16          mnParentClipMode;
     ActivateModeFlags   mnActivateMode;
     DialogControlFlags  mnDlgCtrlFlags;
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 2ee5d5e..9998c22 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2264,7 +2264,7 @@ void RadioButton::ImplUncheckAllOther()
     }
 }
 
-void RadioButton::ImplCallClick( bool bGrabFocus, sal_uInt16 nFocusFlags )
+void RadioButton::ImplCallClick( bool bGrabFocus, GetFocusFlags nFocusFlags )
 {
     mbStateChanged = !mbChecked;
     mbChecked = true;
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 6ff15da..e83ae50 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1901,7 +1901,7 @@ void Edit::GetFocus()
 
         SelectionOptions nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
         if ( !( GetStyle() & (WB_NOHIDESELECTION|WB_READONLY) )
-                && ( GetGetFocusFlags() & (GETFOCUS_INIT|GETFOCUS_TAB|GETFOCUS_CURSOR|GETFOCUS_MNEMONIC) ) )
+                && ( GetGetFocusFlags() & (GetFocusFlags::Init|GetFocusFlags::Tab|GetFocusFlags::Cursor|GetFocusFlags::Mnemonic) ) )
         {
             if ( nSelOptions & SelectionOptions::ShowFirst )
             {
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index fc3cad5..76b9e39 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -646,7 +646,7 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId )
             sal_uInt16  n = 0;
             vcl::Window* pFirstChild = pPage->ImplGetDlgWindow( n, GetDlgWindowType::First );
             if ( pFirstChild )
-                pFirstChild->ImplControlFocus( GETFOCUS_INIT );
+                pFirstChild->ImplControlFocus( GetFocusFlags::Init );
             else
                 GrabFocus();
         }
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index a58c625..f4250be 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1084,7 +1084,7 @@ void Dialog::GrabFocusToFirstControl()
         pFocusControl = ImplGetDlgWindow( n, GetDlgWindowType::First );
     }
     if ( pFocusControl )
-        pFocusControl->ImplControlFocus( GETFOCUS_INIT );
+        pFocusControl->ImplControlFocus( GetFocusFlags::Init );
 }
 
 void Dialog::GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder, sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index ece10d9..5cd0706 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -474,9 +474,9 @@ vcl::Window* ImplFindAccelWindow( vcl::Window* pParent, sal_uInt16& rIndex, sal_
 
 namespace vcl {
 
-void Window::ImplControlFocus( sal_uInt16 nFlags )
+void Window::ImplControlFocus( GetFocusFlags nFlags )
 {
-    if ( nFlags & GETFOCUS_MNEMONIC )
+    if ( nFlags & GetFocusFlags::Mnemonic )
     {
         if ( GetType() == WINDOW_RADIOBUTTON )
         {
@@ -488,7 +488,7 @@ void Window::ImplControlFocus( sal_uInt16 nFlags )
         else
         {
             ImplGrabFocus( nFlags );
-            if ( nFlags & GETFOCUS_UNIQUEMNEMONIC )
+            if ( nFlags & GetFocusFlags::UniqueMnemonic )
             {
                 if ( GetType() == WINDOW_CHECKBOX )
                     static_cast<CheckBox*>(this)->ImplCheck();
@@ -543,7 +543,7 @@ namespace
 
             if (isSuitableDestination(pWindow))
             {
-                pWindow->ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_FORWARD );
+                pWindow->ImplControlFocus( GetFocusFlags::Cursor | GetFocusFlags::Forward );
                 return true;
             }
         }
@@ -554,7 +554,7 @@ namespace
 
             if (isSuitableDestination(pWindow))
             {
-                pWindow->ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_FORWARD );
+                pWindow->ImplControlFocus( GetFocusFlags::Cursor | GetFocusFlags::Forward );
                 return true;
             }
         }
@@ -642,18 +642,18 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
         if ( bKeyInput && !pButtonWindow && (nDlgCtrlFlags & DialogControlFlags::Return) )
         {
             GetDlgWindowType nType;
-            sal_uInt16  nGetFocusFlags = GETFOCUS_TAB;
+            GetFocusFlags    nGetFocusFlags = GetFocusFlags::Tab;
             sal_uInt16  nNewIndex;
             sal_uInt16  iStart;
             if ( aKeyCode.IsShift() )
             {
                 nType = GetDlgWindowType::Prev;
-                nGetFocusFlags |= GETFOCUS_BACKWARD;
+                nGetFocusFlags |= GetFocusFlags::Backward;
             }
             else
             {
                 nType = GetDlgWindowType::Next;
-                nGetFocusFlags |= GETFOCUS_FORWARD;
+                nGetFocusFlags |= GetFocusFlags::Forward;
             }
             iStart = i;
             pTempWindow = ImplGetDlgWindow( i, nType, nFormStart, nFormEnd, &nNewIndex );
@@ -665,12 +665,12 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
                     if ( nType == GetDlgWindowType::Prev )
                     {
                         if ( nNewIndex > iStart )
-                            nGetFocusFlags |= GETFOCUS_AROUND;
+                            nGetFocusFlags |= GetFocusFlags::Around;
                     }
                     else
                     {
                         if ( nNewIndex < iStart )
-                            nGetFocusFlags |= GETFOCUS_AROUND;
+                            nGetFocusFlags |= GetFocusFlags::Around;
                     }
                     pTempWindow->ImplControlFocus( nGetFocusFlags );
                     return true;
@@ -690,11 +690,11 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
                 NotifyEvent aNEvt1( MouseNotifyEvent::LOSEFOCUS, pSWindow );
                 if ( !ImplCallPreNotify( aNEvt1 ) )
                     pSWindow->CompatLoseFocus();
-                pSWindow->mpWindowImpl->mnGetFocusFlags = nGetFocusFlags | GETFOCUS_AROUND;
+                pSWindow->mpWindowImpl->mnGetFocusFlags = nGetFocusFlags | GetFocusFlags::Around;
                 NotifyEvent aNEvt2( MouseNotifyEvent::GETFOCUS, pSWindow );
                 if ( !ImplCallPreNotify( aNEvt2 ) )
                     pSWindow->CompatGetFocus();
-                pSWindow->mpWindowImpl->mnGetFocusFlags = 0;
+                pSWindow->mpWindowImpl->mnGetFocusFlags = GetFocusFlags::NONE;
                 return true;
             }
         }
@@ -732,7 +732,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
             if ( !aKeyCode.IsMod2() )
             {
                 GetDlgWindowType nType;
-                sal_uInt16  nGetFocusFlags = GETFOCUS_TAB;
+                GetFocusFlags    nGetFocusFlags = GetFocusFlags::Tab;
                 sal_uInt16  nNewIndex;
                 bool        bFormular = false;
 
@@ -807,12 +807,12 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
                         if ( aKeyCode.IsShift() )
                         {
                             nType = GetDlgWindowType::Prev;
-                            nGetFocusFlags |= GETFOCUS_BACKWARD;
+                            nGetFocusFlags |= GetFocusFlags::Backward;
                         }
                         else
                         {
                             nType = GetDlgWindowType::Next;
-                            nGetFocusFlags |= GETFOCUS_FORWARD;
+                            nGetFocusFlags |= GetFocusFlags::Forward;
                         }
                         vcl::Window* pWindow = ImplGetDlgWindow( i, nType, nFormStart, nFormEnd, &nNewIndex );
                         // if this is the same window, simulate a Get/LoseFocus,
@@ -822,11 +822,11 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
                             NotifyEvent aNEvt1( MouseNotifyEvent::LOSEFOCUS, pSWindow );
                             if ( !ImplCallPreNotify( aNEvt1 ) )
                                 pSWindow->CompatLoseFocus();
-                            pSWindow->mpWindowImpl->mnGetFocusFlags = nGetFocusFlags | GETFOCUS_AROUND;
+                            pSWindow->mpWindowImpl->mnGetFocusFlags = nGetFocusFlags | GetFocusFlags::Around;
                             NotifyEvent aNEvt2( MouseNotifyEvent::GETFOCUS, pSWindow );
                             if ( !ImplCallPreNotify( aNEvt2 ) )
                                 pSWindow->CompatGetFocus();
-                            pSWindow->mpWindowImpl->mnGetFocusFlags = 0;
+                            pSWindow->mpWindowImpl->mnGetFocusFlags = GetFocusFlags::NONE;
                             return true;
                         }
                         else if ( pWindow )
@@ -835,12 +835,12 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
                             if ( nType == GetDlgWindowType::Prev )
                             {
                                 if ( nNewIndex > i )
-                                    nGetFocusFlags |= GETFOCUS_AROUND;
+                                    nGetFocusFlags |= GetFocusFlags::Around;
                             }
                             else
                             {
                                 if ( nNewIndex < i )
-                                    nGetFocusFlags |= GETFOCUS_AROUND;
+                                    nGetFocusFlags |= GetFocusFlags::Around;
                             }
                             pWindow->ImplControlFocus( nGetFocusFlags );
                             return true;
@@ -868,7 +868,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
                         if (isSuitableDestination(pWindow))
                         {
                             if ( pWindow != pSWindow )
-                                pWindow->ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_BACKWARD );
+                                pWindow->ImplControlFocus( GetFocusFlags::Cursor | GetFocusFlags::Backward );
                             return true;
                         }
 
@@ -898,7 +898,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
 
                     if (isSuitableDestination(pWindow))
                     {
-                        pWindow->ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_BACKWARD );
+                        pWindow->ImplControlFocus( GetFocusFlags::Cursor | GetFocusFlags::Backward );
                         return true;
                     }
 
@@ -914,9 +914,9 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
                 pSWindow = ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd );
                 if ( pSWindow )
                 {
-                    sal_uInt16 nGetFocusFlags = GETFOCUS_MNEMONIC;
+                    GetFocusFlags nGetFocusFlags = GetFocusFlags::Mnemonic;
                     if ( pSWindow == ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd ) )
-                        nGetFocusFlags |= GETFOCUS_UNIQUEMNEMONIC;
+                        nGetFocusFlags |= GetFocusFlags::UniqueMnemonic;
                     pSWindow->ImplControlFocus( nGetFocusFlags );
                     return true;
                 }
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index 1167ac4..9114ac0 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -195,7 +195,7 @@ static bool IsWindowFocused(const WindowImpl& rWinImpl)
     return false;
 }
 
-void Window::ImplGrabFocus( sal_uInt16 nFlags )
+void Window::ImplGrabFocus( GetFocusFlags nFlags )
 {
     // #143570# no focus for destructing windows
     if( !mpWindowImpl || mpWindowImpl->mbInDispose )
@@ -381,7 +381,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
                 if( pOldFocusWindow &&
                     ! aOldFocusDel.IsDead() &&
                     ( pOldFocusWindow->GetDialogControlFlags() & DialogControlFlags::FloatWinPopupModeEndCancel ) )
-                    mpWindowImpl->mnGetFocusFlags |= GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL;
+                    mpWindowImpl->mnGetFocusFlags |= GetFocusFlags::FloatWinPopupModeEndCancel;
                 NotifyEvent aNEvt( MouseNotifyEvent::GETFOCUS, this );
                 if ( !ImplCallPreNotify( aNEvt ) && !aDogTag.IsDead() )
                     CompatGetFocus();
@@ -389,7 +389,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
                     ImplCallActivateListeners( (pOldFocusWindow && ! aOldFocusDel.IsDead()) ? pOldFocusWindow : NULL );
                 if( !aDogTag.IsDead() )
                 {
-                    mpWindowImpl->mnGetFocusFlags = 0;
+                    mpWindowImpl->mnGetFocusFlags = GetFocusFlags::NONE;
                     mpWindowImpl->mbInFocusHdl = false;
                 }
             }
@@ -399,7 +399,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
     }
 }
 
-void Window::ImplGrabFocusToDocument( sal_uInt16 nFlags )
+void Window::ImplGrabFocusToDocument( GetFocusFlags nFlags )
 {
     vcl::Window *pWin = this;
     while( pWin )
diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx
index 46aa4e1..9b4767e 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -80,7 +80,7 @@ static void ImplTaskPaneListGrabFocus( vcl::Window *pWindow, bool bForward )
     // that can deal with the focus
     if( pWindow->ImplIsFloatingWindow() && pWindow->GetWindow( GetWindowType::FirstChild ) )
         pWindow = pWindow->GetWindow( GetWindowType::FirstChild );
-    pWindow->ImplGrabFocus( GETFOCUS_F6 | (bForward ? GETFOCUS_FORWARD : GETFOCUS_BACKWARD));
+    pWindow->ImplGrabFocus( GetFocusFlags::F6 | (bForward ? GetFocusFlags::Forward : GetFocusFlags::Backward));
 }
 
 TaskPaneList::TaskPaneList()
@@ -178,7 +178,7 @@ bool TaskPaneList::HandleKeyEvent(const KeyEvent& rKeyEvent)
                 // Ctrl-F6 goes directly to the document
                 if( !pWin->IsDialog() && aKeyCode.IsMod1() && !aKeyCode.IsShift() )
                 {
-                    pWin->ImplGrabFocusToDocument( GETFOCUS_F6 );
+                    pWin->ImplGrabFocusToDocument( GetFocusFlags::F6 );
                     return true;
                 }
 
@@ -204,7 +204,7 @@ bool TaskPaneList::HandleKeyEvent(const KeyEvent& rKeyEvent)
 
                     // we did not find another taskpane, so
                     // put focus back into document
-                    pWin->ImplGrabFocusToDocument( GETFOCUS_F6 | (bForward ? GETFOCUS_FORWARD : GETFOCUS_BACKWARD));
+                    pWin->ImplGrabFocusToDocument( GetFocusFlags::F6 | (bForward ? GetFocusFlags::Forward : GetFocusFlags::Backward));
                 }
 
                 return true;
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 59bf347..53ef7fa 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4379,7 +4379,7 @@ bool ToolBox::Notify( NotifyEvent& rNEvt )
                 ImplChangeHighlight( ImplGetItem( mnLastFocusItemId ) );
                 mnLastFocusItemId = 0;
             }
-            else if( (GetGetFocusFlags() & (GETFOCUS_BACKWARD|GETFOCUS_TAB) ) == (GETFOCUS_BACKWARD|GETFOCUS_TAB))
+            else if( (GetGetFocusFlags() & (GetFocusFlags::Backward|GetFocusFlags::Tab) ) == (GetFocusFlags::Backward|GetFocusFlags::Tab))
                 // Shift-TAB was pressed in the parent
                 ImplChangeHighlightUpDn( false );
             else
@@ -4993,7 +4993,7 @@ bool ToolBox::ImplActivateItem( vcl::KeyCode aKeyCode )
         {
             ImplHideFocus();
             mbChangingHighlight = true;  // avoid focus change due to loss of focus
-            pToolItem->mpWindow->ImplControlFocus( GETFOCUS_TAB );
+            pToolItem->mpWindow->ImplControlFocus( GetFocusFlags::Tab );
             mbChangingHighlight = false;
         }
         else
@@ -5249,7 +5249,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
                 vcl::Window *pFocusWindow = Application::GetFocusWindow();
                 ImplHideFocus();
                 mbChangingHighlight = true;  // avoid focus change due to loss of focus
-                pItem->mpWindow->ImplControlFocus( GETFOCUS_TAB );
+                pItem->mpWindow->ImplControlFocus( GetFocusFlags::Tab );
                 mbChangingHighlight = false;
                 if( pFocusWindow != Application::GetFocusWindow() )
                     Application::GetFocusWindow()->KeyInput( rKEvt );
@@ -5275,7 +5275,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
         sal_uInt16 n = 0;
         vcl::Window *pFocusControl = pParent->ImplGetDlgWindow( n, GetDlgWindowType::First );
         if ( pFocusControl && pFocusControl != this )
-            pFocusControl->ImplControlFocus( GETFOCUS_INIT );
+            pFocusControl->ImplControlFocus( GetFocusFlags::Init );
     }
 
     mnKeyModifier = 0;
@@ -5354,7 +5354,7 @@ sal_uInt16 ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vecto
 void ToolBox::ChangeHighlight( sal_uInt16 nPos )
 {
     if ( nPos < GetItemCount() ) {
-        ImplGrabFocus( 0 );
+        ImplGrabFocus( GetFocusFlags::NONE );
         ImplChangeHighlight ( ImplGetItem ( GetItemId ( (sal_uInt16) nPos ) ), false );
     }
 }
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index c93e6c0..a26e42e 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -643,7 +643,7 @@ WindowImpl::WindowImpl( WindowType nType )
     mnExtendedStyle                     = 0;                         // extended style (init in ImplInitWindow)
     mnPrevExtendedStyle                 = 0;                         // prevstyle (set in SetExtendedStyle)
     mnType                              = nType;                     // type
-    mnGetFocusFlags                     = 0;                         // Flags fuer GetFocus()-Aufruf
+    mnGetFocusFlags                     = GetFocusFlags::NONE;       // Flags fuer GetFocus()-Aufruf
     mnWaitCount                         = 0;                         // Wait-Count (>1 == Warte-MousePointer)
     mnPaintFlags                        = 0;                         // Flags for ImplCallPaint
     mnParentClipMode                    = 0;                         // Flags for Parent-ClipChildren-Mode
@@ -3127,7 +3127,7 @@ void Window::SetUpdateMode( bool bUpdate )
 
 void Window::GrabFocus()
 {
-    ImplGrabFocus( 0 );
+    ImplGrabFocus( GetFocusFlags::NONE );
 }
 
 bool Window::HasFocus() const
@@ -3137,7 +3137,7 @@ bool Window::HasFocus() const
 
 void Window::GrabFocusToDocument()
 {
-    ImplGrabFocusToDocument(0);
+    ImplGrabFocusToDocument(GetFocusFlags::NONE);
 }
 
 void Window::SetFakeFocus( bool bFocus )
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 99fd9ce..7b2974e 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1330,7 +1330,7 @@ bool Window::IsActive() const
     return mpWindowImpl->mbActive;
 }
 
-sal_uInt16 Window::GetGetFocusFlags() const
+GetFocusFlags Window::GetGetFocusFlags() const
 {
     return mpWindowImpl->mnGetFocusFlags;
 }


More information about the Libreoffice-commits mailing list