[Libreoffice-commits] core.git: 9 commits - basctl/source canvas/source chart2/source cui/source dbaccess/source drawinglayer/source editeng/source extensions/source filter/source framework/inc framework/source include/svtools include/svx include/unotools include/vcl oox/source reportdesign/source sc/inc sc/qa sc/source sd/source sfx2/source starmath/source svl/source svtools/source svx/source sw/source toolkit/source unotools/source vcl/headless vcl/inc vcl/opengl vcl/qa vcl/source vcl/unx vcl/win vcl/workben xmloff/source xmlsecurity/source

Noel Grandin noel at peralex.com
Wed May 6 00:07:54 PDT 2015


 basctl/source/basicide/baside2b.cxx                            |    2 
 canvas/source/directx/dx_config.cxx                            |    2 
 canvas/source/vcl/canvasbitmaphelper.cxx                       |    2 
 canvas/source/vcl/canvashelper.cxx                             |    2 
 canvas/source/vcl/canvashelper_texturefill.cxx                 |    4 
 chart2/source/tools/CharacterProperties.cxx                    |    6 
 cui/source/dialogs/colorpicker.cxx                             |    2 
 cui/source/dialogs/cuigrfflt.cxx                               |    2 
 cui/source/options/optgenrl.cxx                                |   58 +-
 cui/source/tabpages/align.cxx                                  |    2 
 cui/source/tabpages/autocdlg.cxx                               |    2 
 cui/source/tabpages/border.cxx                                 |    4 
 cui/source/tabpages/numpages.cxx                               |    2 
 dbaccess/source/ui/control/sqledit.cxx                         |    2 
 dbaccess/source/ui/misc/TokenWriter.cxx                        |    2 
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx          |    2 
 drawinglayer/source/primitive2d/graphicprimitive2d.cxx         |    6 
 drawinglayer/source/processor2d/vclprocessor2d.cxx             |    2 
 editeng/source/editeng/editobj.cxx                             |    8 
 editeng/source/editeng/eehtml.cxx                              |    2 
 editeng/source/items/bulitem.cxx                               |    2 
 editeng/source/items/numitem.cxx                               |    2 
 editeng/source/items/textitem.cxx                              |    8 
 extensions/source/bibliography/bibconfig.cxx                   |    2 
 filter/source/graphicfilter/eps/eps.cxx                        |    2 
 filter/source/graphicfilter/icgm/actimpr.cxx                   |    8 
 filter/source/msfilter/escherex.cxx                            |    4 
 filter/source/msfilter/msdffimp.cxx                            |    8 
 framework/inc/classes/filtercache.hxx                          |    4 
 framework/inc/classes/filtercachedata.hxx                      |    4 
 framework/source/fwe/classes/addonsoptions.cxx                 |    2 
 framework/source/uielement/imagebuttontoolbarcontroller.cxx    |    2 
 framework/source/uielement/popuptoolbarcontroller.cxx          |    2 
 include/svtools/grfmgr.hxx                                     |    8 
 include/svx/compressgraphicdialog.hxx                          |    2 
 include/svx/xoutbmp.hxx                                        |    2 
 include/unotools/configitem.hxx                                |   29 -
 include/unotools/configvaluecontainer.hxx                      |   26 -
 include/unotools/fontcfg.hxx                                   |  139 +++---
 include/unotools/fontcvt.hxx                                   |   17 
 include/unotools/fontdefs.hxx                                  |   67 +--
 include/unotools/useroptions.hxx                               |   45 +-
 include/vcl/animate.hxx                                        |    2 
 include/vcl/bitmap.hxx                                         |   45 +-
 include/vcl/bitmapex.hxx                                       |    8 
 include/vcl/gdimtf.hxx                                         |    7 
 include/vcl/outdev.hxx                                         |    4 
 oox/source/export/drawingml.cxx                                |    4 
 reportdesign/source/core/api/ReportComponent.cxx               |    6 
 sc/inc/optutil.hxx                                             |    2 
 sc/qa/unit/subsequent_export-test.cxx                          |    4 
 sc/source/core/data/docpool.cxx                                |    2 
 sc/source/core/data/stlpool.cxx                                |    8 
 sc/source/core/tool/addincol.cxx                               |    2 
 sc/source/core/tool/autoform.cxx                               |    6 
 sc/source/core/tool/optutil.cxx                                |    2 
 sc/source/filter/excel/xltools.cxx                             |    2 
 sc/source/ui/cctrl/checklistmenu.cxx                           |    4 
 sc/source/ui/dbgui/csvgrid.cxx                                 |    2 
 sc/source/ui/sidebar/CellLineStyleValueSet.cxx                 |    2 
 sc/source/ui/view/cellsh1.cxx                                  |    2 
 sd/source/core/drawdoc4.cxx                                    |    6 
 sd/source/filter/eppt/pptx-text.cxx                            |    2 
 sd/source/ui/func/fuhhconv.cxx                                 |    2 
 sd/source/ui/presenter/PresenterTextView.cxx                   |    8 
 sd/source/ui/presenter/SlideRenderer.cxx                       |    2 
 sd/source/ui/sidebar/LayoutMenu.cxx                            |    4 
 sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx            |    2 
 sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx |    2 
 sd/source/ui/tools/PreviewRenderer.cxx                         |    2 
 sd/source/ui/view/outlview.cxx                                 |    4 
 sfx2/source/doc/graphhelp.cxx                                  |    2 
 sfx2/source/sidebar/TabBar.cxx                                 |    4 
 starmath/source/document.cxx                                   |    8 
 starmath/source/format.cxx                                     |   50 +-
 svl/source/inc/passwordcontainer.hxx                           |    2 
 svl/source/passwordcontainer/syscreds.cxx                      |    2 
 svtools/source/brwbox/editbrowsebox.cxx                        |    2 
 svtools/source/graphic/grfattr.cxx                             |   11 
 svtools/source/graphic/grfmgr.cxx                              |    8 
 svtools/source/graphic/grfmgr2.cxx                             |    8 
 svtools/source/toolpanel/paneltabbar.cxx                       |    4 
 svx/source/dialog/compressgraphicdialog.cxx                    |   12 
 svx/source/dialog/dialcontrol.cxx                              |    2 
 svx/source/dialog/dlgctrl.cxx                                  |    2 
 svx/source/dialog/svxbmpnumvalueset.cxx                        |    2 
 svx/source/dialog/swframeexample.cxx                           |    2 
 svx/source/form/fmcontrollayout.cxx                            |    2 
 svx/source/form/fmshimp.cxx                                    |    2 
 svx/source/form/fmsrccfg.cxx                                   |    2 
 svx/source/gallery2/galobj.cxx                                 |   10 
 svx/source/sdr/contact/viewcontactofgraphic.cxx                |    2 
 svx/source/sidebar/line/LineWidthValueSet.cxx                  |    2 
 svx/source/sidebar/tools/ValueSetWithTextControl.cxx           |    2 
 svx/source/stbctrls/modctrl.cxx                                |    2 
 svx/source/stbctrls/pszctrl.cxx                                |    4 
 svx/source/stbctrls/selctrl.cxx                                |    2 
 svx/source/stbctrls/xmlsecctrl.cxx                             |    2 
 svx/source/stbctrls/zoomsliderctrl.cxx                         |    2 
 svx/source/svdraw/svdetc.cxx                                   |    2 
 svx/source/svdraw/svdmodel.cxx                                 |    6 
 svx/source/svdraw/svdograf.cxx                                 |    2 
 svx/source/svdraw/svdotext.cxx                                 |    2 
 svx/source/unodraw/UnoGraphicExporter.cxx                      |    2 
 svx/source/xoutdev/_xoutbmp.cxx                                |   23 -
 svx/source/xoutdev/xtabdash.cxx                                |    2 
 sw/source/core/bastyp/calc.cxx                                 |    8 
 sw/source/core/doc/DocumentStylePoolManager.cxx                |   62 +-
 sw/source/core/fields/docufld.cxx                              |   40 -
 sw/source/core/graphic/ndgrf.cxx                               |   16 
 sw/source/core/layout/paintfrm.cxx                             |    8 
 sw/source/filter/html/htmlform.cxx                             |    2 
 sw/source/filter/html/htmlforw.cxx                             |    2 
 sw/source/filter/ww8/writerwordglue.cxx                        |    2 
 sw/source/ui/config/optpage.cxx                                |    6 
 sw/source/ui/dbui/dbinsdlg.cxx                                 |    2 
 sw/source/ui/dialog/ascfldlg.cxx                               |    2 
 sw/source/ui/frmdlg/frmpage.cxx                                |    6 
 sw/source/ui/misc/outline.cxx                                  |    2 
 sw/source/uibase/app/docshini.cxx                              |   16 
 sw/source/uibase/config/barcfg.cxx                             |    2 
 sw/source/uibase/config/dbconfig.cxx                           |    2 
 sw/source/uibase/config/fontcfg.cxx                            |   14 
 sw/source/uibase/config/modcfg.cxx                             |   10 
 sw/source/uibase/config/prtopt.cxx                             |    2 
 sw/source/uibase/config/usrpref.cxx                            |    8 
 sw/source/uibase/dbui/mmconfigitem.cxx                         |    2 
 sw/source/uibase/docvw/srcedtw.cxx                             |    4 
 sw/source/uibase/shells/annotsh.cxx                            |    2 
 sw/source/uibase/shells/drwtxtsh.cxx                           |    2 
 sw/source/uibase/uiview/viewling.cxx                           |    2 
 sw/source/uibase/utlui/content.cxx                             |    2 
 sw/source/uibase/utlui/viewlayoutctrl.cxx                      |    2 
 toolkit/source/awt/vclxmenu.cxx                                |    2 
 unotools/source/config/configitem.cxx                          |   14 
 unotools/source/config/configmgr.cxx                           |    2 
 unotools/source/config/configvaluecontainer.cxx                |    8 
 unotools/source/config/eventcfg.cxx                            |    2 
 unotools/source/config/fontcfg.cxx                             |  184 ++++----
 unotools/source/config/useroptions.cxx                         |  163 +++----
 unotools/source/misc/fontcvt.cxx                               |   19 
 unotools/source/misc/fontdefs.cxx                              |   12 
 vcl/headless/svpbmp.cxx                                        |    2 
 vcl/inc/PhysicalFontCollection.hxx                             |    2 
 vcl/inc/PhysicalFontFamily.hxx                                 |    8 
 vcl/inc/headless/svpbmp.hxx                                    |    2 
 vcl/inc/impbmp.hxx                                             |    2 
 vcl/inc/opengl/salbmp.hxx                                      |    4 
 vcl/inc/salbmp.hxx                                             |    3 
 vcl/inc/unx/salbmp.h                                           |    2 
 vcl/opengl/scale.cxx                                           |   36 -
 vcl/qa/cppunit/BitmapTest.cxx                                  |    2 
 vcl/qa/cppunit/complextext.cxx                                 |    2 
 vcl/qa/cppunit/graphicfilter/filters-test.cxx                  |    2 
 vcl/source/app/dbggui.cxx                                      |    2 
 vcl/source/font/PhysicalFontCollection.cxx                     |  220 +++++-----
 vcl/source/font/PhysicalFontFamily.cxx                         |   28 -
 vcl/source/gdi/animate.cxx                                     |    8 
 vcl/source/gdi/bitmap.cxx                                      |    8 
 vcl/source/gdi/bitmap3.cxx                                     |   40 -
 vcl/source/gdi/bitmapex.cxx                                    |   10 
 vcl/source/gdi/configsettings.cxx                              |    2 
 vcl/source/gdi/font.cxx                                        |   24 -
 vcl/source/gdi/gdimtf.cxx                                      |    8 
 vcl/source/gdi/impbmp.cxx                                      |    2 
 vcl/source/gdi/impgraph.cxx                                    |    2 
 vcl/source/gdi/pdfwriter_impl2.cxx                             |   10 
 vcl/source/gdi/print.cxx                                       |    8 
 vcl/source/helper/canvasbitmap.cxx                             |    2 
 vcl/source/outdev/bitmap.cxx                                   |    8 
 vcl/source/outdev/font.cxx                                     |   96 ++--
 vcl/source/outdev/mask.cxx                                     |    4 
 vcl/source/outdev/rect.cxx                                     |    8 
 vcl/source/outdev/transparent.cxx                              |    8 
 vcl/source/window/menu.cxx                                     |    4 
 vcl/source/window/printdlg.cxx                                 |    2 
 vcl/source/window/toolbox2.cxx                                 |    4 
 vcl/source/window/window2.cxx                                  |    6 
 vcl/unx/generic/dtrans/config.cxx                              |    2 
 vcl/unx/generic/gdi/salbmp.cxx                                 |    2 
 vcl/win/source/gdi/salgdi3.cxx                                 |    2 
 vcl/workben/vcldemo.cxx                                        |    8 
 xmloff/source/core/xmlimp.cxx                                  |    4 
 xmlsecurity/source/dialogs/certificateviewer.cxx               |    2 
 184 files changed, 1067 insertions(+), 1009 deletions(-)

New commits:
commit 662fc8eaa94d766104bced33c18b4718722c6692
Author: Noel Grandin <noel at peralex.com>
Date:   Wed May 6 09:00:50 2015 +0200

    convert BMP_MIRROR constants to scoped enum
    
    and fix bug in svx/source/xoutdev/_xoutbmp.cxx,XOutBitmap::MirrorGraphic
    where it was not correctly translating between different flags types.
    
    Change-Id: I78b4965544da2aa54b67ec18307fa54c8ffc3aee

diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 77b0853..cf628c7 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -852,8 +852,8 @@ namespace vclcanvas
 
                         // setup GraphicAttr
                         aGrfAttr.SetMirrorFlags(
-                            ( aScale.getX() < 0.0 ? BMP_MIRROR_HORZ : 0 ) |
-                            ( aScale.getY() < 0.0 ? BMP_MIRROR_VERT : 0 ) );
+                            ( aScale.getX() < 0.0 ? BmpMirrorFlags::Horizontal : BmpMirrorFlags::NONE ) |
+                            ( aScale.getY() < 0.0 ? BmpMirrorFlags::Vertical : BmpMirrorFlags::NONE ) );
                         aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround( nRotate*10.0 )) );
 
                         pGrfObj.reset( new GraphicObject( aBmpEx ) );
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 5d61f21..96bfff0 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -1092,7 +1092,7 @@ ColorPickerDialog::ColorPickerDialog( vcl::Window* pParent, sal_Int32 nColor, sa
     mpFISliderLeft->Show(true);
 
     BitmapEx aTmpBmp( maSliderImage.GetBitmapEx() );
-    aTmpBmp.Mirror( BMP_MIRROR_HORZ );
+    aTmpBmp.Mirror( BmpMirrorFlags::Horizontal );
     mpFISliderRight->SetImage( Image( aTmpBmp  ) );
 
     Size aSize( maSliderImage.GetSizePixel() );
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index 7374873..4a0607a 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -53,8 +53,8 @@ namespace drawinglayer
             if(getGraphicAttr().IsMirrored())
             {
                 // content needs mirroring
-                const bool bHMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_HORZ);
-                const bool bVMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_VERT);
+                const bool bHMirr(getGraphicAttr().GetMirrorFlags() & BmpMirrorFlags::Horizontal);
+                const bool bVMirr(getGraphicAttr().GetMirrorFlags() & BmpMirrorFlags::Vertical);
 
                 // mirror by applying negative scale to the unit primitive and
                 // applying the object transformation on it.
@@ -76,7 +76,7 @@ namespace drawinglayer
 
             aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
             aSuppressGraphicAttr.SetRotation(0);
-            aSuppressGraphicAttr.SetMirrorFlags(0);
+            aSuppressGraphicAttr.SetMirrorFlags(BmpMirrorFlags::NONE);
             aSuppressGraphicAttr.SetTransparency(0);
 
             const GraphicObject& rGraphicObject = getGraphicObject();
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx
index 7d1dd7c..1e73c13 100644
--- a/filter/source/graphicfilter/icgm/actimpr.cxx
+++ b/filter/source/graphicfilter/icgm/actimpr.cxx
@@ -562,12 +562,12 @@ void CGMImpressOutAct::DrawBitmap( CGMBitmapDescriptor* pBmpDesc )
         double fdx = pBmpDesc->mndx;
         double fdy = pBmpDesc->mndy;
 
-        sal_uInt32  nMirr = BMP_MIRROR_NONE;
+        BmpMirrorFlags nMirr = BmpMirrorFlags::NONE;
         if ( pBmpDesc->mbVMirror )
-            nMirr |= BMP_MIRROR_VERT;
+            nMirr |= BmpMirrorFlags::Vertical;
         if ( pBmpDesc->mbHMirror )
