[Libreoffice-commits] core.git: 3 commits - connectivity/source desktop/source include/svtools include/vcl svtools/source vcl/inc vcl/opengl vcl/quartz vcl/source vcl/unx vcl/win

Noel Grandin noel at peralex.com
Sun May 22 17:53:44 UTC 2016


 connectivity/source/commontools/TSortIndex.cxx   |    2 +-
 connectivity/source/drivers/dbase/DResultSet.cxx |    2 +-
 connectivity/source/drivers/file/FResultSet.cxx  |    2 +-
 connectivity/source/drivers/file/FStatement.cxx  |    2 +-
 connectivity/source/drivers/mork/MResultSet.cxx  |    2 +-
 connectivity/source/drivers/mork/MStatement.cxx  |    2 +-
 connectivity/source/inc/TSortIndex.hxx           |    9 +++++----
 desktop/source/app/app.cxx                       |    8 ++++----
 include/svtools/apearcfg.hxx                     |   14 +++++++-------
 include/vcl/salbtype.hxx                         |   11 +++++------
 svtools/source/config/apearcfg.cxx               |   12 +++++++++---
 vcl/inc/salbmp.hxx                               |    4 ++--
 vcl/opengl/salbmp.cxx                            |    6 +++---
 vcl/quartz/salbmp.cxx                            |    2 +-
 vcl/source/gdi/bmpacc.cxx                        |   10 +++++-----
 vcl/source/gdi/impbmp.cxx                        |    2 +-
 vcl/unx/generic/gdi/gdiimpl.cxx                  |   12 ++++++------
 vcl/unx/generic/gdi/salbmp.cxx                   |    2 +-
 vcl/unx/generic/print/genpspgraphics.cxx         |    4 ++--
 vcl/win/gdi/gdiimpl.cxx                          |    4 ++--
 vcl/win/gdi/salbmp.cxx                           |   20 ++++++++++----------
 vcl/win/gdi/salgdi2.cxx                          |    8 ++++----
 22 files changed, 73 insertions(+), 67 deletions(-)

New commits:
commit a887bed580a3e6388f8da0c5a19fd87888e11e95
Author: Noel Grandin <noel at peralex.com>
Date:   Fri May 20 16:10:46 2016 +0200

    convert TAscendingOrder to scoped enum
    
    Change-Id: Idd88c08df47c4175702cea0e0a36c6b3e031469f
    Reviewed-on: https://gerrit.libreoffice.org/25212
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/connectivity/source/commontools/TSortIndex.cxx b/connectivity/source/commontools/TSortIndex.cxx
index 59d170d..2af3810 100644
--- a/connectivity/source/commontools/TSortIndex.cxx
+++ b/connectivity/source/commontools/TSortIndex.cxx
@@ -39,7 +39,7 @@ struct TKeyValueFunc : ::std::binary_function<OSortIndex::TIntValuePairVector::v
         ::std::vector<OKeyType>::const_iterator aIter = aKeyType.begin();
         for (::std::vector<sal_Int16>::size_type i=0;aIter != aKeyType.end(); ++aIter,++i)
         {
-            const bool bGreater = pIndex->getAscending(i) != SQL_ASC;
+            const bool bGreater = pIndex->getAscending(i) != TAscendingOrder::ASC;
             const bool bLess = !bGreater;
 
             // compare depending for type
diff --git a/connectivity/source/drivers/dbase/DResultSet.cxx b/connectivity/source/drivers/dbase/DResultSet.cxx
index 6c3f4a2..40060a3 100644
--- a/connectivity/source/drivers/dbase/DResultSet.cxx
+++ b/connectivity/source/drivers/dbase/DResultSet.cxx
@@ -170,7 +170,7 @@ bool ODbaseResultSet::fillIndexValues(const Reference< XColumnsSupplier> &_xInde
                 sal_uInt32 nRec = pIter->First();
                 while (nRec != NODE_NOTFOUND)
                 {
-                    if (m_aOrderbyAscending[0])
+                    if (m_aOrderbyAscending[0] != TAscendingOrder::NONE)
                         m_pFileSet->get().push_back(nRec);
                     else
                         m_pFileSet->get().insert(m_pFileSet->get().begin(),nRec);
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index 1903d58..9b130c9 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -1274,7 +1274,7 @@ bool OResultSet::OpenImpl()
                         {
                             m_aOrderbyColumnNumber.push_back(i);
                             // ASC or DESC doesn't matter
-                            m_aOrderbyAscending.push_back(SQL_ASC);
+                            m_aOrderbyAscending.push_back(TAscendingOrder::ASC);
                         }
                     }
                     bDistinct = true;
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index f374b82..d37f157 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -382,7 +382,7 @@ void OStatement_Base::setOrderbyColumn( OSQLParseNode* pColumnRef,
     m_aOrderbyColumnNumber.push_back((aFind - aSelectColumns->get().begin()) + 1);
 
     // Ascending or Descending?
-    m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? SQL_DESC : SQL_ASC);
+    m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? TAscendingOrder::DESC : TAscendingOrder::ASC);
 }
 
 
diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx
index ca0e944..9d9c975 100644
--- a/connectivity/source/drivers/mork/MResultSet.cxx
+++ b/connectivity/source/drivers/mork/MResultSet.cxx
@@ -1148,7 +1148,7 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep
                     if(!IsSorted())
                     {
                         m_aOrderbyColumnNumber.push_back(m_aColMapping[1]);
-                        m_aOrderbyAscending.push_back(SQL_DESC);
+                        m_aOrderbyAscending.push_back(TAscendingOrder::DESC);
                     }
                     bDistinct = true;
                 }
diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx
index f8b04da..f2aeba6d 100644
--- a/connectivity/source/drivers/mork/MStatement.cxx
+++ b/connectivity/source/drivers/mork/MStatement.cxx
@@ -496,7 +496,7 @@ void OCommonStatement::setOrderbyColumn(    OSQLParseNode* pColumnRef,
     m_aOrderbyColumnNumber.push_back(xColLocate->findColumn(aColumnName));
 
     // Ascending or Descending?
-    m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? SQL_DESC : SQL_ASC);
+    m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? TAscendingOrder::DESC : TAscendingOrder::ASC);
 }
 
 
diff --git a/connectivity/source/inc/TSortIndex.hxx b/connectivity/source/inc/TSortIndex.hxx
index 0744220..328dbcc 100644
--- a/connectivity/source/inc/TSortIndex.hxx
+++ b/connectivity/source/inc/TSortIndex.hxx
@@ -31,11 +31,12 @@ namespace connectivity
         SQL_ORDERBYKEY_STRING       // String Key
     } OKeyType;
 
-    typedef enum
+    enum class TAscendingOrder
     {
-        SQL_ASC     = 1,            // ascending
-        SQL_DESC    = -1            // otherwise
-    } TAscendingOrder;
+        ASC     = 1,            // ascending
+        NONE    = 0,
+        DESC    = -1            // otherwise
+    };
 
     class OKeySet;
     class OKeyValue;                // simple class which holds a sal_Int32 and a ::std::vector<ORowSetValueDecoratorRef>
commit 84c7efb4aebbfcd2526e9f73f023bbda3c11a75c
Author: Noel Grandin <noel at peralex.com>
Date:   Fri May 20 15:58:24 2016 +0200

    Convert DragMode to scoped enum
    
    Change-Id: I68dafefc74bad355047738605defd97f3c6bebcd
    Reviewed-on: https://gerrit.libreoffice.org/25209
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 847381c..90254147 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1881,16 +1881,16 @@ void Desktop::OverrideSystemSettings( AllSettings& rSettings )
     DragFullOptions nDragFullOptions = hStyleSettings.GetDragFullOptions();
 
     SvtTabAppearanceCfg aAppearanceCfg;