-            nMirr |= BMP_MIRROR_HORZ;
-        if ( nMirr != BMP_MIRROR_NONE )
+            nMirr |= BmpMirrorFlags::Horizontal;
+        if ( nMirr != BmpMirrorFlags::NONE )
             pBmpDesc->mpBitmap->Mirror( nMirr );
 
         mpCGM->ImplMapPoint( aOrigin );
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 9366ec2..6cf97f9 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1640,7 +1640,7 @@ bool EscherPropertyContainer::CreateGraphicProperties(
 
                 if(bMirrored)
                 {
-                    pGraphicAttr->SetMirrorFlags(BMP_MIRROR_HORZ);
+                    pGraphicAttr->SetMirrorFlags(BmpMirrorFlags::Horizontal);
                 }
 
                 // #121074#
@@ -4122,7 +4122,7 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject
             {
                 SvMemoryStream aSt( sizeof( GraphicAttr ) );
                 aSt.WriteUInt16( pGraphicAttr->GetDrawMode() )
-                   .WriteUInt32( pGraphicAttr->GetMirrorFlags() )
+                   .WriteUInt32( static_cast<sal_uInt32>(pGraphicAttr->GetMirrorFlags()) )
                    .WriteInt32( pGraphicAttr->GetLeftCrop() )
                    .WriteInt32( pGraphicAttr->GetTopCrop() )
                    .WriteInt32( pGraphicAttr->GetRightCrop() )
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 8935ae4..8e757f7 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1224,12 +1224,12 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream
                 {
                     aBitmap.Rotate( nFix16Angle / 10, rShadeColors[ 0 ].aColor );
 
-                    sal_uLong nMirrorFlags = BMP_MIRROR_NONE;
+                    BmpMirrorFlags nMirrorFlags = BmpMirrorFlags::NONE;
                     if ( rObjData.nSpFlags & SP_FFLIPV )
-                        nMirrorFlags |= BMP_MIRROR_VERT;
+                        nMirrorFlags |= BmpMirrorFlags::Vertical;
                     if ( rObjData.nSpFlags & SP_FFLIPH )
-                        nMirrorFlags |= BMP_MIRROR_HORZ;
-                    if ( nMirrorFlags != BMP_MIRROR_NONE )
+                        nMirrorFlags |= BmpMirrorFlags::Horizontal;
+                    if ( nMirrorFlags != BmpMirrorFlags::NONE )
                         aBitmap.Mirror( nMirrorFlags );
                 }
             }
diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 35d63bc..089b69d 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -82,7 +82,7 @@ class SVT_DLLPUBLIC GraphicAttr
 private:
 
     double          mfGamma;
-    sal_uInt32      mnMirrFlags;
+    BmpMirrorFlags  mnMirrFlags;
     long            mnLeftCrop;
     long            mnTopCrop;
     long            mnRightCrop;
@@ -108,8 +108,8 @@ public:
     void            SetDrawMode( GraphicDrawMode eDrawMode ) { meDrawMode = eDrawMode; }
     GraphicDrawMode GetDrawMode() const { return meDrawMode; }
 
-    void            SetMirrorFlags( sal_uLong nMirrFlags ) { mnMirrFlags = nMirrFlags; }
-    sal_uLong       GetMirrorFlags() const { return mnMirrFlags; }
+    void            SetMirrorFlags( BmpMirrorFlags nMirrFlags ) { mnMirrFlags = nMirrFlags; }
+    BmpMirrorFlags  GetMirrorFlags() const { return mnMirrFlags; }
 
     void            SetCrop( long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM, long nBottom_100TH_MM )
                     {
@@ -149,7 +149,7 @@ public:
     sal_uInt8       GetTransparency() const { return mcTransparency; }
 
     bool            IsSpecialDrawMode() const { return( meDrawMode != GRAPHICDRAWMODE_STANDARD ); }
-    bool            IsMirrored() const { return( mnMirrFlags != 0UL ); }
+    bool            IsMirrored() const { return mnMirrFlags != BmpMirrorFlags::NONE; }
     bool            IsCropped() const
                     {
                         return( mnLeftCrop != 0 || mnTopCrop != 0 ||
diff --git a/include/svx/xoutbmp.hxx b/include/svx/xoutbmp.hxx
index 0f80221..25ba5e4 100644
--- a/include/svx/xoutbmp.hxx
+++ b/include/svx/xoutbmp.hxx
@@ -49,7 +49,7 @@ public:
 
     static GraphicFilter* pGrfFilter;
 
-    static Graphic      MirrorGraphic( const Graphic& rGraphic, const sal_uIntPtr nMirrorFlags );
+    static Graphic      MirrorGraphic( const Graphic& rGraphic, const BmpMirrorFlags nMirrorFlags );
     static Animation    MirrorAnimation( const Animation& rAnimation, bool bHMirr, bool bVMirr );
     static sal_uInt16   WriteGraphic( const Graphic& rGraphic, OUString& rFileName,
                                       const OUString& rFilterName, const sal_uIntPtr nFlags = 0L,
diff --git a/include/vcl/animate.hxx b/include/vcl/animate.hxx
index 74a527f..1f2a6b8 100644
--- a/include/vcl/animate.hxx
+++ b/include/vcl/animate.hxx
@@ -183,7 +183,7 @@ public:
                         BmpReduce eReduce = BMP_REDUCE_SIMPLE );
 
     bool            Invert();
-    bool            Mirror( sal_uLong nMirrorFlags );
+    bool            Mirror( BmpMirrorFlags nMirrorFlags );
     bool            Adjust(
                         short nLuminancePercent = 0,
                         short nContrastPercent = 0,
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index be7d4eb..5e75b69 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -28,10 +28,18 @@
 #include <vcl/mapmod.hxx>
 #include <vcl/region.hxx>
 #include <vcl/scopedbitmapaccess.hxx>
+#include <o3tl/typed_flags_set.hxx>
 
-#define BMP_MIRROR_NONE             0x00000000UL
-#define BMP_MIRROR_HORZ             0x00000001UL
-#define BMP_MIRROR_VERT             0x00000002UL
+enum class BmpMirrorFlags
+{
+    NONE             = 0x00,
+    Horizontal       = 0x01,
+    Vertical         = 0x02,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<BmpMirrorFlags> : is_typed_flags<BmpMirrorFlags, 0x03> {};
+}
 
 
 enum class BmpScaleFlag
@@ -534,7 +542,7 @@ public:
 
         @return true, if the operation was completed successfully.
      */
-    bool                    Mirror( sal_uLong nMirrorFlags );
+    bool                    Mirror( BmpMirrorFlags nMirrorFlags );
 
     /** Scale the bitmap
 
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index d7b08e0..13afdcd 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -223,7 +223,7 @@ public:
 
         @return true, if the operation was completed successfully.
      */
-    bool                Mirror( sal_uLong nMirrorFlags );
+    bool                Mirror( BmpMirrorFlags nMirrorFlags );
 
     /** Scale the bitmap
 
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index bc8da88..8baa116 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -53,9 +53,6 @@ class Gradient;
 #define METAFILE_LABEL_NOTFOUND         GDI_METAFILE_LABEL_NOTFOUND
 #endif
 
-#define MTF_MIRROR_HORZ             0x00000001UL
-#define MTF_MIRROR_VERT             0x00000002UL
-
 enum MtfConversion
 {
     MTF_CONVERSION_NONE = 0,
@@ -132,7 +129,7 @@ public:
     bool            operator!=( const GDIMetaFile& rMtf ) const { return !( *this == rMtf ); }
 
     void            Clear();
-    bool            Mirror( sal_uLong nMirrorFlags );
+    bool            Mirror( BmpMirrorFlags nMirrorFlags );
     void            Move( long nX, long nY );
     // additional Move method getting specifics how to handle MapMode( MAP_PIXEL )
     void            Move( long nX, long nY, long nDPIX, long nDPIY );
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index ea284f2..66bcccb 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -245,7 +245,7 @@ namespace vcl {
     class FontInfo;
 }
 
-sal_uLong AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix );
+BmpMirrorFlags AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix );
 void AdjustTwoRect( SalTwoRect& rTwoRect, const Rectangle& rValidSrcRect );
 
 extern const sal_uLong nVCLRLut[ 6 ];
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx
index f5aa025..3acd0bf 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -554,7 +554,7 @@ void LayoutMenu::Fill()
                 aBmp.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
 
             if (bRightToLeft && (WritingMode_TB_RL != pInfo->meWritingMode))
-                aBmp.Mirror (BMP_MIRROR_HORZ);
+                aBmp.Mirror (BmpMirrorFlags::Horizontal);
 
             InsertItem(i, Image(aBmp), SdResId (pInfo->mnStrResId));
             SetItemData (i, new AutoLayout(pInfo->maAutoLayout));
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index d206ca7..f250efe 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -333,7 +333,7 @@ namespace svt
         if ( bNeedMirror )
         {
             BitmapEx aBitmap( aImage.GetBitmapEx() );
-            aBitmap.Mirror( BMP_MIRROR_HORZ );
+            aBitmap.Mirror( BmpMirrorFlags::Horizontal );
             aImage = Image( aBitmap );
         }
         return aImage;
diff --git a/svtools/source/graphic/grfattr.cxx b/svtools/source/graphic/grfattr.cxx
index 29e5e50..26001ee 100644
--- a/svtools/source/graphic/grfattr.cxx
+++ b/svtools/source/graphic/grfattr.cxx
@@ -27,7 +27,7 @@
 
 GraphicAttr::GraphicAttr() :
     mfGamma         ( 1.0 ),
-    mnMirrFlags     ( 0 ),
+    mnMirrFlags     ( BmpMirrorFlags::NONE ),
     mnLeftCrop      ( 0 ),
     mnTopCrop       ( 0 ),
     mnRightCrop     ( 0 ),
@@ -76,10 +76,11 @@ bool GraphicAttr::operator==( const GraphicAttr& rAttr ) const
 SvStream& ReadGraphicAttr( SvStream& rIStm, GraphicAttr& rAttr )
 {
     VersionCompat   aCompat( rIStm, StreamMode::READ );
-    sal_uInt32      nTmp32;
-    sal_uInt16          nTmp16;
+    sal_uInt32      nTmp32, nTmpMirrFlags;
+    sal_uInt16      nTmp16;
 
-    rIStm.ReadUInt32( nTmp32 ).ReadUInt32( nTmp32 ).ReadDouble( rAttr.mfGamma ).ReadUInt32( rAttr.mnMirrFlags ).ReadUInt16( rAttr.mnRotate10 );
+    rIStm.ReadUInt32( nTmp32 ).ReadUInt32( nTmp32 ).ReadDouble( rAttr.mfGamma ).ReadUInt32( nTmpMirrFlags ).ReadUInt16( rAttr.mnRotate10 );
+    rAttr.mnMirrFlags = static_cast<BmpMirrorFlags>(nTmpMirrFlags);
     rIStm.ReadInt16( rAttr.mnContPercent ).ReadInt16( rAttr.mnLumPercent ).ReadInt16( rAttr.mnRPercent ).ReadInt16( rAttr.mnGPercent ).ReadInt16( rAttr.mnBPercent );
     rIStm.ReadCharAsBool( rAttr.mbInvert ).ReadUChar( rAttr.mcTransparency ).ReadUInt16( nTmp16 );
     rAttr.meDrawMode = (GraphicDrawMode) nTmp16;
@@ -106,7 +107,7 @@ SvStream& WriteGraphicAttr( SvStream& rOStm, const GraphicAttr& rAttr )
 
     rOStm.WriteUInt32( nTmp32 ).WriteUInt32( nTmp32 );
     rOStm.WriteDouble( rAttr.mfGamma );
-    rOStm.WriteUInt32( rAttr.mnMirrFlags ).WriteUInt16( rAttr.mnRotate10 );
+    rOStm.WriteUInt32( static_cast<sal_uInt32>(rAttr.mnMirrFlags) ).WriteUInt16( rAttr.mnRotate10 );
     rOStm.WriteInt16( rAttr.mnContPercent ).WriteInt16( rAttr.mnLumPercent ).WriteInt16( rAttr.mnRPercent ).WriteInt16( rAttr.mnGPercent ).WriteInt16( rAttr.mnBPercent );
     rOStm.WriteBool( rAttr.mbInvert ).WriteUChar( rAttr.mcTransparency ).WriteUInt16( rAttr.meDrawMode );
     rOStm.WriteInt32( rAttr.mnLeftCrop )
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 4d60d73..f6eae59 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -303,7 +303,7 @@ bool GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz
         if( aSize100.Width() > 0 && aSize100.Height() > 0 && nTotalWidth > 0 && nTotalHeight > 0 )
         {
             double fScale = (double) aSize100.Width() / nTotalWidth;
-            const long nNewLeft = -FRound( ( ( pAttr->GetMirrorFlags() & BMP_MIRROR_HORZ ) ? pAttr->GetRightCrop() : pAttr->GetLeftCrop() ) * fScale );
+            const long nNewLeft = -FRound( ( ( pAttr->GetMirrorFlags() & BmpMirrorFlags::Horizontal ) ? pAttr->GetRightCrop() : pAttr->GetLeftCrop() ) * fScale );
             const long nNewRight = nNewLeft + FRound( aSize100.Width() * fScale ) - 1;
 
             fScale = (double) rSz.Width() / aSize100.Width();
@@ -311,7 +311,7 @@ bool GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz
             rSz.Width() = FRound( ( nNewRight - nNewLeft + 1 ) * fScale );
 
             fScale = (double) aSize100.Height() / nTotalHeight;
-            const long nNewTop = -FRound( ( ( pAttr->GetMirrorFlags() & BMP_MIRROR_VERT ) ? pAttr->GetBottomCrop() : pAttr->GetTopCrop() ) * fScale );
+            const long nNewTop = -FRound( ( ( pAttr->GetMirrorFlags() & BmpMirrorFlags::Vertical ) ? pAttr->GetBottomCrop() : pAttr->GetTopCrop() ) * fScale );
             const long nNewBottom = nNewTop + FRound( aSize100.Height() * fScale ) - 1;
 
             fScale = (double) rSz.Height() / aSize100.Height();
@@ -531,7 +531,7 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
     {
         aPt.X() += aSz.Width() + 1;
         aSz.Width() = -aSz.Width();
-        aAttr.SetMirrorFlags( aAttr.GetMirrorFlags() ^ BMP_MIRROR_HORZ );
+        aAttr.SetMirrorFlags( aAttr.GetMirrorFlags() ^ BmpMirrorFlags::Horizontal );
     }
 
     // mirrored vertically
@@ -539,7 +539,7 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
     {
         aPt.Y() += aSz.Height() + 1;
         aSz.Height() = -aSz.Height();
-        aAttr.SetMirrorFlags( aAttr.GetMirrorFlags() ^ BMP_MIRROR_VERT );
+        aAttr.SetMirrorFlags( aAttr.GetMirrorFlags() ^ BmpMirrorFlags::Vertical );
     }
 
     if( bCropped )
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index 46b4809..202528d 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -331,8 +331,8 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib
     long    nX, nY, nTmpX, nTmpY, nTmpFX, nTmpFY, nTmp;
     double  fTmp;
 
-    bool    bHMirr = ( rAttributes.GetMirrorFlags() & BMP_MIRROR_HORZ ) != 0;
-    bool    bVMirr = ( rAttributes.GetMirrorFlags() & BMP_MIRROR_VERT ) != 0;
+    bool    bHMirr( rAttributes.GetMirrorFlags() & BmpMirrorFlags::Horizontal );
+    bool    bVMirr( rAttributes.GetMirrorFlags() & BmpMirrorFlags::Vertical );
 
     boost::scoped_array<long> pMapIX(new long[ aUnrotatedWidth ]);
     boost::scoped_array<long> pMapFX(new long[ aUnrotatedWidth ]);
@@ -905,8 +905,8 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOutputDevice,
         const long      nW = rBmpSzPix.Width();
         const long      nH = rBmpSzPix.Height();
         long            nStartX = -1, nStartY = -1, nEndX = -1, nEndY = -1;
-        bool            bHMirr = ( rAttributes.GetMirrorFlags() & BMP_MIRROR_HORZ ) != 0;
-        bool            bVMirr = ( rAttributes.GetMirrorFlags() & BMP_MIRROR_VERT ) != 0;
+        bool            bHMirr( rAttributes.GetMirrorFlags() & BmpMirrorFlags::Horizontal );
+        bool            bVMirr( rAttributes.GetMirrorFlags() & BmpMirrorFlags::Vertical );
 
         // calculate output sizes
         if( !pBmpEx )
diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx
index 069211c..62dccf9 100644
--- a/svtools/source/toolpanel/paneltabbar.cxx
+++ b/svtools/source/toolpanel/paneltabbar.cxx
@@ -721,11 +721,11 @@ namespace svt
         {
             aBitmap.Rotate( 2700, COL_BLACK );
             if ( m_eTabAlignment == TABS_LEFT )
-                aBitmap.Mirror( BMP_MIRROR_HORZ );
+                aBitmap.Mirror( BmpMirrorFlags::Horizontal );
         }
         else if ( m_eTabAlignment == TABS_BOTTOM )
         {
-            aBitmap.Mirror( BMP_MIRROR_VERT );
+            aBitmap.Mirror( BmpMirrorFlags::Vertical );
         }
 
         const Rectangle aActualRect( m_aNormalizer.getTransformed( i_rLogicalRect, m_eTabAlignment ) );
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 2a72cde..10bd3e0 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -355,7 +355,7 @@ namespace sdr
 
             if(bHMirr || bVMirr)
             {
-                aLocalGrafInfo.SetMirrorFlags((bHMirr ? BMP_MIRROR_HORZ : 0)|(bVMirr ? BMP_MIRROR_VERT : 0));
+                aLocalGrafInfo.SetMirrorFlags((bHMirr ? BmpMirrorFlags::Horizontal : BmpMirrorFlags::NONE)|(bVMirr ? BmpMirrorFlags::Vertical : BmpMirrorFlags::NONE));
             }
 
             // fill object matrix
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 15df383..170a402 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -501,7 +501,7 @@ Graphic SdrGrafObj::GetTransformedGraphic( SdrGrafObjTransformsAttrs nTransformF
             bool bHMirr = nMirrorCase == 2 || nMirrorCase == 4;
             bool bVMirr = nMirrorCase == 3 || nMirrorCase == 4;
 
-            aActAttr.SetMirrorFlags( ( bHMirr ? BMP_MIRROR_HORZ : 0 ) | ( bVMirr ? BMP_MIRROR_VERT : 0 ) );
+            aActAttr.SetMirrorFlags( ( bHMirr ? BmpMirrorFlags::Horizontal : BmpMirrorFlags::NONE ) | ( bVMirr ? BmpMirrorFlags::Vertical : BmpMirrorFlags::NONE ) );
         }
 
         if( bRotate )
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index d03b43b..6a47748 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -47,13 +47,13 @@ Animation XOutBitmap::MirrorAnimation( const Animation& rAnimation, bool bHMirr,
     if( bHMirr || bVMirr )
     {
         const Size& rGlobalSize = aNewAnim.GetDisplaySizePixel();
-        sal_uIntPtr     nMirrorFlags = 0L;
+        BmpMirrorFlags nMirrorFlags = BmpMirrorFlags::NONE;
 
         if( bHMirr )
-            nMirrorFlags |= BMP_MIRROR_HORZ;
+            nMirrorFlags |= BmpMirrorFlags::Horizontal;
 
         if( bVMirr )
-            nMirrorFlags |= BMP_MIRROR_VERT;
+            nMirrorFlags |= BmpMirrorFlags::Vertical;
 
         for( sal_uInt16 i = 0, nCount = aNewAnim.Count(); i < nCount; i++ )
         {
@@ -78,17 +78,17 @@ Animation XOutBitmap::MirrorAnimation( const Animation& rAnimation, bool bHMirr,
     return aNewAnim;
 }
 
-Graphic XOutBitmap::MirrorGraphic( const Graphic& rGraphic, const sal_uIntPtr nMirrorFlags )
+Graphic XOutBitmap::MirrorGraphic( const Graphic& rGraphic, const BmpMirrorFlags nMirrorFlags )
 {
     Graphic aRetGraphic;
 
-    if( nMirrorFlags )
+    if( nMirrorFlags != BmpMirrorFlags::NONE )
     {
         if( rGraphic.IsAnimated() )
         {
             aRetGraphic = MirrorAnimation( rGraphic.GetAnimation(),
-                                           ( nMirrorFlags & BMP_MIRROR_HORZ ) == BMP_MIRROR_HORZ,
-                                           ( nMirrorFlags & BMP_MIRROR_VERT ) == BMP_MIRROR_VERT );
+                                           bool( nMirrorFlags & BmpMirrorFlags::Horizontal ),
+                                           bool( nMirrorFlags & BmpMirrorFlags::Vertical ) );
         }
         else
         {
@@ -300,7 +300,14 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam
 
                 // mirror?
                 if( ( nFlags & XOUTBMP_MIRROR_HORZ ) || ( nFlags & XOUTBMP_MIRROR_VERT ) )
-                    aGraphic = MirrorGraphic( aGraphic, nFlags );
+                {
+                    BmpMirrorFlags nBmpMirrorFlags = BmpMirrorFlags::NONE;
+                    if( nFlags & XOUTBMP_MIRROR_HORZ )
+                      nBmpMirrorFlags |= BmpMirrorFlags::Horizontal;
+                    if( nFlags & XOUTBMP_MIRROR_VERT )
+                      nBmpMirrorFlags |= BmpMirrorFlags::Vertical;
+                    aGraphic = MirrorGraphic( aGraphic, nBmpMirrorFlags );
+                }
 
                 if( ( GRFILTER_FORMAT_NOTFOUND != nFilter ) && ( aGraphic.GetType() != GRAPHIC_NONE ) )
                 {
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 8a5833c..b3b3d13 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -997,22 +997,22 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
     rGA.SetDrawMode( (GraphicDrawMode)rSet.GetDrawModeGrf().GetValue() );
 
     const SwMirrorGrf & rMirror = rSet.GetMirrorGrf();
-    sal_uLong nMirror = BMP_MIRROR_NONE;
+    BmpMirrorFlags nMirror = BmpMirrorFlags::NONE;
     if( rMirror.IsGrfToggle() && pFrm && !pFrm->FindPageFrm()->OnRightPage() )
     {
         switch( rMirror.GetValue() )
         {
         case RES_MIRROR_GRAPH_DONT:
-            nMirror = BMP_MIRROR_HORZ;
+            nMirror = BmpMirrorFlags::Horizontal;
             break;
         case RES_MIRROR_GRAPH_VERT:
-            nMirror = BMP_MIRROR_NONE;
+            nMirror = BmpMirrorFlags::NONE;
             break;
         case RES_MIRROR_GRAPH_HOR:
-            nMirror = BMP_MIRROR_HORZ|BMP_MIRROR_VERT;
+            nMirror = BmpMirrorFlags::Horizontal|BmpMirrorFlags::Vertical;
             break;
         default:
-            nMirror = BMP_MIRROR_VERT;
+            nMirror = BmpMirrorFlags::Vertical;
             break;
         }
     }
@@ -1020,13 +1020,13 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
         switch( rMirror.GetValue() )
         {
         case RES_MIRROR_GRAPH_BOTH:
-            nMirror = BMP_MIRROR_HORZ|BMP_MIRROR_VERT;
+            nMirror = BmpMirrorFlags::Horizontal|BmpMirrorFlags::Vertical;
             break;
         case RES_MIRROR_GRAPH_VERT:
-            nMirror = BMP_MIRROR_HORZ;
+            nMirror = BmpMirrorFlags::Horizontal;
             break;
         case RES_MIRROR_GRAPH_HOR:
-            nMirror = BMP_MIRROR_VERT;
+            nMirror = BmpMirrorFlags::Vertical;
             break;
         }
 
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index f8a8a50..7da73f2 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2702,11 +2702,11 @@ void BmpWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle&
     if (bHorz || bVert)
     {
         BitmapEx aTmpBmp(bGraphic ? aGraphic.GetBitmapEx() : aBmp);
-        sal_uLong nMirrorFlags(BMP_MIRROR_NONE);
+        BmpMirrorFlags nMirrorFlags(BmpMirrorFlags::NONE);
         if (bHorz)
-            nMirrorFlags |= BMP_MIRROR_VERT;
+            nMirrorFlags |= BmpMirrorFlags::Vertical;
         if (bVert)
-            nMirrorFlags |= BMP_MIRROR_HORZ;
+            nMirrorFlags |= BmpMirrorFlags::Horizontal;
         aTmpBmp.Mirror(nMirrorFlags);
         DrawBitmapEx( aPntPos, aPntSz, aTmpBmp );
     }
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 6371d66..4dd37f8 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -600,7 +600,7 @@ bool Animation::Invert()
     return bRet;
 }
 
-bool Animation::Mirror( sal_uLong nMirrorFlags )
+bool Animation::Mirror( BmpMirrorFlags nMirrorFlags )
 {
     DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
 
@@ -610,17 +610,17 @@ bool Animation::Mirror( sal_uLong nMirrorFlags )
     {
         bRet = true;
 
-        if( nMirrorFlags )
+        if( nMirrorFlags != BmpMirrorFlags::NONE )
         {
             for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
             {
                 AnimationBitmap* pStepBmp = maList[ i ];
                 if( ( bRet = pStepBmp->aBmpEx.Mirror( nMirrorFlags ) ) )
                 {
-                    if( nMirrorFlags & BMP_MIRROR_HORZ )
+                    if( nMirrorFlags & BmpMirrorFlags::Horizontal )
                         pStepBmp->aPosPix.X() = maGlobalSize.Width() - pStepBmp->aPosPix.X() - pStepBmp->aSizePix.Width();
 
-                    if( nMirrorFlags & BMP_MIRROR_VERT )
+                    if( nMirrorFlags & BmpMirrorFlags::Vertical )
                         pStepBmp->aPosPix.Y() = maGlobalSize.Height() - pStepBmp->aPosPix.Y() - pStepBmp->aSizePix.Height();
                 }
             }
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index b5209f8..51e5db8 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -556,10 +556,10 @@ bool Bitmap::Invert()
     return bRet;
 }
 
-bool Bitmap::Mirror( sal_uLong nMirrorFlags )
+bool Bitmap::Mirror( BmpMirrorFlags nMirrorFlags )
 {
-    bool bHorz = ( ( nMirrorFlags & BMP_MIRROR_HORZ ) == BMP_MIRROR_HORZ );
-    bool bVert = ( ( nMirrorFlags & BMP_MIRROR_VERT ) == BMP_MIRROR_VERT );
+    bool bHorz( nMirrorFlags & BmpMirrorFlags::Horizontal );
+    bool bVert( nMirrorFlags & BmpMirrorFlags::Vertical );
     bool bRet = false;
 
     if( bHorz && !bVert )
@@ -664,7 +664,7 @@ bool Bitmap::Rotate( long nAngle10, const Color& rFillColor )
     if( !nAngle10    )
         bRet = true;
     else if( 1800L == nAngle10 )
-        bRet = Mirror( BMP_MIRROR_HORZ | BMP_MIRROR_VERT );
+        bRet = Mirror( BmpMirrorFlags::Horizontal | BmpMirrorFlags::Vertical );
     else
     {
         BitmapReadAccess*   pReadAcc = AcquireReadAccess();
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index f3dc33e..3ad2c18 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -1582,19 +1582,19 @@ bool Bitmap::ImplScaleConvolution(
     }
 
     bool bResult(true);
-    sal_uInt32 nMirrorFlags(BMP_MIRROR_NONE);
+    BmpMirrorFlags nMirrorFlags(BmpMirrorFlags::NONE);
     bool bMirrorAfter(false);
 
     if(bMirror)
     {
         if(bMirrorHor)
         {
-            nMirrorFlags |= BMP_MIRROR_HORZ;
+            nMirrorFlags |= BmpMirrorFlags::Horizontal;
         }
 
         if(bMirrorVer)
         {
-            nMirrorFlags |= BMP_MIRROR_VERT;
+            nMirrorFlags |= BmpMirrorFlags::Vertical;
         }
 
         const sal_uInt32 nStartSize(nWidth * nHeight);
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 38a770d..537c7dc 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -359,7 +359,7 @@ bool BitmapEx::Invert()
     return bRet;
 }
 
-bool BitmapEx::Mirror( sal_uLong nMirrorFlags )
+bool BitmapEx::Mirror( BmpMirrorFlags nMirrorFlags )
 {
     bool bRet = false;
 
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index f3a4492..2701046 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -689,19 +689,19 @@ void GDIMetaFile::RemoveAction( size_t nPos )
         pPrev->RemoveAction( nPos );
 }
 
-bool GDIMetaFile::Mirror( sal_uLong nMirrorFlags )
+bool GDIMetaFile::Mirror( BmpMirrorFlags nMirrorFlags )
 {
     const Size  aOldPrefSize( GetPrefSize() );
     long        nMoveX, nMoveY;
     double      fScaleX, fScaleY;
     bool        bRet;
 
-    if( nMirrorFlags & MTF_MIRROR_HORZ )
+    if( nMirrorFlags & BmpMirrorFlags::Horizontal )
         nMoveX = SAL_ABS( aOldPrefSize.Width() ) - 1, fScaleX = -1.0;
     else
         nMoveX = 0, fScaleX = 1.0;
 
-    if( nMirrorFlags & MTF_MIRROR_VERT )
+    if( nMirrorFlags & BmpMirrorFlags::Vertical )
         nMoveY = SAL_ABS( aOldPrefSize.Height() ) - 1, fScaleY = -1.0;
     else
         nMoveY = 0, fScaleY = 1.0;
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 837d69f..05d4e25 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -76,21 +76,21 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz
         // #i19065# Negative sizes have mirror semantics on
         // OutputDevice. BitmapEx and co. have no idea about that, so
         // perform that _before_ doing anything with aBitmapEx.
-        sal_uLong nMirrorFlags(BMP_MIRROR_NONE);
+        BmpMirrorFlags nMirrorFlags(BmpMirrorFlags::NONE);
         if( aSize.Width() < 0 )
         {
             aSize.Width() *= -1;
             aPoint.X() -= aSize.Width();
-            nMirrorFlags |= BMP_MIRROR_HORZ;
+            nMirrorFlags |= BmpMirrorFlags::Horizontal;
         }
         if( aSize.Height() < 0 )
         {
             aSize.Height() *= -1;
             aPoint.Y() -= aSize.Height();
-            nMirrorFlags |= BMP_MIRROR_VERT;
+            nMirrorFlags |= BmpMirrorFlags::Vertical;
         }
 
-        if( nMirrorFlags != BMP_MIRROR_NONE )
+        if( nMirrorFlags != BmpMirrorFlags::NONE )
         {
             aBitmapEx.Mirror( nMirrorFlags );
         }
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 10d2722..590d696 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -815,7 +815,7 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
     if( !rMask.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height() )
     {
         Bitmap  aMask( rMask );
-        sal_uLong   nMirrFlags = 0UL;
+        BmpMirrorFlags nMirrFlags = BmpMirrorFlags::NONE;
 
         if( aMask.GetBitCount() > 1 )
             aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
@@ -825,7 +825,7 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
         {
             aDestSz.Width() = -aDestSz.Width();
             aDestPt.X() -= ( aDestSz.Width() - 1L );
-            nMirrFlags |= BMP_MIRROR_HORZ;
+            nMirrFlags |= BmpMirrorFlags::Horizontal;
         }
 
         // mirrored vertically
@@ -833,7 +833,7 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
         {
             aDestSz.Height() = -aDestSz.Height();
             aDestPt.Y() -= ( aDestSz.Height() - 1L );
-            nMirrFlags |= BMP_MIRROR_VERT;
+            nMirrFlags |= BmpMirrorFlags::Vertical;
         }
 
         // source cropped?
@@ -841,7 +841,7 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
             aMask.Crop( aSrcRect );
 
         // destination mirrored
-        if( nMirrFlags )
+        if( nMirrFlags != BmpMirrorFlags::NONE)
             aMask.Mirror( nMirrFlags );
 
         // do painting
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 0393850..01c279f 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -135,9 +135,9 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize,
 
         if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
         {
-            const sal_uLong nMirrFlags = AdjustTwoRect( aPosAry, aBmp.GetSizePixel() );
+            const BmpMirrorFlags nMirrFlags = AdjustTwoRect( aPosAry, aBmp.GetSizePixel() );
 
-            if ( nMirrFlags )
+            if ( nMirrFlags != BmpMirrorFlags::NONE )
                 aBmp.Mirror( nMirrFlags );
 
             if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
@@ -487,12 +487,12 @@ void OutputDevice::DrawDeviceBitmap( const Point& rDestPt, const Size& rDestSize
                            ImplLogicWidthToDevicePixel(rDestSize.Width()),
                            ImplLogicHeightToDevicePixel(rDestSize.Height()));
 
-        const sal_uLong nMirrFlags = AdjustTwoRect(aPosAry, rBitmapEx.GetSizePixel());
+        const BmpMirrorFlags nMirrFlags = AdjustTwoRect(aPosAry, rBitmapEx.GetSizePixel());
 
         if (aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight)
         {
 
-            if (nMirrFlags)
+            if (nMirrFlags != BmpMirrorFlags::NONE)
                 rBitmapEx.Mirror(nMirrFlags);
 
             const SalBitmap* pSalSrcBmp = rBitmapEx.ImplGetBitmapImpBitmap()->ImplGetSalBitmap();
diff --git a/vcl/source/outdev/mask.cxx b/vcl/source/outdev/mask.cxx
index f8ef474..9f6b55f 100644
--- a/vcl/source/outdev/mask.cxx
+++ b/vcl/source/outdev/mask.cxx
@@ -108,13 +108,13 @@ void OutputDevice::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
                            ImplLogicHeightToDevicePixel(rDestSize.Height()));
 
         // we don't want to mirror via cooridates
-        const sal_uLong nMirrFlags = AdjustTwoRect( aPosAry, pImpBmp->ImplGetSize() );
+        const BmpMirrorFlags nMirrFlags = AdjustTwoRect( aPosAry, pImpBmp->ImplGetSize() );
 
         // check if output is necessary
         if( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
         {
 
-            if( nMirrFlags )
+            if( nMirrFlags != BmpMirrorFlags::NONE )
             {
                 Bitmap aTmp( rMask );
                 aTmp.Mirror( nMirrFlags );
diff --git a/vcl/source/outdev/rect.cxx b/vcl/source/outdev/rect.cxx
index 4606e7b..463152b 100644
--- a/vcl/source/outdev/rect.cxx
+++ b/vcl/source/outdev/rect.cxx
@@ -244,16 +244,16 @@ void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLon
         mpAlphaVDev->DrawGrid( rRect, rDist, nFlags );
 }
 
-sal_uLong AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix )
+BmpMirrorFlags AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix )
 {
-    sal_uLong nMirrFlags = 0;
+    BmpMirrorFlags nMirrFlags = BmpMirrorFlags::NONE;
 
     if ( rTwoRect.mnDestWidth < 0 )
     {
         rTwoRect.mnSrcX = rSizePix.Width() - rTwoRect.mnSrcX - rTwoRect.mnSrcWidth;
         rTwoRect.mnDestWidth = -rTwoRect.mnDestWidth;
         rTwoRect.mnDestX -= rTwoRect.mnDestWidth-1;
-        nMirrFlags |= BMP_MIRROR_HORZ;
+        nMirrFlags |= BmpMirrorFlags::Horizontal;
     }
 
     if ( rTwoRect.mnDestHeight < 0 )
@@ -261,7 +261,7 @@ sal_uLong AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix )
         rTwoRect.mnSrcY = rSizePix.Height() - rTwoRect.mnSrcY - rTwoRect.mnSrcHeight;
         rTwoRect.mnDestHeight = -rTwoRect.mnDestHeight;
         rTwoRect.mnDestY -= rTwoRect.mnDestHeight-1;
-        nMirrFlags |= BMP_MIRROR_VERT;
+        nMirrFlags |= BmpMirrorFlags::Vertical;
     }
 
     if( ( rTwoRect.mnSrcX < 0 ) || ( rTwoRect.mnSrcX >= rSizePix.Width() ) ||
diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index 425a56a..69236f8 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -133,7 +133,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
     if( !rBmp.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height() )
     {
         Bitmap  aPaint( rBmp ), aMask( rMask );
-        sal_uLong   nMirrFlags = 0UL;
+        BmpMirrorFlags nMirrFlags = BmpMirrorFlags::NONE;
 
         if( aMask.GetBitCount() > 1 )
             aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
@@ -143,7 +143,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
         {
             aDestSz.Width() = -aDestSz.Width();
             aDestPt.X() -= ( aDestSz.Width() - 1L );
-            nMirrFlags |= BMP_MIRROR_HORZ;
+            nMirrFlags |= BmpMirrorFlags::Horizontal;
         }
 
         // mirrored vertically
@@ -151,7 +151,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
         {
             aDestSz.Height() = -aDestSz.Height();
             aDestPt.Y() -= ( aDestSz.Height() - 1L );
-            nMirrFlags |= BMP_MIRROR_VERT;
+            nMirrFlags |= BmpMirrorFlags::Vertical;
         }
 
         // source cropped?
@@ -162,7 +162,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
         }
 
         // destination mirrored
-        if( nMirrFlags )
+        if( nMirrFlags != BmpMirrorFlags::NONE )
         {
             aPaint.Mirror( nMirrFlags );
             aMask.Mirror( nMirrFlags );
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 5571d03..3560c6c 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1099,7 +1099,7 @@ static inline Image ImplMirrorImage( const Image& rImage )
     Image       aRet;
     BitmapEx    aBmpEx( rImage.GetBitmapEx() );
 
-    aBmpEx.Mirror( BMP_MIRROR_HORZ );
+    aBmpEx.Mirror( BmpMirrorFlags::Horizontal );
 
     return Image( aBmpEx );
 }
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index cedf3bd..e209fd2 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1202,7 +1202,7 @@ static Image ImplMirrorImage( const Image& rImage )
     Image       aRet;
     BitmapEx    aMirrBitmapEx( rImage.GetBitmapEx() );
 
-    aMirrBitmapEx.Mirror( BMP_MIRROR_HORZ );
+    aMirrBitmapEx.Mirror( BmpMirrorFlags::Horizontal );
 
     return Image( aMirrBitmapEx );
 }
commit b13fbd19b7282a1210a2e14bb5ede9ecdf944c1c
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 5 14:09:24 2015 +0200

    convert BMP_SCALE constant to scoped enum
    
    Change-Id: Ibc9f88d2588c028cd71aa86c26d970a73025ef22

diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx
index 5c0a310..d818ed8 100644
--- a/canvas/source/vcl/canvasbitmaphelper.cxx
+++ b/canvas/source/vcl/canvasbitmaphelper.cxx
@@ -119,7 +119,7 @@ namespace vclcanvas
         BitmapEx aRes( mpBackBuffer->getBitmapReference() );
 
         aRes.Scale( vcl::unotools::sizeFromRealSize2D(newSize),
-                     beFast ? BMP_SCALE_DEFAULT : BMP_SCALE_BESTQUALITY );
+                     beFast ? BmpScaleFlag::Default : BmpScaleFlag::BestQuality );
 
         return uno::Reference< rendering::XBitmap >(
             new CanvasBitmap( aRes, *mpDevice, mpOutDevReference ) );
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index 37a5176..8674056 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -926,7 +926,7 @@ namespace vclcanvas
         Bitmap aBitmap( rOutDev.GetBitmap(aEmptyPoint, aBmpSize) );
 
         aBitmap.Scale( vcl::unotools::sizeFromRealSize2D(newSize),
-                       beFast ? BMP_SCALE_DEFAULT : BMP_SCALE_BESTQUALITY );
+                       beFast ? BmpScaleFlag::Default : BmpScaleFlag::BestQuality );
 
         return uno::Reference< rendering::XBitmap >(
             new CanvasBitmap( aBitmap, *mpDevice, mpOutDev ) );
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 0623a45..ea1d83c 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -122,7 +122,7 @@ void GraphicPreviewWindow::ScaleImageToFit()
         {
             BitmapEx aBmpEx( mpOrigGraphic->GetBitmapEx() );
 
-            if( aBmpEx.Scale( aGrfSize, BMP_SCALE_DEFAULT ) )
+            if( aBmpEx.Scale( aGrfSize, BmpScaleFlag::Default ) )
                 maScaledOrig = aBmpEx;
         }
     }
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 0f19eef..55dd19c 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -360,7 +360,7 @@ void AlignmentTabPage::InitVsRefEgde()
         {
             OUString rImageName = aImageList.GetImageName(i);
             BitmapEx b = aImageList.GetImage(rImageName).GetBitmapEx();
-            b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST);
+            b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
             aImageList.ReplaceImage(rImageName, Image(b));
         }
     }
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index b304afa..01881fe 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -137,7 +137,7 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
         {
             OUString rImageName = aBorderImgLst.GetImageName(i);
             BitmapEx b = aBorderImgLst.GetImage(rImageName).GetBitmapEx();
-            b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST);
+            b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
             aBorderImgLst.ReplaceImage(rImageName, Image(b));
         }
 
@@ -145,7 +145,7 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
         {
             OUString rImageName = aShadowImgLst.GetImageName(i);
             BitmapEx b = aShadowImgLst.GetImage(rImageName).GetBitmapEx();
-            b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST);
+            b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
             aShadowImgLst.ReplaceImage(rImageName, Image(b));
         }
     }
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 9e6c5a6..a987266 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -519,7 +519,7 @@ namespace drawinglayer
                                         aBitmapEx.Convert(BMP_CONVERSION_24BIT);
                                     }
 
-                                    aBitmapEx.Scale(aNeededBitmapSizePixel, BMP_SCALE_INTERPOLATE);
+                                    aBitmapEx.Scale(aNeededBitmapSizePixel, BmpScaleFlag::Interpolate);
                                 }
 
                                 bool bPainted(false);
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 20f6a2f..53dec83 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -528,7 +528,7 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview )
     {
         Size aSizeBitmap( ( aSizePoint.Width() + 7 ) & ~7, aSizePoint.Height() );
         Bitmap aTmpBitmap( pPreview->GetBitmap() );
-        aTmpBitmap.Scale( aSizeBitmap, BMP_SCALE_BESTQUALITY );
+        aTmpBitmap.Scale( aSizeBitmap, BmpScaleFlag::BestQuality );
         aTmpBitmap.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
         BitmapReadAccess* pAcc = aTmpBitmap.AcquireReadAccess();
         if ( pAcc )
diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx
index 31105e7..8892270 100644
--- a/framework/source/fwe/classes/addonsoptions.cxx
+++ b/framework/source/fwe/classes/addonsoptions.cxx
@@ -480,7 +480,7 @@ static Image ScaleImage( const Image &rImage, bool bBig )
     BitmapEx aScaleBmp(rImage.GetBitmapEx());
     SAL_INFO("fwk", "Addons: expensive scale image from "
              << aScaleBmp.GetSizePixel() << " to " << aSize);
-    aScaleBmp.Scale(aSize, BMP_SCALE_BESTQUALITY);
+    aScaleBmp.Scale(aSize, BmpScaleFlag::BestQuality);
     return Image(aScaleBmp);
 }
 
diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
index 820722b..34e761f 100644
--- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
@@ -145,7 +145,7 @@ bool ImageButtonToolbarController::ReadImageFromURL( bool bBigImage, const OUStr
         {
             ::Size aNoScaleSize( aBmpSize.Width(), aSize.Height() );
             if ( aBmpSize != aNoScaleSize )
-                aBitmapEx.Scale( aNoScaleSize, BMP_SCALE_BESTQUALITY );
+                aBitmapEx.Scale( aNoScaleSize, BmpScaleFlag::BestQuality );
             aImage = Image( aBitmapEx );
             return true;
         }
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index c2e3247..004db21 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -569,7 +569,7 @@ void NewToolbarController::setItemImage( const OUString &rCommand )
     if ( bBig && aImage.GetSizePixel() != aBigSize )
     {
         BitmapEx aScaleBmpEx( aImage.GetBitmapEx() );
-        aScaleBmpEx.Scale( aBigSize, BMP_SCALE_INTERPOLATE );
+        aScaleBmpEx.Scale( aBigSize, BmpScaleFlag::Interpolate );
         pToolBox->SetItemImage( m_nToolBoxId, Image( aScaleBmpEx ) );
     }
     else
diff --git a/include/svx/compressgraphicdialog.hxx b/include/svx/compressgraphicdialog.hxx
index ba5e51a..cf0c2ac 100644
--- a/include/svx/compressgraphicdialog.hxx
+++ b/include/svx/compressgraphicdialog.hxx
@@ -78,7 +78,7 @@ private:
     double GetViewWidthInch();
     double GetViewHeightInch();
 
-    sal_uLong GetSelectedInterpolationType();
+    BmpScaleFlag GetSelectedInterpolationType();
 
 public:
     CompressGraphicsDialog( vcl::Window* pParent, SdrGrafObj* pGraphicObj, SfxBindings& rBindings );
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index 9027a64..be7d4eb 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -34,18 +34,21 @@
 #define BMP_MIRROR_VERT             0x00000002UL
 
 
-#define BMP_SCALE_NONE              0x00000000UL
+enum class BmpScaleFlag
+{
+    NONE              = 0,
 // Try to preferably use these.
-#define BMP_SCALE_DEFAULT           0x00000001UL
-#define BMP_SCALE_FAST              0x00000002UL
-#define BMP_SCALE_BESTQUALITY       0x00000003UL
+    Default           = 1,
+    Fast              = 2,
+    BestQuality       = 3,
 // Specific algorithms,  use only if you really need to.
-#define BMP_SCALE_INTERPOLATE       0x00000004UL
-#define BMP_SCALE_SUPER             0x00000005UL
-#define BMP_SCALE_LANCZOS           0x00000006UL
-#define BMP_SCALE_BICUBIC           0x00000007UL
-#define BMP_SCALE_BILINEAR          0x00000008UL
-#define BMP_SCALE_BOX               0x00000009UL
+    Interpolate       = 4,
+    Super             = 5,
+    Lanczos           = 6,
+    BiCubic           = 7,
+    BiLinear          = 8,
+    Box               = 9,
+};
 
 
 #define BMP_DITHER_NONE             0x00000000UL
@@ -543,7 +546,7 @@ public:
 
         @return true, if the operation was completed successfully.
      */
-    bool                    Scale( const Size& rNewSize, sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT );
+    bool                    Scale( const Size& rNewSize, BmpScaleFlag nScaleFlag = BmpScaleFlag::Default );
 
     /** Scale the bitmap
 
@@ -554,11 +557,11 @@ public:
         The scale factor in y direction.
 
         @param nScaleFlag
-        Method of scaling - it is recommended that either BMP_SCALE_DEFAULT or BMP_SCALE_BESTQUALITY be used.
+        Method of scaling - it is recommended that either BmpScaleFlag::Default or BmpScaleFlag::BestQuality be used.
 
         @return true, if the operation was completed successfully.
      */
-    bool                    Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT );
+    bool                    Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag = BmpScaleFlag::Default );
 
     /**
       Returns true if bitmap scaling is considered to be fast.
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index eb9e4d6..d7b08e0 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -83,7 +83,7 @@ public:
     AlphaMask           GetAlpha() const;
 
     const Size&         GetSizePixel() const { return aBitmapSize; }
-    void                SetSizePixel( const Size& rNewSize, sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT );
+    void                SetSizePixel( const Size& rNewSize, BmpScaleFlag nScaleFlag = BmpScaleFlag::Default );
 
     const Size&         GetPrefSize() const { return aBitmap.GetPrefSize(); }
     void                SetPrefSize( const Size& rPrefSize ) { aBitmap.SetPrefSize( rPrefSize ); }
@@ -237,7 +237,7 @@ public:
      */
     bool                Scale(
                             const Size& rNewSize,
-                            sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT );
+                            BmpScaleFlag nScaleFlag = BmpScaleFlag::Default );
 
     /** Scale the bitmap
 
@@ -255,7 +255,7 @@ public:
     bool                Scale(
                             const double& rScaleX,
                             const double& rScaleY,
-                            sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT );
+                            BmpScaleFlag nScaleFlag = BmpScaleFlag::Default );
 
     /** Rotate bitmap by the specified angle
 
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 43bfad9..bc8da88 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -218,7 +218,7 @@ public:
     bool            CreateThumbnail(BitmapEx& rBitmapEx,
                                     sal_uInt32 nMaximumExtent = 256,
                                     BmpConversion nColorConversion = BMP_CONVERSION_24BIT,
-                                    long nScaleFlag = BMP_SCALE_BESTQUALITY) const;
+                                    BmpScaleFlag nScaleFlag = BmpScaleFlag::BestQuality) const;
 
     void            UseCanvas( bool _bUseCanvas );
     bool            GetUseCanvas() const { return bUseCanvas; }
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 651008c..bbd90b1 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1097,7 +1097,7 @@ void ScCheckListMenuWindow::packWindow()
     if (nScaleFactor != 1)
     {
         BitmapEx aBitmap = aSingleSelect.GetBitmapEx();
-        aBitmap.Scale(nScaleFactor, nScaleFactor, BMP_SCALE_FAST);
+        aBitmap.Scale(nScaleFactor, nScaleFactor, BmpScaleFlag::Fast);
         aSingleSelect = Image(aBitmap);
     }
 
@@ -1112,7 +1112,7 @@ void ScCheckListMenuWindow::packWindow()
     if (nScaleFactor != 1)
     {
         BitmapEx aBitmap = aSingleUnselect.GetBitmapEx();
-        aBitmap.Scale(nScaleFactor, nScaleFactor, BMP_SCALE_FAST);
+        aBitmap.Scale(nScaleFactor, nScaleFactor, BmpScaleFlag::Fast);
         aSingleUnselect = Image(aBitmap);
     }
 
diff --git a/sd/source/ui/presenter/SlideRenderer.cxx b/sd/source/ui/presenter/SlideRenderer.cxx
index f64f6c5..b60da23 100644
--- a/sd/source/ui/presenter/SlideRenderer.cxx
+++ b/sd/source/ui/presenter/SlideRenderer.cxx
@@ -192,7 +192,7 @@ BitmapEx SlideRenderer::CreatePreview (
         BitmapEx aScaledPreview = aPreview.GetBitmapEx();
         aScaledPreview.Scale(
             Size(aPreviewSize.Width,aPreviewSize.Height),
-            BMP_SCALE_BESTQUALITY);
+            BmpScaleFlag::BestQuality);
         return aScaledPreview;
     }
 }
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx
index 53a66c8..f5aa025 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -551,7 +551,7 @@ void LayoutMenu::Fill()
             BitmapEx aBmp(SdResId(pInfo->mnBmpResId));
 
             if (GetDPIScaleFactor() > 1)
-                aBmp.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST);
+                aBmp.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
 
             if (bRightToLeft && (WritingMode_TB_RL != pInfo->meWritingMode))
                 aBmp.Mirror (BMP_MIRROR_HORZ);
diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx
index 14dd577..d68ee26 100644
--- a/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx
@@ -69,7 +69,7 @@ Bitmap BitmapFactory::CreateBitmap (
         false).GetBitmapEx().GetBitmap());
     if (bDoSuperSampling)
     {
-        aPreview.Scale(rPixelSize, BMP_SCALE_BESTQUALITY);
+        aPreview.Scale(rPixelSize, BmpScaleFlag::BestQuality);
     }
 
     return aPreview;
diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
index 2561c90..cb23745 100644
--- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
+++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
@@ -185,7 +185,7 @@ Point InsertionIndicatorOverlay::PaintRepresentatives (
 
         // Paint the preview.
         Bitmap aPreview (rRepresentatives[nIndex].maBitmap);
-        aPreview.Scale(rPreviewSize, BMP_SCALE_BESTQUALITY);
+        aPreview.Scale(rPreviewSize, BmpScaleFlag::BestQuality);
         rContent.DrawBitmapEx(aPageOffset, aPreview);
 
         // When the page is marked as excluded from the slide show then
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index a9befdd..774cf1d 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -473,7 +473,7 @@ Image PreviewRenderer::ScaleBitmap (
 
         // Paint the bitmap scaled to the desired width.
         BitmapEx aScaledBitmap (rBitmapEx.GetBitmap());
-        aScaledBitmap.Scale (aPreviewSize, BMP_SCALE_BESTQUALITY);
+        aScaledBitmap.Scale (aPreviewSize, BmpScaleFlag::BestQuality);
         mpPreviewDevice->DrawBitmap (
             Point(1,1),
             aPreviewSize,
diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index e8ca9ef..68fa2f9 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -189,7 +189,7 @@ bool GraphicHelper::getThumbnailFormatFromGDI_Impl(GDIMetaFile* pMetaFile, const
 
     BitmapEx aResultBitmap;
 
-    bResult = pMetaFile->CreateThumbnail(aResultBitmap, 256, BMP_CONVERSION_8BIT_COLORS, BMP_SCALE_DEFAULT);
+    bResult = pMetaFile->CreateThumbnail(aResultBitmap, 256, BMP_CONVERSION_8BIT_COLORS, BmpScaleFlag::Default);
 
     if (!bResult || aResultBitmap.IsEmpty())
         return false;
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index fd8695e..8a474c7 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -148,7 +148,7 @@ void TabBar::UpdateButtonIcons()
     if ( mpMenuButton->GetDPIScaleFactor() > 1 )
     {
         BitmapEx b = aImage.GetBitmapEx();
-        b.Scale(mpMenuButton->GetDPIScaleFactor(), mpMenuButton->GetDPIScaleFactor(), BMP_SCALE_FAST);
+        b.Scale(mpMenuButton->GetDPIScaleFactor(), mpMenuButton->GetDPIScaleFactor(), BmpScaleFlag::Fast);
         aImage = Image(b);
     }
     mpMenuButton->SetModeImage(aImage);
@@ -165,7 +165,7 @@ void TabBar::UpdateButtonIcons()
             if ( mpMenuButton->GetDPIScaleFactor() > 1 )
             {
                 BitmapEx b = aImage.GetBitmapEx();
-                b.Scale(mpMenuButton->GetDPIScaleFactor(), mpMenuButton->GetDPIScaleFactor(), BMP_SCALE_FAST);
+                b.Scale(mpMenuButton->GetDPIScaleFactor(), mpMenuButton->GetDPIScaleFactor(), BmpScaleFlag::Fast);
                 aImage = Image(b);
             }
 
diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx
index 53fc563..0360ea2 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -238,20 +238,20 @@ double CompressGraphicsDialog::GetViewHeightInch()
     return (double) MetricField::ConvertValue(m_aViewSize100mm.Height(),  2, MAP_100TH_MM, FUNIT_INCH) / 100.0;
 }
 
-sal_uLong CompressGraphicsDialog::GetSelectedInterpolationType()
+BmpScaleFlag CompressGraphicsDialog::GetSelectedInterpolationType()
 {
     OUString aSelectionText = OUString( m_pInterpolationCombo->GetSelectEntry() );
 
     if( aSelectionText == "Lanczos" ) {
-        return BMP_SCALE_LANCZOS;
+        return BmpScaleFlag::Lanczos;
     } else if( aSelectionText == "Bilinear" ) {
-        return BMP_SCALE_BILINEAR;
+        return BmpScaleFlag::BiLinear;
     } else if( aSelectionText == "Bicubic" ) {
-        return BMP_SCALE_BICUBIC;
+        return BmpScaleFlag::BiCubic;
     } else if ( aSelectionText == "None" ) {
-        return BMP_SCALE_FAST;
+        return BmpScaleFlag::Fast;
     }
-    return BMP_SCALE_BESTQUALITY;
+    return BmpScaleFlag::BestQuality;
 }
 
 void CompressGraphicsDialog::Compress(SvStream& aStream)
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 4a0cf8d..94e6aaa 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1464,7 +1464,7 @@ namespace
 
             if(rBitmapEx.GetSizePixel().Width() >= rSize.Width() && rBitmapEx.GetSizePixel().Height() >= rSize.Height())
             {
-                rBitmapEx.Scale(rSize, BMP_SCALE_DEFAULT);
+                rBitmapEx.Scale(rSize, BmpScaleFlag::Default);
                 pVirtualDevice->DrawBitmapEx(Point(0, 0), rBitmapEx);
             }
             else
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index 299abab..8a62689 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -81,9 +81,7 @@ BitmapEx SgaObject::createPreviewBitmapEx(const Size& rSizePixel) const
             // prevent scaling close to 1.0 which is not needed for pixel graphics
             if(fScale < 1.0 && fabs(1.0 - fScale) > 0.005)
             {
-                static sal_uInt32 nScaleFlag = BMP_SCALE_BESTQUALITY;
-
-                aRetval.Scale(fScale, fScale, nScaleFlag);
+                aRetval.Scale(fScale, fScale, BmpScaleFlag::BestQuality);
             }
         }
     }
@@ -118,7 +116,7 @@ bool SgaObject::CreateThumb( const Graphic& rGraphic )
                     else
                         aBmpSize.Height() = FRound( aBmpSize.Width() / fFactorLog );
 
-                    aBmpEx.SetSizePixel( aBmpSize, BMP_SCALE_BESTQUALITY );
+                    aBmpEx.SetSizePixel( aBmpSize, BmpScaleFlag::BestQuality );
                 }
             }
 
@@ -138,7 +136,7 @@ bool SgaObject::CreateThumb( const Graphic& rGraphic )
                 if(aThumbBmp.Scale(
                     (double) aNewSize.Width() / aBmpSize.Width(),
                     (double) aNewSize.Height() / aBmpSize.Height(),
-                    BMP_SCALE_BESTQUALITY ) )
+                    BmpScaleFlag::BestQuality ) )
                 {
                     aThumbBmp.Convert( BMP_CONVERSION_8BIT_COLORS );
                     bRet = true;
@@ -509,7 +507,7 @@ bool SgaObjectSvDraw::CreateThumb( const FmFormModel& rModel )
 
                     if(!!aThumbBmp)
                     {
-                        aThumbBmp.Scale(Size(nTargetSizeX, nTargetSizeY), BMP_SCALE_BESTQUALITY);
+                        aThumbBmp.Scale(Size(nTargetSizeX, nTargetSizeY), BmpScaleFlag::BestQuality);
                         aThumbBmp.Convert(BMP_CONVERSION_8BIT_COLORS);
                         bRet = true;
                     }
diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx
index 41d66e0..5374f36 100644
--- a/svx/source/stbctrls/modctrl.cxx
+++ b/svx/source/stbctrls/modctrl.cxx
@@ -72,7 +72,7 @@ SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, Status
         for (int i = 0; i < mxImpl->MODIFICATION_STATE_SIZE; i++)
         {
             BitmapEx b = mxImpl->maImages[i].GetBitmapEx();
-            b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST);
+            b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BmpScaleFlag::Fast);
             mxImpl->maImages[i] = Image(b);
         }
     }
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index cde8ef5..e102a7f 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -174,11 +174,11 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( sal_uInt16 _nSlotId,
     if ( rStb.GetDPIScaleFactor() > 1)
     {
         BitmapEx b = pImp->aPosImage.GetBitmapEx();
-        b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST);
+        b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BmpScaleFlag::Fast);
         pImp->aPosImage = Image(b);
 
         b = pImp->aSizeImage.GetBitmapEx();
-        b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST);
+        b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BmpScaleFlag::Fast);
         pImp->aSizeImage = Image(b);
     }
 
diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx
index b4c795b..9fe589a 100644
--- a/svx/source/stbctrls/selctrl.cxx
+++ b/svx/source/stbctrls/selctrl.cxx
@@ -81,7 +81,7 @@ SvxSelectionModeControl::SvxSelectionModeControl( sal_uInt16 _nSlotId,
     if ( GetStatusBar().GetDPIScaleFactor() > 1 )
     {
         BitmapEx b = maImage.GetBitmapEx();
-        b.Scale(GetStatusBar().GetDPIScaleFactor(), GetStatusBar().GetDPIScaleFactor(), BMP_SCALE_FAST);
+        b.Scale(GetStatusBar().GetDPIScaleFactor(), GetStatusBar().GetDPIScaleFactor(), BmpScaleFlag::Fast);
         maImage = Image(b);
     }
 //#endif
diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx
index f49c255..8ae7cb8 100644
--- a/svx/source/stbctrls/xmlsecctrl.cxx
+++ b/svx/source/stbctrls/xmlsecctrl.cxx
@@ -67,7 +67,7 @@ XmlSecStatusBarControl::XmlSecStatusBarControl( sal_uInt16 _nSlotId,  sal_uInt16
         for (int i = 0; i < 3; i++)
         {
             BitmapEx b = arr[i].GetBitmapEx();
-            b.Scale(_rStb.GetDPIScaleFactor(), _rStb.GetDPIScaleFactor(), BMP_SCALE_FAST);
+            b.Scale(_rStb.GetDPIScaleFactor(), _rStb.GetDPIScaleFactor(), BmpScaleFlag::Fast);
             arr[i] = Image(b);
         }
 
diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx
index 52ef58c..0bb522c 100644
--- a/svx/source/stbctrls/zoomsliderctrl.cxx
+++ b/svx/source/stbctrls/zoomsliderctrl.cxx
@@ -172,7 +172,7 @@ SvxZoomSliderControl::SvxZoomSliderControl( sal_uInt16 _nSlotId,  sal_uInt16 _nI
         {
             BitmapEx aBitmap = arr[i].GetBitmapEx();
             //Use Lanczos scaling for the slider button because it does a better job with circles
-            aBitmap.Scale(nScaleFactor, nScaleFactor, i == 0 ? BMP_SCALE_LANCZOS : BMP_SCALE_FAST);
+            aBitmap.Scale(nScaleFactor, nScaleFactor, i == 0 ? BmpScaleFlag::Lanczos : BmpScaleFlag::Fast);
             arr[i] = Image(aBitmap);
         }
         mxImpl->maSliderButton = arr[0];
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 26a7269..4c91ae6 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -843,7 +843,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
                         {
                             BitmapEx aBmpEx( aGraphic.GetBitmapEx() );
                             // export: use highest quality
-                            aBmpEx.Scale( Size( rSettings.mnWidth, rSettings.mnHeight ), BMP_SCALE_LANCZOS );
+                            aBmpEx.Scale( Size( rSettings.mnWidth, rSettings.mnHeight ), BmpScaleFlag::Lanczos );
                             aGraphic = aBmpEx;
                         }
 
diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx
index 4bfe888..6dc7849 100644
--- a/svx/source/xoutdev/xtabdash.cxx
+++ b/svx/source/xoutdev/xtabdash.cxx
@@ -176,7 +176,7 @@ Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash)
 
     if(1 != nFactor)
     {
-        aRetval.Scale(Size((rSize.Width() * 5) / 2, rSize.Height()), BMP_SCALE_DEFAULT);
+        aRetval.Scale(Size((rSize.Width() * 5) / 2, rSize.Height()), BmpScaleFlag::Default);
     }
 
     return aRetval;
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index d7c8d21..c6b660c 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -6193,7 +6193,7 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, const Point& aPoint, con
             const long nWidth = aPageRightShadow.GetSizePixel().Width();
             const long nHeight = aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1);
             if (aPageRightShadow.GetSizePixel().Height() < nHeight)
-                aPageRightShadow.Scale(Size(nWidth, nHeight), BMP_SCALE_FAST);
+                aPageRightShadow.Scale(Size(nWidth, nHeight), BmpScaleFlag::Fast);
 
             lcl_paintBitmapExToRect(pOut,
                     Point(aPaintRect.Right() + mnShadowPxWidth, aPagePxRect.Top() + mnShadowPxWidth - 1),
@@ -6214,7 +6214,7 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, const Point& aPoint, con
             const long nWidth = aPageLeftShadow.GetSizePixel().Width();
             const long nHeight = aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1);
             if (aPageLeftShadow.GetSizePixel().Height() < nHeight)
-                aPageLeftShadow.Scale(Size(nWidth, nHeight), BMP_SCALE_FAST);
+                aPageLeftShadow.Scale(Size(nWidth, nHeight), BmpScaleFlag::Fast);
 
             lcl_paintBitmapExToRect(pOut,
                     Point(lLeft, aPagePxRect.Top() + mnShadowPxWidth - 1),
@@ -6226,7 +6226,7 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, const Point& aPoint, con
     // Bottom shadow
     const long nBottomHeight = aPageBottomShadow.GetSizePixel().Height();
     if (aPageBottomShadow.GetSizePixel().Width() < aPaintRect.Width())
-        aPageBottomShadow.Scale(Size(aPaintRect.Width(), nBottomHeight), BMP_SCALE_FAST);
+        aPageBottomShadow.Scale(Size(aPaintRect.Width(), nBottomHeight), BmpScaleFlag::Fast);
 
     lcl_paintBitmapExToRect(pOut,
             Point(aPaintRect.Left(), aPagePxRect.Bottom() + 2),
@@ -6236,7 +6236,7 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, const Point& aPoint, con
     // Top shadow
     const long nTopHeight = aPageTopShadow.GetSizePixel().Height();
     if (aPageTopShadow.GetSizePixel().Width() < aPaintRect.Width())
-        aPageTopShadow.Scale(Size(aPaintRect.Width(), nTopHeight), BMP_SCALE_FAST);
+        aPageTopShadow.Scale(Size(aPaintRect.Width(), nTopHeight), BmpScaleFlag::Fast);
 
     lcl_paintBitmapExToRect(pOut,
             Point(aPaintRect.Left(), aPagePxRect.Top() - mnShadowPxWidth),
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 36ab74a..1a08cde 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1560,7 +1560,7 @@ void SwContentTree::Display( bool bActive )
                 OUString rImageName = aEntryImages.GetImageName(i);
                 BitmapEx b = aEntryImages.GetImage(rImageName).GetBitmapEx();
                 //Use Lanczos because it looks better with circles / diagonals
-                b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_LANCZOS);
+                b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Lanczos);
                 aEntryImages.ReplaceImage(rImageName, Image(b));
             }
         }
diff --git a/sw/source/uibase/utlui/viewlayoutctrl.cxx b/sw/source/uibase/utlui/viewlayoutctrl.cxx
index 8ba1e3b..68f2559 100644
--- a/sw/source/uibase/utlui/viewlayoutctrl.cxx
+++ b/sw/source/uibase/utlui/viewlayoutctrl.cxx
@@ -62,7 +62,7 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId,
         for (int i = 0; i < 6; i++)
         {
             BitmapEx aBitmap = arr[i].GetBitmapEx();
-            aBitmap.Scale(nScaleFactor, nScaleFactor, BMP_SCALE_FAST);
+            aBitmap.Scale(nScaleFactor, nScaleFactor, BmpScaleFlag::Fast);
             arr[i] = Image(aBitmap);
         }
 
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index 639cc59..bd76ce3 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -623,7 +623,7 @@ namespace
 
                 bool bModified( false );
                 BitmapEx aBitmapEx = aImage.GetBitmapEx();
-                bModified = aBitmapEx.Scale( aNewSize, BMP_SCALE_BESTQUALITY );
+                bModified = aBitmapEx.Scale( aNewSize, BmpScaleFlag::BestQuality );
 
                 if ( bModified )
                     aImage = Image( aBitmapEx );
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index 23dae7e..901526e 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -360,7 +360,7 @@ bool SvpSalBitmap::Erase( const ::Color& /*rFillColor*/ )
     return false;
 }
 
-bool SvpSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, sal_uInt32 /*nScaleFlag*/ )
+bool SvpSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, BmpScaleFlag /*nScaleFlag*/ )
 {
     return false;
 }
diff --git a/vcl/inc/headless/svpbmp.hxx b/vcl/inc/headless/svpbmp.hxx
index b0fc076..168852e 100644
--- a/vcl/inc/headless/svpbmp.hxx
+++ b/vcl/inc/headless/svpbmp.hxx
@@ -61,7 +61,7 @@ public:
 
     virtual bool            Crop( const Rectangle& rRectPixel ) SAL_OVERRIDE;
     virtual bool            Erase( const Color& rFillColor ) SAL_OVERRIDE;
-    virtual bool            Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) SAL_OVERRIDE;
+    virtual bool            Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) SAL_OVERRIDE;
     virtual bool            Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) SAL_OVERRIDE;
 
     static sal_uInt32 getBitCountFromScanlineFormat( basebmp::Format nFormat );
diff --git a/vcl/inc/impbmp.hxx b/vcl/inc/impbmp.hxx
index aebc89f..0dc9ec8 100644
--- a/vcl/inc/impbmp.hxx
+++ b/vcl/inc/impbmp.hxx
@@ -65,7 +65,7 @@ public:
     inline void         ImplSetChecksum( sal_uLong nChecksum ) { mnChecksum = nChecksum; }
     inline sal_uLong    ImplGetChecksum() const { return mnChecksum; }
 