-    sal_uInt16 nDragMode = aAppearanceCfg.GetDragMode();
+    DragMode nDragMode = aAppearanceCfg.GetDragMode();
     switch ( nDragMode )
     {
-    case DragFullWindow:
+    case DragMode::FullWindow:
         nDragFullOptions |= DragFullOptions::All;
         break;
-    case DragFrame:
+    case DragMode::Frame:
         nDragFullOptions &= ~DragFullOptions::All;
         break;
-    case DragSystemDep:
+    case DragMode::SystemDep:
     default:
         break;
     }
diff --git a/include/svtools/apearcfg.hxx b/include/svtools/apearcfg.hxx
index c4ae370..7b431c26 100644
--- a/include/svtools/apearcfg.hxx
+++ b/include/svtools/apearcfg.hxx
@@ -31,16 +31,16 @@ typedef enum {
     NoSnap
 } SnapType;
 
-typedef enum {
-    DragFullWindow,
-    DragFrame,
-    DragSystemDep
-} DragMode;
+enum class DragMode {
+    FullWindow,
+    Frame,
+    SystemDep
+};
 
 
 class SVT_DLLPUBLIC SvtTabAppearanceCfg : public utl::ConfigItem
 {
-    short           nDragMode           ;
+    DragMode        nDragMode           ;
     short           nScaleFactor        ;
     short           nSnapMode           ;
     MouseMiddleButtonAction nMiddleMouse;
@@ -64,7 +64,7 @@ public:
 
     virtual void Notify( const css::uno::Sequence< OUString >& _rPropertyNames) override;
 
-    sal_uInt16  GetDragMode  () const { return nDragMode; }
+    DragMode  GetDragMode  () const { return nDragMode; }
 
     sal_uInt16      GetScaleFactor () const { return nScaleFactor; }
     void        SetScaleFactor ( sal_uInt16 nSet );
diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx
index 378eb7f..dffd584 100644
--- a/svtools/source/config/apearcfg.cxx
+++ b/svtools/source/config/apearcfg.cxx
@@ -25,7 +25,7 @@
 #include <vcl/svapp.hxx>
 #include <sal/macros.h>
 
-#define DEFAULT_DRAGMODE    2
+#define DEFAULT_DRAGMODE    DragMode::SystemDep
 #define DEFAULT_SNAPMODE    0
 #define DEFAULT_SCALEFACTOR 100
 #if defined UNX
@@ -64,7 +64,13 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg()
                 switch(nProp)
                 {
                     case  0: *pValues >>= nScaleFactor; break; //"FontScaling",
-                    case  1: *pValues >>= nDragMode; break;   //"Window/Drag",
+                    case  1:    //"Window/Drag"
+                    {
+                        short nTmp;
+                        if (*pValues >>= nTmp)
+                            nDragMode = (DragMode)nTmp;
+                        break;
+                    }
                     case  2: bMenuMouseFollow = *static_cast<sal_Bool const *>(pValues->getValue()); break; //"Menu/FollowMouse",
                     case  3: *pValues >>= nSnapMode; break; //"Dialog/MousePositioning",
                     case  4: { short nTmp = 0; *pValues >>= nTmp; nMiddleMouse = static_cast<MouseMiddleButtonAction>(nTmp); break; } //"Dialog/MiddleMouseButton",
@@ -121,7 +127,7 @@ void  SvtTabAppearanceCfg::ImplCommit()
         switch(nProp)
         {
             case  0: pValues[nProp] <<= nScaleFactor; break;            // "FontScaling",
-            case  1: pValues[nProp] <<= nDragMode; break;               //"Window/Drag",
+            case  1: pValues[nProp] <<= (short)nDragMode; break;               //"Window/Drag",
             case  2: pValues[nProp] <<= bMenuMouseFollow; break; //"Menu/FollowMouse",
             case  3: pValues[nProp] <<= nSnapMode; break;               //"Dialog/MousePositioning",
             case  4: pValues[nProp] <<= static_cast<short>(nMiddleMouse); break;               //"Dialog/MiddleMouseButton",
commit ae033e72144645bb86e70071acc6bf7e2f0dda80
Author: Noel Grandin <noel at peralex.com>
Date:   Fri May 20 15:51:01 2016 +0200

    Convert BitmapAccessMode to scoped enum
    
    Change-Id: I0f2b86f0a34e257d00856ce4f1dbbb1869ec967a
    Reviewed-on: https://gerrit.libreoffice.org/25208
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index 36da41d..769549d 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -266,13 +266,12 @@ struct VCL_DLLPUBLIC BitmapBuffer
     sal_uInt8*      mpBits;
 };
 
-typedef enum
+enum class BitmapAccessMode
 {
-    BITMAP_INFO_ACCESS,
-    BITMAP_READ_ACCESS,
-    BITMAP_WRITE_ACCESS
-}
-BitmapAccessMode;
+    Info,
+    Read,
+    Write
+};
 
 VCL_DLLPUBLIC BitmapBuffer* StretchAndConvert(
     const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx
index 305f8a6..b345257 100644
--- a/vcl/inc/salbmp.hxx
+++ b/vcl/inc/salbmp.hxx
@@ -100,11 +100,11 @@ protected:
 
         ChecksumType nCrc = 0;
         SalBitmap* pThis = const_cast<SalBitmap*>(this);
-        BitmapBuffer* pBuf = pThis->AcquireBuffer(BITMAP_READ_ACCESS);
+        BitmapBuffer* pBuf = pThis->AcquireBuffer(BitmapAccessMode::Read);
         if (pBuf)
         {
             nCrc = vcl_get_checksum(0, pBuf->mpBits, pBuf->mnScanlineSize * pBuf->mnHeight);
-            pThis->ReleaseBuffer(pBuf, BITMAP_READ_ACCESS);
+            pThis->ReleaseBuffer(pBuf, BitmapAccessMode::Read);
             pThis->mnChecksum = nCrc;
             pThis->mbChecksumValid = true;
         }
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 946a35f..0ba5b43 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -727,7 +727,7 @@ BitmapBuffer* OpenGLSalBitmap::AcquireBuffer( BitmapAccessMode nMode )
 {
     OpenGLVCLContextZone aContextZone;
 
-    if( nMode != BITMAP_INFO_ACCESS )
+    if( nMode != BitmapAccessMode::Info )
     {
         if (!mpUserBuffer.get())
         {
@@ -746,7 +746,7 @@ BitmapBuffer* OpenGLSalBitmap::AcquireBuffer( BitmapAccessMode nMode )
     }
 
     // mpUserBuffer must be unique when we are doing the write access
-    if (nMode == BITMAP_WRITE_ACCESS && mpUserBuffer && !mpUserBuffer.unique())
+    if (nMode == BitmapAccessMode::Write && mpUserBuffer && !mpUserBuffer.unique())
     {
         std::shared_ptr<sal_uInt8> aBuffer(mpUserBuffer);
 
@@ -838,7 +838,7 @@ void OpenGLSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMo
 {
     OpenGLVCLContextZone aContextZone;
 
-    if( nMode == BITMAP_WRITE_ACCESS )
+    if( nMode == BitmapAccessMode::Write )
     {
         maTexture = OpenGLTexture();
         mbDirtyTexture = true;
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 48906a3..3817c94 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -816,7 +816,7 @@ BitmapBuffer* QuartzSalBitmap::AcquireBuffer( BitmapAccessMode /*nMode*/ )
 void QuartzSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode )
 {
     // invalidate graphic context if we have different data
-    if( nMode == BITMAP_WRITE_ACCESS )
+    if( nMode == BitmapAccessMode::Write )
     {
         maPalette = pBuffer->maPalette;
         if( mxGraphicContext )
diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx
index 45ea184..e18f242 100644
--- a/vcl/source/gdi/bmpacc.cxx
+++ b/vcl/source/gdi/bmpacc.cxx
@@ -36,7 +36,7 @@ BitmapInfoAccess::BitmapInfoAccess( Bitmap& rBitmap, BitmapAccessMode nMode ) :
 
 BitmapInfoAccess::BitmapInfoAccess( Bitmap& rBitmap ) :
             mpBuffer        ( nullptr ),
-            mnAccessMode    ( BITMAP_INFO_ACCESS )
+            mnAccessMode    ( BitmapAccessMode::Info )
 {
     ImplCreate( rBitmap );
 }
@@ -54,14 +54,14 @@ void BitmapInfoAccess::ImplCreate( Bitmap& rBitmap )
 
     if( xImpBmp )
     {
-        if( mnAccessMode == BITMAP_WRITE_ACCESS && !maBitmap.ImplGetImpBitmap() )
+        if( mnAccessMode == BitmapAccessMode::Write && !maBitmap.ImplGetImpBitmap() )
         {
             rBitmap.ImplMakeUnique();
             xImpBmp = rBitmap.ImplGetImpBitmap();
         }
         else
         {
-            DBG_ASSERT( mnAccessMode != BITMAP_WRITE_ACCESS ||
+            DBG_ASSERT( mnAccessMode != BitmapAccessMode::Write ||
                         xImpBmp.use_count() == 2,
                         "Unpredictable results: bitmap is referenced more than once!" );
         }
@@ -109,7 +109,7 @@ BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap, BitmapAccessMode nMode ) :
 }
 
 BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap ) :
-            BitmapInfoAccess( rBitmap, BITMAP_READ_ACCESS ),
+            BitmapInfoAccess( rBitmap, BitmapAccessMode::Read ),
             mpScanBuf       ( nullptr ),
             mFncGetPixel    ( nullptr ),
             mFncSetPixel    ( nullptr )
@@ -391,7 +391,7 @@ BitmapColor BitmapReadAccess::GetColorWithFallback( double fY, double fX, const
 }
 
 BitmapWriteAccess::BitmapWriteAccess(Bitmap& rBitmap)
-    : BitmapReadAccess(rBitmap, BITMAP_WRITE_ACCESS)
+    : BitmapReadAccess(rBitmap, BitmapAccessMode::Write)
     , mpLineColor()
     , mpFillColor()
 {
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index b25450d..ab06a71 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -87,7 +87,7 @@ void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode
 {
     mpSalBitmap->ReleaseBuffer( pBuffer, nMode );
 
-    if( nMode == BITMAP_WRITE_ACCESS )
+    if( nMode == BitmapAccessMode::Write )
         ImplInvalidateChecksum();
 }
 
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index 8946ed3..cf02166 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -109,7 +109,7 @@ namespace
         //fdo#33455 and fdo#80160 handle 1 bit depth pngs with palette entries
         //to set fore/back colors
         SalBitmap& rBitmap = const_cast<SalBitmap&>(rSalBitmap);
-        if (BitmapBuffer* pBitmapBuffer = rBitmap.AcquireBuffer(BITMAP_READ_ACCESS))
+        if (BitmapBuffer* pBitmapBuffer = rBitmap.AcquireBuffer(BitmapAccessMode::Read))
         {
             const BitmapPalette& rPalette = pBitmapBuffer->maPalette;
             if (rPalette.GetEntryCount() == 2)
@@ -120,7 +120,7 @@ namespace
                 const BitmapColor aBlack(rPalette[rPalette.GetBestIndex(Color(COL_BLACK))]);
                 rValues.background = rColMap.GetPixel(ImplColorToSal(aBlack));
             }
-            rBitmap.ReleaseBuffer(pBitmapBuffer, BITMAP_READ_ACCESS);
+            rBitmap.ReleaseBuffer(pBitmapBuffer, BitmapAccessMode::Read);
         }
     }
 }
@@ -673,11 +673,11 @@ void X11SalGraphicsImpl::drawBitmap( const SalTwoRect& rPosAry,
     DBG_ASSERT( !mrParent.bPrinter_, "Drawing of transparent bitmaps on printer devices is strictly forbidden" );
 
     // decide if alpha masking or transparency masking is needed
-    BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rMaskBitmap).AcquireBuffer( BITMAP_READ_ACCESS );
+    BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rMaskBitmap).AcquireBuffer( BitmapAccessMode::Read );
     if( pAlphaBuffer != nullptr )
     {
         int nMaskFormat = pAlphaBuffer->mnFormat;
-        const_cast<SalBitmap&>(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, BITMAP_READ_ACCESS );
+        const_cast<SalBitmap&>(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, BitmapAccessMode::Read );
         if( nMaskFormat == BMP_FORMAT_8BIT_PAL )
             drawAlphaBitmap( rPosAry, rSrcBitmap, rMaskBitmap );
     }
@@ -857,7 +857,7 @@ bool X11SalGraphicsImpl::drawAlphaBitmap( const SalTwoRect& rTR,
 
     // TODO: use SalX11Bitmap functionality and caching for the Alpha Pixmap
     // problem is that they don't provide an 8bit Pixmap on a non-8bit display
-    BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rAlphaBmp).AcquireBuffer( BITMAP_READ_ACCESS );
+    BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rAlphaBmp).AcquireBuffer( BitmapAccessMode::Read );
 
     // an XImage needs its data top_down
     // TODO: avoid wrongly oriented images in upper layers!
@@ -902,7 +902,7 @@ bool X11SalGraphicsImpl::drawAlphaBitmap( const SalTwoRect& rTR,
     if( pAlphaBits != reinterpret_cast<char*>(pAlphaBuffer->mpBits) )
         delete[] pAlphaBits;
 
-    const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, BITMAP_READ_ACCESS );
+    const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, BitmapAccessMode::Read );
 
     XRenderPictureAttributes aAttr;
     aAttr.repeat = int(true);
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index dd01c4b..c16be93 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -868,7 +868,7 @@ BitmapBuffer* X11SalBitmap::AcquireBuffer( BitmapAccessMode /*nMode*/ )
 
 void X11SalBitmap::ReleaseBuffer( BitmapBuffer*, BitmapAccessMode nMode )
 {
-    if( nMode == BITMAP_WRITE_ACCESS )
+    if( nMode == BitmapAccessMode::Write )
     {
         if( mpDDB )
         {
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index 41cf16e..dc3b80a 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -504,12 +504,12 @@ void GenPspGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSa
     Rectangle aDst (Point(rPosAry.mnDestX, rPosAry.mnDestY),
                     Size(rPosAry.mnDestWidth, rPosAry.mnDestHeight));
 
-    BitmapBuffer* pBuffer= const_cast<SalBitmap&>(rSalBitmap).AcquireBuffer(BITMAP_READ_ACCESS);
+    BitmapBuffer* pBuffer= const_cast<SalBitmap&>(rSalBitmap).AcquireBuffer(BitmapAccessMode::Read);
 
     SalPrinterBmp aBmp (pBuffer);
     m_pPrinterGfx->DrawBitmap (aDst, aSrc, aBmp);
 
-    const_cast<SalBitmap&>(rSalBitmap).ReleaseBuffer (pBuffer, BITMAP_READ_ACCESS);
+    const_cast<SalBitmap&>(rSalBitmap).ReleaseBuffer (pBuffer, BitmapAccessMode::Read);
 }
 
 void GenPspGraphics::drawBitmap( const SalTwoRect&,
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index 8a43898..915cd93 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -627,7 +627,7 @@ void ImplDrawBitmap( HDC hDC, const SalTwoRect& rPosAry, const WinSalBitmap& rSa
                 COLORREF nTextColor = RGB( 0x00, 0x00, 0x00 );
                 //fdo#33455 handle 1 bit depth pngs with palette entries
                 //to set fore/back colors
-                if (BitmapBuffer* pBitmapBuffer = const_cast<WinSalBitmap&>(rSalBitmap).AcquireBuffer(BITMAP_INFO_ACCESS))
+                if (BitmapBuffer* pBitmapBuffer = const_cast<WinSalBitmap&>(rSalBitmap).AcquireBuffer(BitmapAccessMode::Info))
                 {
                     const BitmapPalette& rPalette = pBitmapBuffer->maPalette;
                     if (rPalette.GetEntryCount() == 2)
@@ -638,7 +638,7 @@ void ImplDrawBitmap( HDC hDC, const SalTwoRect& rPosAry, const WinSalBitmap& rSa
                         nCol = ImplColorToSal(rPalette[1]);
                         nBkColor = RGB( SALCOLOR_RED(nCol), SALCOLOR_GREEN(nCol), SALCOLOR_BLUE(nCol) );
                     }
-                    const_cast<WinSalBitmap&>(rSalBitmap).ReleaseBuffer(pBitmapBuffer, BITMAP_INFO_ACCESS);
+                    const_cast<WinSalBitmap&>(rSalBitmap).ReleaseBuffer(pBitmapBuffer, BitmapAccessMode::Info);
                 }
                 nOldBkColor = SetBkColor( hDC, nBkColor );
                 nOldTextColor = ::SetTextColor( hDC, nTextColor );
diff --git a/vcl/win/gdi/salbmp.cxx b/vcl/win/gdi/salbmp.cxx
index c5b2a74..720c5e1 100644
--- a/vcl/win/gdi/salbmp.cxx
+++ b/vcl/win/gdi/salbmp.cxx
@@ -270,7 +270,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap()
         pSalRGB = pExtraWinSalRGB;
     }
 
-    BitmapBuffer* pRGB = pSalRGB->AcquireBuffer(BITMAP_READ_ACCESS);
+    BitmapBuffer* pRGB = pSalRGB->AcquireBuffer(BitmapAccessMode::Read);
     BitmapBuffer* pExtraRGB = 0;
 
     if(pRGB && BMP_FORMAT_24BIT_TC_BGR != (pRGB->mnFormat & ~BMP_FORMAT_TOP_DOWN))
@@ -283,7 +283,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap()
             BMP_FORMAT_24BIT_TC_BGR,
             0);
 
-        pSalRGB->ReleaseBuffer(pRGB, BITMAP_WRITE_ACCESS);
+        pSalRGB->ReleaseBuffer(pRGB, BitmapAccessMode::Write);
         pRGB = pExtraRGB;
     }
 
@@ -334,7 +334,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap()
     }
     else
     {
-        pSalRGB->ReleaseBuffer(pRGB, BITMAP_READ_ACCESS);
+        pSalRGB->ReleaseBuffer(pRGB, BitmapAccessMode::Read);
     }
 
     if(pExtraWinSalRGB)
@@ -359,7 +359,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlph
         pSalRGB = pExtraWinSalRGB;
     }
 
-    BitmapBuffer* pRGB = pSalRGB->AcquireBuffer(BITMAP_READ_ACCESS);
+    BitmapBuffer* pRGB = pSalRGB->AcquireBuffer(BitmapAccessMode::Read);
     BitmapBuffer* pExtraRGB = 0;
 
     if(pRGB && BMP_FORMAT_24BIT_TC_BGR != (pRGB->mnFormat & ~BMP_FORMAT_TOP_DOWN))
@@ -372,7 +372,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlph
             BMP_FORMAT_24BIT_TC_BGR,
             0);
 