-    bool                ImplScale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag );
+    bool                ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag );
     bool                ImplReplace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol );
 };
 
diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx
index 7536144..3df78c8 100644
--- a/vcl/inc/opengl/salbmp.hxx
+++ b/vcl/inc/opengl/salbmp.hxx
@@ -81,7 +81,7 @@ public:
 
     bool            Crop( const Rectangle& rRectPixel ) SAL_OVERRIDE;
     bool            Erase( const Color& rFillColor ) SAL_OVERRIDE;
-    bool            Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) SAL_OVERRIDE;
+    bool            Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) SAL_OVERRIDE;
     bool            Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) SAL_OVERRIDE;
 
 public:
@@ -108,7 +108,7 @@ private:
 
 public:
 
-    bool ImplScale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag );
+    bool ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag );
 };
 
 #endif // INCLUDED_VCL_INC_OPENGL_SALBMP_H
diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx
index 432c4df..f89f417 100644
--- a/vcl/inc/salbmp.hxx
+++ b/vcl/inc/salbmp.hxx
@@ -32,6 +32,7 @@ class Color;
 class SalGraphics;
 class BitmapPalette;
 struct BitmapSystemData;
+enum class BmpScaleFlag;
 
 class VCL_PLUGIN_PUBLIC SalBitmap
 {
@@ -60,7 +61,7 @@ public:
 
     virtual bool            Crop( const Rectangle& rRectPixel ) = 0;
     virtual bool            Erase( const Color& rFillColor ) = 0;
-    virtual bool            Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) = 0;
+    virtual bool            Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) = 0;
     virtual bool            Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) = 0;
 };
 
diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h
index 0dc5b36..65d85ba 100644
--- a/vcl/inc/unx/salbmp.h
+++ b/vcl/inc/unx/salbmp.h
@@ -148,7 +148,7 @@ public:
 
     virtual bool                Crop( const Rectangle& rRectPixel ) SAL_OVERRIDE;
     virtual bool                Erase( const Color& rFillColor ) SAL_OVERRIDE;
-    virtual bool                Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) SAL_OVERRIDE;
+    virtual bool                Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) SAL_OVERRIDE;
     virtual bool                Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) SAL_OVERRIDE;
 };
 
diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx
index 741d973..950aa50 100644
--- a/vcl/opengl/scale.cxx
+++ b/vcl/opengl/scale.cxx
@@ -34,10 +34,10 @@ private:
     OpenGLSalBitmap*    mpBitmap;
     double              mfScaleX;
     double              mfScaleY;
-    sal_uInt32          mnScaleFlag;
+    BmpScaleFlag        mnScaleFlag;
 
 public:
-    ScaleOp( OpenGLSalBitmap* pBitmap, const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag );
+    ScaleOp( OpenGLSalBitmap* pBitmap, const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag );
 
     bool Execute() SAL_OVERRIDE;
     void GetSize( Size& rSize ) const SAL_OVERRIDE;
@@ -261,32 +261,32 @@ bool OpenGLSalBitmap::ImplScaleArea( double rScaleX, double rScaleY )
     return true;
 }
 
-bool OpenGLSalBitmap::ImplScale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
+bool OpenGLSalBitmap::ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
 {
     SAL_INFO( "vcl.opengl", "::ImplScale" );
 
     maUserBuffer.reset();
     makeCurrent();
 
-    if( nScaleFlag == BMP_SCALE_FAST )
+    if( nScaleFlag == BmpScaleFlag::Fast )
     {
         return ImplScaleFilter( rScaleX, rScaleY, GL_NEAREST );
     }
-    if( nScaleFlag == BMP_SCALE_BILINEAR )
+    if( nScaleFlag == BmpScaleFlag::BiLinear )
     {
         return ImplScaleFilter( rScaleX, rScaleY, GL_LINEAR );
     }
-    else if( nScaleFlag == BMP_SCALE_SUPER || nScaleFlag == BMP_SCALE_DEFAULT )
+    else if( nScaleFlag == BmpScaleFlag::Super || nScaleFlag == BmpScaleFlag::Default )
     {
         const Lanczos3Kernel aKernel;
 
         return ImplScaleConvolution( rScaleX, rScaleY, aKernel );
     }
-    else if( nScaleFlag == BMP_SCALE_BESTQUALITY && rScaleX <= 1 && rScaleY <= 1 )
+    else if( nScaleFlag == BmpScaleFlag::BestQuality && rScaleX <= 1 && rScaleY <= 1 )
     { // Use are scaling for best quality, but only if downscaling.
         return ImplScaleArea( rScaleX, rScaleY );
     }
-    else if( nScaleFlag == BMP_SCALE_LANCZOS || nScaleFlag == BMP_SCALE_BESTQUALITY  )
+    else if( nScaleFlag == BmpScaleFlag::Lanczos || nScaleFlag == BmpScaleFlag::BestQuality  )
     {
         const Lanczos3Kernel aKernel;
 
@@ -301,7 +301,7 @@ ScaleOp::ScaleOp(
     OpenGLSalBitmap* pBitmap,
     const double& rScaleX,
     const double& rScaleY,
-    sal_uInt32 nScaleFlag )
+    BmpScaleFlag nScaleFlag )
 : mpBitmap( pBitmap )
 , mfScaleX( rScaleX )
 , mfScaleY( rScaleY )
@@ -322,16 +322,16 @@ void ScaleOp::GetSize( Size& rSize ) const
     rSize.setHeight( rSize.Height() * mfScaleY );
 }
 
-bool OpenGLSalBitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
+bool OpenGLSalBitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
 {
-    SAL_INFO( "vcl.opengl", "::Scale " << nScaleFlag );
-
-    if( nScaleFlag == BMP_SCALE_FAST ||
-        nScaleFlag == BMP_SCALE_BILINEAR ||
-        nScaleFlag == BMP_SCALE_SUPER ||
-        nScaleFlag == BMP_SCALE_LANCZOS ||
-        nScaleFlag == BMP_SCALE_DEFAULT ||
-        nScaleFlag == BMP_SCALE_BESTQUALITY )
+    SAL_INFO( "vcl.opengl", "::Scale " << static_cast<int>(nScaleFlag) );
+
+    if( nScaleFlag == BmpScaleFlag::Fast ||
+        nScaleFlag == BmpScaleFlag::BiLinear ||
+        nScaleFlag == BmpScaleFlag::Super ||
+        nScaleFlag == BmpScaleFlag::Lanczos ||
+        nScaleFlag == BmpScaleFlag::Default ||
+        nScaleFlag == BmpScaleFlag::BestQuality )
     {
         makeCurrent();
         if( mpContext == NULL )
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index c52727b..306b0df 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -112,7 +112,7 @@ void BitmapTest::testScale()
         rFilter.compressAsPNG(aBitmap24Bit, aStream, 9);
     }
 
-    aBitmap24Bit.Scale(2, 2, BMP_SCALE_FAST);
+    aBitmap24Bit.Scale(2, 2, BmpScaleFlag::Fast);
 
     CPPUNIT_ASSERT_EQUAL(static_cast<long>(20), aBitmap24Bit.GetSizePixel().Width());
     CPPUNIT_ASSERT_EQUAL(static_cast<long>(20), aBitmap24Bit.GetSizePixel().Height());
diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
index 81706f8..9e5f798 100644
--- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
@@ -62,7 +62,7 @@ bool VclFiltersTest::load(const OUString &,
 
 void VclFiltersTest::testScaling()
 {
-    for (unsigned int i = BMP_SCALE_NONE + 1; i <= BMP_SCALE_BOX; i++)
+    for (BmpScaleFlag i = BmpScaleFlag::Default; i <= BmpScaleFlag::Box; i = (BmpScaleFlag)((int)i + 1))
     {
         Bitmap aBitmap( Size( 413, 409 ), 24 );
         BitmapEx aBitmapEx( aBitmap );
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 9451b16..f3dc33e 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -864,7 +864,7 @@ bool Bitmap::ImplConvertGhosted()
     return bRet;
 }
 
-bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
+bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
 {
     bool bRetval(false);
 
@@ -904,7 +904,7 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc
     //fdo#33455
     //
     //If we start with a 1 bit image, then after scaling it in any mode except
-    //BMP_SCALE_FAST we have a 24bit image which is perfectly correct, but we
+    //BmpScaleFlag::Fast we have a 24bit image which is perfectly correct, but we
     //are going to down-shift it to mono again and Bitmap::ImplMakeMono just
     //has "Bitmap aNewBmp( GetSizePixel(), 1 );" to create a 1 bit bitmap which
     //will default to black/white and the colors mapped to which ever is closer
@@ -914,28 +914,28 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc
     //just use the fast scale rather than attempting to count unique colors in
     //the other converters and pass all the info down through
     //Bitmap::ImplMakeMono
-    if (nStartCount == 1 && nScaleFlag != BMP_SCALE_NONE)
-        nScaleFlag = BMP_SCALE_FAST;
+    if (nStartCount == 1 && nScaleFlag != BmpScaleFlag::NONE)
+        nScaleFlag = BmpScaleFlag::Fast;
 
     switch(nScaleFlag)
     {
-        case BMP_SCALE_NONE :
+        case BmpScaleFlag::NONE :
         {
             bRetval = false;
             break;
         }
-        case BMP_SCALE_FAST :
+        case BmpScaleFlag::Fast :
         {
             bRetval = ImplScaleFast( rScaleX, rScaleY );
             break;
         }
-        case BMP_SCALE_INTERPOLATE :
+        case BmpScaleFlag::Interpolate :
         {
             bRetval = ImplScaleInterpolate( rScaleX, rScaleY );
             break;
         }
-        case BMP_SCALE_SUPER:
-        case BMP_SCALE_DEFAULT:
+        case BmpScaleFlag::Super:
+        case BmpScaleFlag::Default:
         {
             if (GetSizePixel().Width() < 2 || GetSizePixel().Height() < 2)
             {
@@ -949,29 +949,29 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc
             }
             break;
         }
-        case BMP_SCALE_LANCZOS :
-        case BMP_SCALE_BESTQUALITY:
+        case BmpScaleFlag::Lanczos :
+        case BmpScaleFlag::BestQuality:
         {
             const Lanczos3Kernel kernel;
 
             bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
             break;
         }
-        case BMP_SCALE_BICUBIC :
+        case BmpScaleFlag::BiCubic :
         {
             const BicubicKernel kernel;
 
             bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
             break;
         }
-        case BMP_SCALE_BILINEAR :
+        case BmpScaleFlag::BiLinear :
         {
             const BilinearKernel kernel;
 
             bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
             break;
         }
-        case BMP_SCALE_BOX :
+        case BmpScaleFlag::Box :
         {
             const BoxKernel kernel;
 
@@ -984,7 +984,7 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc
     return bRetval;
 }
 
-bool Bitmap::Scale( const Size& rNewSize, sal_uInt32 nScaleFlag )
+bool Bitmap::Scale( const Size& rNewSize, BmpScaleFlag nScaleFlag )
 {
     const Size aSize( GetSizePixel() );
     bool bRet;
@@ -1556,8 +1556,8 @@ namespace
     }
 }
 
-// #i121233# Added BMP_SCALE_LANCZOS, BMP_SCALE_BICUBIC, BMP_SCALE_BILINEAR and
-// BMP_SCALE_BOX derived from the original commit from Tomas Vajngerl (see
+// #i121233# Added BmpScaleFlag::Lanczos, BmpScaleFlag::BiCubic, BmpScaleFlag::BiLinear and
+// BmpScaleFlag::Box derived from the original commit from Tomas Vajngerl (see
 // bugzilla task for deitails) Thanks!
 bool Bitmap::ImplScaleConvolution(
     const double& rScaleX,
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 41f1e92..38a770d 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -336,7 +336,7 @@ sal_uLong BitmapEx::GetChecksum() const
     return nCrc;
 }
 
-void BitmapEx::SetSizePixel( const Size& rNewSize, sal_uInt32 nScaleFlag )
+void BitmapEx::SetSizePixel( const Size& rNewSize, BmpScaleFlag nScaleFlag )
 {
     if(GetSizePixel() != rNewSize)
     {
@@ -374,7 +374,7 @@ bool BitmapEx::Mirror( sal_uLong nMirrorFlags )
     return bRet;
 }
 
-bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
+bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
 {
     bool bRet = false;
 
@@ -396,7 +396,7 @@ bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 n
     return bRet;
 }
 
-bool BitmapEx::Scale( const Size& rNewSize, sal_uInt32 nScaleFlag )
+bool BitmapEx::Scale( const Size& rNewSize, BmpScaleFlag nScaleFlag )
 {
     bool bRet;
 
@@ -695,7 +695,7 @@ BitmapEx BitmapEx:: AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize
         }
 
         aScaledSize = Size( imgNewWidth, imgNewHeight );
-        aRet.Scale( aScaledSize, BMP_SCALE_BESTQUALITY );
+        aRet.Scale( aScaledSize, BmpScaleFlag::BestQuality );
     }
     else
     {
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 0eafc4f..f3a4492 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2887,7 +2887,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm )
     return rOStm;
 }
 
-bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, sal_uInt32 nMaximumExtent, BmpConversion eColorConversion, long nScaleFlag) const
+bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, sal_uInt32 nMaximumExtent, BmpConversion eColorConversion, BmpScaleFlag nScaleFlag) const
 {
     // initialization seems to be complicated but is used to avoid rounding errors
     ScopedVclPtrInstance< VirtualDevice > aVDev;
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index 696ede0..298bfaa 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -88,7 +88,7 @@ void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode
         mnChecksum = 0;
 }
 
-bool ImpBitmap::ImplScale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
+bool ImpBitmap::ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
 {
     return mpSalBitmap->Scale( rScaleX, rScaleY, nScaleFlag );
 }
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 58bb314..7758c6d 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -568,7 +568,7 @@ BitmapEx ImpGraphic::ImplGetBitmapEx(const GraphicConversionParameters& rParamet
         {
             aRetBmpEx.Scale(
                 rParameters.getSizePixel(),
-                rParameters.getScaleHighQuality() ? BMP_SCALE_INTERPOLATE : BMP_SCALE_FAST);
+                rParameters.getScaleHighQuality() ? BmpScaleFlag::Interpolate : BmpScaleFlag::Fast);
         }
     }
     else if( ( meType != GRAPHIC_DEFAULT ) && ImplIsSupportedGraphic() )
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 09c8d1b..837d69f 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -128,7 +128,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz
                 if( aNewBmpSize.Width() && aNewBmpSize.Height() )
                 {
                     // #i121233# Use best quality for PDF exports
-                    aBitmapEx.Scale( aNewBmpSize, BMP_SCALE_BESTQUALITY );
+                    aBitmapEx.Scale( aNewBmpSize, BmpScaleFlag::BestQuality );
                 }
                 else
                 {
diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx
index a1ebb5d..c532606 100644
--- a/vcl/source/helper/canvasbitmap.cxx
+++ b/vcl/source/helper/canvasbitmap.cxx
@@ -448,7 +448,7 @@ uno::Reference< rendering::XBitmap > SAL_CALL VclCanvasBitmap::getScaledBitmap(
     SolarMutexGuard aGuard;
 
     BitmapEx aNewBmp( m_aBitmap );
-    aNewBmp.Scale( sizeFromRealSize2D( newSize ), beFast ? BMP_SCALE_DEFAULT : BMP_SCALE_BESTQUALITY );
+    aNewBmp.Scale( sizeFromRealSize2D( newSize ), beFast ? BmpScaleFlag::Default : BmpScaleFlag::BestQuality );
     return uno::Reference<rendering::XBitmap>( new VclCanvasBitmap( aNewBmp ) );
 }
 
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index a70a3d0..5571d03 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1947,7 +1947,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI
                     if (nScaleFactor != 1)
                     {
                         BitmapEx aBitmap = aImage.GetBitmapEx();
-                        aBitmap.Scale(nScaleFactor, nScaleFactor, BMP_SCALE_FAST);
+                        aBitmap.Scale(nScaleFactor, nScaleFactor, BmpScaleFlag::Fast);
                         aImage = Image(aBitmap);
                     }
                     aTmpPos = aOuterCheckRect.TopLeft();
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 2391f61..ad18df4 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -184,7 +184,7 @@ void PrintDialog::PrintPreviewWindow::Paint( vcl::RenderContext& /*rRenderContex
     else
     {
         Bitmap aPreviewBitmap(maPreviewBitmap);
-        aPreviewBitmap.Scale(maPreviewSize, BMP_SCALE_BESTQUALITY);
+        aPreviewBitmap.Scale(maPreviewSize, BmpScaleFlag::BestQuality);
         DrawBitmap(aOffset, aPreviewBitmap);
     }
 
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 4d3c801..cedf3bd 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1124,7 +1124,7 @@ void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
             // FIXME find out what that code is & fix accordingly
             if (aBitmap.GetSizePixel().Width() < 32)
             {
-                aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST);
+                aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
                 aImage = Image(aBitmap);
             }
         }
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index fb003fb..8087b22 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -870,7 +870,7 @@ bool X11SalBitmap::Erase( const ::Color& /*rFillColor*/ )
     return false;
 }
 