-        pSalRGB->ReleaseBuffer(pRGB, BITMAP_READ_ACCESS);
+        pSalRGB->ReleaseBuffer(pRGB, BitmapAccessMode::Read);
         pRGB = pExtraRGB;
     }
 
@@ -387,7 +387,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlph
         pSalA = pExtraWinSalA;
     }
 
-    BitmapBuffer* pA = pSalA->AcquireBuffer(BITMAP_READ_ACCESS);
+    BitmapBuffer* pA = pSalA->AcquireBuffer(BitmapAccessMode::Read);
     BitmapBuffer* pExtraA = 0;
 
     if(pA && BMP_FORMAT_8BIT_PAL != (pA->mnFormat & ~BMP_FORMAT_TOP_DOWN))
@@ -402,7 +402,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlph
             BMP_FORMAT_8BIT_PAL,
             &rTargetPalette);
 
-        pSalA->ReleaseBuffer(pA, BITMAP_READ_ACCESS);
+        pSalA->ReleaseBuffer(pA, BitmapAccessMode::Read);
         pA = pExtraA;
     }
 
@@ -469,7 +469,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlph
     }
     else
     {
-        pSalA->ReleaseBuffer(pA, BITMAP_READ_ACCESS);
+        pSalA->ReleaseBuffer(pA, BitmapAccessMode::Read);
     }
 
     if(pExtraWinSalA)