-bool X11SalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, sal_uInt32 /*nScaleFlag*/ )
+bool X11SalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, BmpScaleFlag /*nScaleFlag*/ )
 {
     return false;
 }
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index db73f57..8ddfca0 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -660,7 +660,7 @@ public:
             for (size_t i = 0; i < SAL_N_ELEMENTS(aSizes); i++)
             {
                 aShadowStretch.Scale(Size(aShadowStretch.GetSizePixel().Width(), aSizes[i]),
-                                     BMP_SCALE_FAST);
+                                     BmpScaleFlag::Fast);
 
                 rDev.DrawBitmapEx(aRenderPt, aShadowStretch);
                 aRenderPt.Move(aShadowStretch.GetSizePixel().Width() + 4, 0);
@@ -685,7 +685,7 @@ public:
                                   const RenderContext &rCtx) SAL_OVERRIDE
         {
             Bitmap aBitmap(rCtx.mpDemoRenderer->maIntroBW);
-            aBitmap.Scale(r.GetSize(), BMP_SCALE_BESTQUALITY);
+            aBitmap.Scale(r.GetSize(), BmpScaleFlag::BestQuality);
             rDev.DrawBitmap(r.TopLeft(), aBitmap);
 
             SimulateBorderStretch(rDev, r);
@@ -702,7 +702,7 @@ public:
             maCheckered.RenderRegion(rDev, r, rCtx);
 
             BitmapEx aBitmap(rCtx.mpDemoRenderer->maIntro);
-            aBitmap.Scale(r.GetSize(), BMP_SCALE_BESTQUALITY);
+            aBitmap.Scale(r.GetSize(), BmpScaleFlag::BestQuality);
             AlphaMask aSemiTransp(aBitmap.GetSizePixel());
             aSemiTransp.Erase(64);
             rDev.DrawBitmapEx(r.TopLeft(), BitmapEx(aBitmap.GetBitmap(),
@@ -1069,7 +1069,7 @@ public:
                                   const RenderContext &) SAL_OVERRIDE
         {
             Bitmap aBitmap(rDev.GetBitmap(Point(0,0),rDev.GetOutputSizePixel()));
-            aBitmap.Scale(r.GetSize(), BMP_SCALE_BESTQUALITY);
+            aBitmap.Scale(r.GetSize(), BmpScaleFlag::BestQuality);
             rDev.DrawBitmap(r.TopLeft(), aBitmap);
         }
     };
commit ba121a3269d17f87c6d09b9e46aaaf921af40ef6
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 5 13:18:56 2015 +0200

    convert USER_OPT constants to scoped enum
    
    Change-Id: I85a1c9f89ac79e0e54fcd8dfd1908325fae9a8ac

diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 27052c7..ad9ed8b 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -107,50 +107,50 @@ struct
     // id of the edit box
     const char *pEditId;
     // id for SvtUserOptions in unotools/useroptions.hxx
-    int nUserOptionsId;
+    UserOptToken nUserOptionsId;
     // id for settings the focus (defined in svx/optgenrl.hxx)
     EditPosition nGrabFocusId;
 }
 const vFieldInfo[] =
 {
     // Company
-    { Row_Company, "company", USER_OPT_COMPANY, EditPosition::COMPANY },
+    { Row_Company, "company", UserOptToken::Company, EditPosition::COMPANY },
     // Name
-    { Row_Name, "firstname", USER_OPT_FIRSTNAME, EditPosition::FIRSTNAME },
-    { Row_Name, "lastname", USER_OPT_LASTNAME, EditPosition::LASTNAME  },
-    { Row_Name, "shortname", USER_OPT_ID, EditPosition::SHORTNAME },
+    { Row_Name, "firstname", UserOptToken::FirstName, EditPosition::FIRSTNAME },
+    { Row_Name, "lastname", UserOptToken::LastName, EditPosition::LASTNAME  },
+    { Row_Name, "shortname", UserOptToken::ID, EditPosition::SHORTNAME },
     // Name (russian)
-    { Row_Name_Russian, "ruslastname", USER_OPT_LASTNAME, EditPosition::LASTNAME  },
-    { Row_Name_Russian, "rusfirstname", USER_OPT_FIRSTNAME, EditPosition::FIRSTNAME },
-    { Row_Name_Russian, "rusfathersname", USER_OPT_FATHERSNAME, EditPosition::UNKNOWN },
-    { Row_Name_Russian, "russhortname", USER_OPT_ID, EditPosition::SHORTNAME },
+    { Row_Name_Russian, "ruslastname", UserOptToken::LastName, EditPosition::LASTNAME  },
+    { Row_Name_Russian, "rusfirstname", UserOptToken::FirstName, EditPosition::FIRSTNAME },
+    { Row_Name_Russian, "rusfathersname", UserOptToken::FathersName, EditPosition::UNKNOWN },
+    { Row_Name_Russian, "russhortname", UserOptToken::ID, EditPosition::SHORTNAME },
     // Name (eastern: reversed name ord
-    { Row_Name_Eastern, "eastlastname", USER_OPT_LASTNAME, EditPosition::LASTNAME  },
-    { Row_Name_Eastern, "eastfirstname", USER_OPT_FIRSTNAME, EditPosition::FIRSTNAME },
-    { Row_Name_Eastern, "eastshortname", USER_OPT_ID, EditPosition::SHORTNAME },
+    { Row_Name_Eastern, "eastlastname", UserOptToken::LastName, EditPosition::LASTNAME  },
+    { Row_Name_Eastern, "eastfirstname", UserOptToken::FirstName, EditPosition::FIRSTNAME },
+    { Row_Name_Eastern, "eastshortname", UserOptToken::ID, EditPosition::SHORTNAME },
     // Street
-    { Row_Street, "street", USER_OPT_STREET, EditPosition::STREET },
+    { Row_Street, "street", UserOptToken::Street, EditPosition::STREET },
     // Street (russian)
-    { Row_Street_Russian, "russtreet", USER_OPT_STREET, EditPosition::STREET },
-    { Row_Street_Russian, "apartnum", USER_OPT_APARTMENT, EditPosition::UNKNOWN },
+    { Row_Street_Russian, "russtreet", UserOptToken::Street, EditPosition::STREET },
+    { Row_Street_Russian, "apartnum", UserOptToken::Apartment, EditPosition::UNKNOWN },
     // City
-    { Row_City, "izip", USER_OPT_ZIP, EditPosition::PLZ },
-    { Row_City, "icity", USER_OPT_CITY, EditPosition::CITY },
+    { Row_City, "izip", UserOptToken::Zip, EditPosition::PLZ },
+    { Row_City, "icity", UserOptToken::City, EditPosition::CITY },
     // City (US)
-    { Row_City_US, "city", USER_OPT_CITY, EditPosition::CITY },
-    { Row_City_US, "state", USER_OPT_STATE, EditPosition::STATE },
-    { Row_City_US, "zip", USER_OPT_ZIP, EditPosition::PLZ },
+    { Row_City_US, "city", UserOptToken::City, EditPosition::CITY },
+    { Row_City_US, "state", UserOptToken::State, EditPosition::STATE },
+    { Row_City_US, "zip", UserOptToken::Zip, EditPosition::PLZ },
     // Country
-    { Row_Country, "country", USER_OPT_COUNTRY, EditPosition::COUNTRY },
+    { Row_Country, "country", UserOptToken::Country, EditPosition::COUNTRY },
     // Title/Position
-    { Row_TitlePos, "title", USER_OPT_TITLE,    EditPosition::TITLE },
-    { Row_TitlePos, "position", USER_OPT_POSITION, EditPosition::POSITION },
+    { Row_TitlePos, "title", UserOptToken::Title,    EditPosition::TITLE },
+    { Row_TitlePos, "position", UserOptToken::Position, EditPosition::POSITION },
     // Phone
-    { Row_Phone, "home", USER_OPT_TELEPHONEHOME, EditPosition::TELPRIV },
-    { Row_Phone, "work", USER_OPT_TELEPHONEWORK, EditPosition::TELCOMPANY },
+    { Row_Phone, "home", UserOptToken::TelephoneHome, EditPosition::TELPRIV },
+    { Row_Phone, "work", UserOptToken::TelephoneWork, EditPosition::TELCOMPANY },
     // Fax/Mail
-    { Row_FaxMail, "fax", USER_OPT_FAX, EditPosition::FAX },
-    { Row_FaxMail, "email", USER_OPT_EMAIL, EditPosition::EMAIL },
+    { Row_FaxMail, "fax", UserOptToken::Fax, EditPosition::FAX },
+    { Row_FaxMail, "email", UserOptToken::Email, EditPosition::EMAIL },
 };
 
 
@@ -278,7 +278,7 @@ void SvxGeneralTabPage::InitControls ()
             vFields.push_back(boost::make_shared<Field>(
                 get<Edit>(vFieldInfo[iField].pEditId), iField));
             // "short name" field?
-            if (vFieldInfo[iField].nUserOptionsId == USER_OPT_ID)
+            if (vFieldInfo[iField].nUserOptionsId == UserOptToken::ID)
             {
                 nNameRow = vRows.size() - 1;
                 nShortNameField = vFields.size() - 1;
@@ -420,7 +420,7 @@ void SvxGeneralTabPage::SetAddress_Impl()
         {
             Field& rField = *vFields[iField];
             // updating content
-            unsigned const nToken = vFieldInfo[rField.iField].nUserOptionsId;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list