@@ -486,7 +486,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlph
     }
     else
     {
-        pSalRGB->ReleaseBuffer(pRGB, BITMAP_READ_ACCESS);
+        pSalRGB->ReleaseBuffer(pRGB, BitmapAccessMode::Read);
     }
 
     if(pExtraWinSalRGB)
@@ -952,7 +952,7 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode
     {
         if( mhDIB )
         {
-            if( nMode == BITMAP_WRITE_ACCESS && !!pBuffer->maPalette )
+            if( nMode == BitmapAccessMode::Write && !!pBuffer->maPalette )
             {
                 PBITMAPINFO     pBI = (PBITMAPINFO) GlobalLock( mhDIB );
                 const sal_uInt16    nCount = pBuffer->maPalette.GetEntryCount();
diff --git a/vcl/win/gdi/salgdi2.cxx b/vcl/win/gdi/salgdi2.cxx
index ae73731..2104bdb 100644
--- a/vcl/win/gdi/salgdi2.cxx
+++ b/vcl/win/gdi/salgdi2.cxx
@@ -81,10 +81,10 @@ void convertToWinSalBitmap(SalBitmap& rSalBitmap, WinSalBitmap& rWinSalBitmap)
              aBitmapPalette = pGLSalBitmap->GetBitmapPalette();
          }
 
-        BitmapBuffer* pRead = rSalBitmap.AcquireBuffer(BITMAP_READ_ACCESS);
+        BitmapBuffer* pRead = rSalBitmap.AcquireBuffer(BitmapAccessMode::Read);
 
         rWinSalBitmap.Create(rSalBitmap.GetSize(), rSalBitmap.GetBitCount(), aBitmapPalette);
-        BitmapBuffer* pWrite = rWinSalBitmap.AcquireBuffer(BITMAP_WRITE_ACCESS);
+        BitmapBuffer* pWrite = rWinSalBitmap.AcquireBuffer(BitmapAccessMode::Write);
 
         sal_uInt8* pSource(pRead->mpBits);
         sal_uInt8* pDestination(pWrite->mpBits);
@@ -95,9 +95,9 @@ void convertToWinSalBitmap(SalBitmap& rSalBitmap, WinSalBitmap& rWinSalBitmap)
             pSource += pRead->mnScanlineSize;
             pDestination += pWrite->mnScanlineSize;
         }
-        rWinSalBitmap.ReleaseBuffer(pWrite, BITMAP_WRITE_ACCESS);
+        rWinSalBitmap.ReleaseBuffer(pWrite, BitmapAccessMode::Write);
 
-        rSalBitmap.ReleaseBuffer(pRead, BITMAP_READ_ACCESS);
+        rSalBitmap.ReleaseBuffer(pRead, BitmapAccessMode::Read);
 }
 
 } // end anonymous namespace


More information about the Libreoffice-commits mailing list