[Libreoffice-commits] .: 4 commits - basebmp/test canvas/source tools/bootstrp vcl/inc vcl/prj vcl/source vcl/test

David Tardon dtardon at kemper.freedesktop.org
Tue May 17 21:08:50 PDT 2011


 basebmp/test/bmpdemo.cxx                 |    3 
 canvas/source/directx/dx_vcltools.cxx    |    9 --
 canvas/source/vcl/canvasbitmaphelper.cxx |   20 ++----
 canvas/source/vcl/canvashelper.cxx       |    9 --
 canvas/source/vcl/impltools.cxx          |   11 +--
 tools/bootstrp/addexes2/mkfilt.cxx       |   10 ---
 vcl/inc/vcl/alpha.hxx                    |    5 +
 vcl/inc/vcl/bitmap.hxx                   |    6 +
 vcl/inc/vcl/bmpacc.hxx                   |   67 --------------------
 vcl/inc/vcl/scopedbitmapaccess.hxx       |  103 +++++++++++++++++++++++++++++++
 vcl/prj/d.lst                            |    1 
 vcl/source/helper/canvastools.cxx        |    9 +-
 vcl/test/canvasbitmaptest.cxx            |   12 +--
 13 files changed, 145 insertions(+), 120 deletions(-)

New commits:
commit 07480d0966211fd4841e82a8d6dbbf4c8c49669e
Author: David Tardon <dtardon at redhat.com>
Date:   Tue May 17 15:05:08 2011 +0200

    do not leak memory

diff --git a/tools/bootstrp/addexes2/mkfilt.cxx b/tools/bootstrp/addexes2/mkfilt.cxx
index 03b1b86..3ec7119 100644
--- a/tools/bootstrp/addexes2/mkfilt.cxx
+++ b/tools/bootstrp/addexes2/mkfilt.cxx
@@ -162,8 +162,7 @@ void MkFilter::Filter()
         {
             fprintf( stderr, "." );
             MkLine *pMkLine = new MkLine();
-            ByteString *pStr = new ByteString( aLineBuf );
-            pMkLine->aLine = *pStr;
+            pMkLine->aLine = aLineBuf;
             pMkLine->bOut = sal_False;
 
             pLst->push_back( pMkLine );
@@ -178,8 +177,7 @@ void MkFilter::Filter()
                 fprintf( stderr, ";\nunroll end\n" );
                 MkLine *p_MkLine = new MkLine();
                 p_MkLine->bHier = sal_True;
-                ByteString *pByteString = new ByteString("# do not delete this line === mkfilter3i\n");
-                p_MkLine->aLine = *pByteString;
+                p_MkLine->aLine = ByteString("# do not delete this line === mkfilter3i\n");
                 p_MkLine->bOut = sal_False;
                 p_MkLine->pPrivateTnrLst = pTnrLst;
                 pTnrLst = new ByteStringList();
@@ -187,8 +185,7 @@ void MkFilter::Filter()
                 nState = 0;
                 bInTnrList = sal_False;
             }
-            ByteString *pStr = new ByteString( aLineBuf );
-            pMkLine->aLine = *pStr;
+            pMkLine->aLine = ByteString( aLineBuf );
             pMkLine->bOut = sal_False;
 
             if ( bInTnrList )
commit be715824e3f9ebd93d244d3516af734c8468719e
Author: David Tardon <dtardon at redhat.com>
Date:   Tue May 17 14:41:57 2011 +0200

    remove stray semicolon

diff --git a/tools/bootstrp/addexes2/mkfilt.cxx b/tools/bootstrp/addexes2/mkfilt.cxx
index acdedd1..03b1b86 100644
--- a/tools/bootstrp/addexes2/mkfilt.cxx
+++ b/tools/bootstrp/addexes2/mkfilt.cxx
@@ -157,7 +157,6 @@ void MkFilter::Filter()
             fprintf( stderr, "\nunroll begin\n" );
             nState = 1;
         }
-        ;
 
         if ( nState == 0  )
         {
commit b18d243744c8d60babd088898096dade2786bc7f
Author: David Tardon <dtardon at redhat.com>
Date:   Tue May 17 12:18:39 2011 +0200

    impl. bool conversion

diff --git a/vcl/inc/vcl/scopedbitmapaccess.hxx b/vcl/inc/vcl/scopedbitmapaccess.hxx
index 86d15fd..b3392a3 100644
--- a/vcl/inc/vcl/scopedbitmapaccess.hxx
+++ b/vcl/inc/vcl/scopedbitmapaccess.hxx
@@ -54,6 +54,9 @@ namespace vcl
  */
 template < class Access, class Bitmap, Access* (Bitmap::* Acquire)() > class ScopedBitmapAccess
 {
+    typedef ScopedBitmapAccess< Access, Bitmap, Acquire > self_type;
+    typedef bool (self_type::* unspecified_bool_type)() const;
+
 public:
     explicit ScopedBitmapAccess( Bitmap& rBitmap ) :
         mpAccess( 0 ),
@@ -73,6 +76,12 @@ public:
         mrBitmap.ReleaseAccess( mpAccess );
     }
 
+    bool operator!() const { return !mpAccess; }
+    operator unspecified_bool_type() const
+    {
+        return mpAccess ? &self_type::operator! : 0;
+    }
+
     Access* 		get() { return mpAccess; }
     const Access* 	get() const { return mpAccess; }
 
commit 484bc2954316ffb544cbdf55c01e19d815752caa
Author: David Tardon <dtardon at redhat.com>
Date:   Tue May 17 10:03:46 2011 +0200

    generalize ScopedBitmapAccess and simplify usage
    
    It can be used for AlphaMask too now.

diff --git a/basebmp/test/bmpdemo.cxx b/basebmp/test/bmpdemo.cxx
index 81d0227..c5eb00c 100644
--- a/basebmp/test/bmpdemo.cxx
+++ b/basebmp/test/bmpdemo.cxx
@@ -1189,8 +1189,7 @@ void TestWindow::Paint( const Rectangle& /*rRect*/ )
 
     // Fill bitmap with generated content
     {
-        ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(), 
-                                              aBitmap );
+        Bitmap::ScopedWriteAccess pWriteAccess( aBitmap );
         for( int y=0; y<aTestSize.getY(); ++y )
             for( int x=0; x<aTestSize.getX(); ++x )
                 pWriteAccess->SetPixel(y,x,
diff --git a/canvas/source/directx/dx_vcltools.cxx b/canvas/source/directx/dx_vcltools.cxx
index 23b2e00..3b9a557 100644
--- a/canvas/source/directx/dx_vcltools.cxx
+++ b/canvas/source/directx/dx_vcltools.cxx
@@ -178,8 +178,7 @@ namespace dxcanvas
 
                 Bitmap aBitmap( rBmpEx.GetBitmap() );
 
-                ScopedBitmapReadAccess pReadAccess( aBitmap.AcquireReadAccess(),
-                                                    aBitmap );
+                Bitmap::ScopedReadAccess pReadAccess( aBitmap );
                     
                 const sal_Int32 nWidth( aBmpSize.Width() );
                 const sal_Int32 nHeight( aBmpSize.Height() );
@@ -192,8 +191,7 @@ namespace dxcanvas
                 {
                     Bitmap aAlpha( rBmpEx.GetAlpha().GetBitmap() );
 
-                    ScopedBitmapReadAccess pAlphaReadAccess( aAlpha.AcquireReadAccess(),
-                                                             aAlpha );
+                    Bitmap::ScopedReadAccess pAlphaReadAccess( aAlpha );
 
                     // By convention, the access buffer always has
                     // one of the following formats:
@@ -335,8 +333,7 @@ namespace dxcanvas
                 {
                     Bitmap aMask( rBmpEx.GetMask() );
 
-                    ScopedBitmapReadAccess pMaskReadAccess( aMask.AcquireReadAccess(),
-                                                            aMask );
+                    Bitmap::ScopedReadAccess pMaskReadAccess( aMask );
 
                     // By convention, the access buffer always has
                     // one of the following formats:
diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx
index a3a9807..332f325 100644
--- a/canvas/source/vcl/canvasbitmaphelper.cxx
+++ b/canvas/source/vcl/canvasbitmaphelper.cxx
@@ -149,9 +149,8 @@ namespace vclcanvas
         Bitmap aBitmap( mpBackBuffer->getBitmapReference().GetBitmap() );
         Bitmap aAlpha( mpBackBuffer->getBitmapReference().GetAlpha().GetBitmap() );
 
-        ScopedBitmapReadAccess pReadAccess( aBitmap.AcquireReadAccess(),
-                                            aBitmap );
-        ScopedBitmapReadAccess pAlphaReadAccess( aAlpha.IsEmpty() ? 
+        Bitmap::ScopedReadAccess pReadAccess( aBitmap );
+        Bitmap::ScopedReadAccess pAlphaReadAccess( aAlpha.IsEmpty() ?
                                                  (BitmapReadAccess*)NULL : aAlpha.AcquireReadAccess(),
                                                  aAlpha );
 
@@ -229,9 +228,8 @@ namespace vclcanvas
                                  // actually changed a pixel
 
         {
-            ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(),
-                                                  aBitmap );
-            ScopedBitmapWriteAccess pAlphaWriteAccess( aAlpha.IsEmpty() ? 
+            Bitmap::ScopedWriteAccess pWriteAccess( aBitmap );
+            Bitmap::ScopedWriteAccess pAlphaWriteAccess( aAlpha.IsEmpty() ?
                                                        (BitmapWriteAccess*)NULL : aAlpha.AcquireWriteAccess(),
                                                        aAlpha );
 
@@ -471,9 +469,8 @@ namespace vclcanvas
                                  // actually changed a pixel
 
         {
-            ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(),
-                                                  aBitmap );
-            ScopedBitmapWriteAccess pAlphaWriteAccess( aAlpha.IsEmpty() ? 
+            Bitmap::ScopedWriteAccess pWriteAccess( aBitmap );
+            Bitmap::ScopedWriteAccess pAlphaWriteAccess( aAlpha.IsEmpty() ?
                                                        (BitmapWriteAccess*)NULL : aAlpha.AcquireWriteAccess(),
                                                        aAlpha );
 
@@ -525,9 +522,8 @@ namespace vclcanvas
         Bitmap aBitmap( mpBackBuffer->getBitmapReference().GetBitmap() );
         Bitmap aAlpha( mpBackBuffer->getBitmapReference().GetAlpha().GetBitmap() );
 
-        ScopedBitmapReadAccess pReadAccess( aBitmap.AcquireReadAccess(),
-                                            aBitmap );
-        ScopedBitmapReadAccess pAlphaReadAccess( aAlpha.IsEmpty() ? 
+        Bitmap::ScopedReadAccess pReadAccess( aBitmap );
+        Bitmap::ScopedReadAccess pAlphaReadAccess( aAlpha.IsEmpty() ?
                                                  (BitmapReadAccess*)NULL : aAlpha.AcquireReadAccess(),
                                                  aAlpha );
         ENSURE_OR_THROW( pReadAccess.get() != NULL,
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index f8c272b..63afce2 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -948,8 +948,7 @@ namespace vclcanvas
         Bitmap aBitmap( rOutDev.GetBitmap(aRect.TopLeft(), 
                                           aRect.GetSize()) );
 
-        ScopedBitmapReadAccess pReadAccess( aBitmap.AcquireReadAccess(),
-                                            aBitmap );
+        Bitmap::ScopedReadAccess pReadAccess( aBitmap );
 
         ENSURE_OR_THROW( pReadAccess.get() != NULL,
                          "Could not acquire read access to OutDev bitmap" );
@@ -1014,8 +1013,7 @@ namespace vclcanvas
             Bitmap aTmpBitmap( rOutDev.GetBitmap( aEmptyPoint,
                                                   aSize ) );
             
-            ScopedBitmapReadAccess pReadAccess( aTmpBitmap.AcquireReadAccess(),
-                                                aTmpBitmap );
+            Bitmap::ScopedReadAccess pReadAccess( aTmpBitmap );
 
             pPalette = &pReadAccess->GetPalette();
         }
@@ -1026,8 +1024,7 @@ namespace vclcanvas
         bool bCopyBack( false ); // only copy something back, if we
                                  // actually changed some pixel
         {
-            ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(),
-                                                  aBitmap );
+            Bitmap::ScopedWriteAccess pWriteAccess( aBitmap );
             
             ENSURE_OR_THROW( pWriteAccess.get() != NULL,
                              "Could not acquire write access to OutDev bitmap" );
diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx
index 9a4ab81..6bcf800 100644
--- a/canvas/source/vcl/impltools.cxx
+++ b/canvas/source/vcl/impltools.cxx
@@ -277,9 +277,8 @@ namespace vclcanvas
                     aSrcAlpha = rBitmap.GetMask();
             }
 
-            ScopedBitmapReadAccess pReadAccess( aSrcBitmap.AcquireReadAccess(),
-                                                aSrcBitmap );
-            ScopedBitmapReadAccess pAlphaReadAccess( rBitmap.IsTransparent() ? 
+            Bitmap::ScopedReadAccess pReadAccess( aSrcBitmap );
+            Bitmap::ScopedReadAccess pAlphaReadAccess( rBitmap.IsTransparent() ?
                                                      aSrcAlpha.AcquireReadAccess() : 
                                                      (BitmapReadAccess*)NULL,
                                                      aSrcAlpha );
@@ -334,10 +333,8 @@ namespace vclcanvas
                 // copy-constructing the resulting bitmap. This will
                 // rule out the possibility that cached accessor data
                 // is not yet written back.
-                ScopedBitmapWriteAccess pWriteAccess( aDstBitmap.AcquireWriteAccess(),
-                                                      aDstBitmap );
-                ScopedBitmapWriteAccess pAlphaWriteAccess( aDstAlpha.AcquireWriteAccess(),
-                                                           aDstAlpha );
+                Bitmap::ScopedWriteAccess pWriteAccess( aDstBitmap );
+                Bitmap::ScopedWriteAccess pAlphaWriteAccess( aDstAlpha );
 
                 
                 if( pWriteAccess.get() != NULL &&
diff --git a/vcl/inc/vcl/alpha.hxx b/vcl/inc/vcl/alpha.hxx
index 2fcc08e..e23f1fb 100644
--- a/vcl/inc/vcl/alpha.hxx
+++ b/vcl/inc/vcl/alpha.hxx
@@ -100,6 +100,11 @@ public:
     BitmapWriteAccess*		AcquireWriteAccess() { return Bitmap::AcquireWriteAccess(); }
     void					ReleaseAccess( BitmapReadAccess* pAccess );
 
+    typedef vcl::ScopedBitmapAccess< BitmapReadAccess, AlphaMask, &AlphaMask::AcquireReadAccess >
+        ScopedReadAccess;
+    typedef vcl::ScopedBitmapAccess< BitmapWriteAccess, AlphaMask, &AlphaMask::AcquireWriteAccess >
+        ScopedWriteAccess;
+
 public:
 
     sal_Bool					Read( SvStream& rIStm, sal_Bool bFileHeader = sal_True ) { return Bitmap::Read( rIStm, bFileHeader ); }
diff --git a/vcl/inc/vcl/bitmap.hxx b/vcl/inc/vcl/bitmap.hxx
index 5087bd0..546328a 100644
--- a/vcl/inc/vcl/bitmap.hxx
+++ b/vcl/inc/vcl/bitmap.hxx
@@ -34,6 +34,7 @@
 #include <vcl/mapmod.hxx>
 #include <tools/rc.hxx>
 #include <vcl/region.hxx>
+#include <vcl/scopedbitmapaccess.hxx>
 
 // -----------
 // - Defines -
@@ -752,6 +753,11 @@ public:
     BitmapWriteAccess*      AcquireWriteAccess();
     void                    ReleaseAccess( BitmapReadAccess* pAccess );
 
+    typedef vcl::ScopedBitmapAccess< BitmapReadAccess, Bitmap, &Bitmap::AcquireReadAccess >
+        ScopedReadAccess;
+    typedef vcl::ScopedBitmapAccess< BitmapWriteAccess, Bitmap, &Bitmap::AcquireWriteAccess >
+        ScopedWriteAccess;
+
 public:
 
     sal_Bool                    Read( SvStream& rIStm, sal_Bool bFileHeader = sal_True, sal_Bool bMSOFormat = sal_False );
diff --git a/vcl/inc/vcl/bmpacc.hxx b/vcl/inc/vcl/bmpacc.hxx
index bec0882..c91277e 100644
--- a/vcl/inc/vcl/bmpacc.hxx
+++ b/vcl/inc/vcl/bmpacc.hxx
@@ -34,7 +34,6 @@
 #include <vcl/salbtype.hxx>
 #include <vcl/bitmap.hxx>
 
-
 // --------------------
 // - Access defines -
 // --------------------
@@ -226,72 +225,6 @@ private:
     BitmapWriteAccess& 			operator=( const BitmapWriteAccess& ) { return *this; } 
 };
 
-// -------------------
-// - Accessor Helper -
-// -------------------
-
-/** This template handles BitmapAccess the RAII way. 
-
-    Please don't use directly, but the ready-made typedefs for
-    BitmapReadAccess and BitmapWriteAccess below.
- */
-template < class Access > class ScopedBitmapAccess
-{
-public:
-    ScopedBitmapAccess( Access* pAccess,
-                        Bitmap& rBitmap ) :
-        mpAccess( pAccess ),
-        mrBitmap( rBitmap )
-    {
-    }
-
-    ~ScopedBitmapAccess()
-    {
-        mrBitmap.ReleaseAccess( mpAccess );
-    }
-
-    Access* 		get() { return mpAccess; }
-    const Access* 	get() const { return mpAccess; }
-
-    Access* 		operator->() { return mpAccess; }
-    const Access* 	operator->() const { return mpAccess; }
-
-    Access& 		operator*() { return *mpAccess; }
-    const Access& 	operator*() const { return *mpAccess; }
-
-private:
-    Access*		mpAccess;
-    Bitmap&		mrBitmap;
-};
-
-/** This wrapper handles BitmapReadAccess the RAII way.
-
-    Use as follows: 
-    Bitmap aBitmap
-    ScopedBitmapReadAccess pReadAccess( aBitmap.AcquireReadAccess(), aBitmap );
-    pReadAccess->SetPixel()...
-
-    @attention for practical reasons, ScopedBitmapReadAccess stores a
-    reference to the provided bitmap, thus, make sure that the bitmap
-    specified at construction time lives at least as long as the
-    ScopedBitmapReadAccess.
-*/
-typedef ScopedBitmapAccess< BitmapReadAccess > ScopedBitmapReadAccess;
-
-/** This wrapper handles BitmapWriteAccess the RAII way.
-
-    Use as follows: 
-    Bitmap aBitmap
-    ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(), aBitmap );
-    pWriteAccess->SetPixel()...
-
-    @attention for practical reasons, ScopedBitmapWriteAccess stores a
-    reference to the provided bitmap, thus, make sure that the bitmap
-    specified at construction time lives at least as long as the
-    ScopedBitmapWriteAccess.
-*/
-typedef ScopedBitmapAccess< BitmapWriteAccess > ScopedBitmapWriteAccess;
-
 // -----------
 // - Inlines -
 // -----------
diff --git a/vcl/inc/vcl/scopedbitmapaccess.hxx b/vcl/inc/vcl/scopedbitmapaccess.hxx
new file mode 100644
index 0000000..86d15fd
--- /dev/null
+++ b/vcl/inc/vcl/scopedbitmapaccess.hxx
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef VCL_SCOPEDBITMAPACCESS_HXX_INCLUDED
+#define VCL_SCOPEDBITMAPACCESS_HXX_INCLUDED
+
+namespace vcl
+{
+
+/** This template handles BitmapAccess the RAII way.
+
+    Please don't use directly, but through the ready-made typedefs
+    ScopedReadAccess and ScopedWriteAccess in classes Bitmap and
+    AlphaMask.
+
+    Use as follows:
+    Bitmap aBitmap;
+    Bitmap::ScopedReadAccess pReadAccess( aBitmap );
+    pReadAccess->SetPixel()...
+
+    Bitmap aBitmap2;
+    Bitmap::ScopedWriteAccess pWriteAccess( bCond ? aBitmap2.AcquireWriteAccess() : 0, aBitmap2 );
+    if ( pWriteAccess )...
+
+    @attention for practical reasons, ScopedBitmapAccess stores a
+    reference to the provided bitmap, thus, make sure that the bitmap
+    specified at construction time lives at least as long as the
+    ScopedBitmapAccess.
+ */
+template < class Access, class Bitmap, Access* (Bitmap::* Acquire)() > class ScopedBitmapAccess
+{
+public:
+    explicit ScopedBitmapAccess( Bitmap& rBitmap ) :
+        mpAccess( 0 ),
+        mrBitmap( rBitmap )
+    {
+        mpAccess = (mrBitmap.*Acquire)();
+    }
+
+    ScopedBitmapAccess( Access* pAccess, Bitmap& rBitmap ) :
+        mpAccess( pAccess ),
+        mrBitmap( rBitmap )
+    {
+    }
+
+    ~ScopedBitmapAccess()
+    {
+        mrBitmap.ReleaseAccess( mpAccess );
+    }
+
+    Access* 		get() { return mpAccess; }
+    const Access* 	get() const { return mpAccess; }
+
+    Access* 		operator->() { return mpAccess; }
+    const Access* 	operator->() const { return mpAccess; }
+
+    Access& 		operator*() { return *mpAccess; }
+    const Access& 	operator*() const { return *mpAccess; }
+
+private:
+    Access*		mpAccess;
+    Bitmap&		mrBitmap;
+};
+
+}
+
+#endif // VCL_SCOPEDBITMAPACCESS_HXX_INCLUDED
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 00b703c..3626a3e 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -97,6 +97,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
 ..\inc\vcl\salgtype.hxx %_DEST%\inc%_EXT%\vcl\salgtype.hxx
 ..\inc\vcl\salstype.hxx %_DEST%\inc%_EXT%\vcl\salstype.hxx
 ..\inc\vcl\salnativewidgets.hxx %_DEST%\inc%_EXT%\vcl\salnativewidgets.hxx
+..\inc\vcl\scopedbitmapaccess.hxx %_DEST%\inc%_EXT%\vcl\scopedbitmapaccess.hxx
 ..\inc\vcl\scrbar.hxx %_DEST%\inc%_EXT%\vcl\scrbar.hxx
 ..\inc\vcl\seleng.hxx %_DEST%\inc%_EXT%\vcl\seleng.hxx
 ..\inc\vcl\settings.hxx %_DEST%\inc%_EXT%\vcl\settings.hxx
diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx
index 3051389..ff2bac7 100644
--- a/vcl/source/helper/canvastools.cxx
+++ b/vcl/source/helper/canvastools.cxx
@@ -220,8 +220,8 @@ namespace vcl
                           sal_Int32                                                  nHeight,
                           const rendering::IntegerBitmapLayout&                      rLayout,
                           const uno::Reference< rendering::XIntegerReadOnlyBitmap >& xInputBitmap,
-                          ScopedBitmapWriteAccess&                                   rWriteAcc,
-                          ScopedBitmapWriteAccess&                                   rAlphaAcc )
+                          Bitmap::ScopedWriteAccess&                                   rWriteAcc,
+                          Bitmap::ScopedWriteAccess&                                   rAlphaAcc )
             {
                 rendering::IntegerBitmapLayout      aCurrLayout;
                 geometry::IntegerRectangle2D        aRect;
@@ -433,9 +433,8 @@ namespace vcl
                                            sal::static_int_cast<sal_uInt16>(1L << nAlphaDepth)) );
 
                 { // limit scoped access 
-                    ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(),
-                                                          aBitmap );
-                    ScopedBitmapWriteAccess pAlphaWriteAccess( nAlphaDepth ? aAlpha.AcquireWriteAccess() : NULL,
+                    Bitmap::ScopedWriteAccess pWriteAccess( aBitmap );
+                    Bitmap::ScopedWriteAccess pAlphaWriteAccess( nAlphaDepth ? aAlpha.AcquireWriteAccess() : NULL,
                                                                aAlpha );
 
                     ENSURE_OR_THROW(pWriteAccess.get() != NULL,
diff --git a/vcl/test/canvasbitmaptest.cxx b/vcl/test/canvasbitmaptest.cxx
index 77dabef..99db8db 100644
--- a/vcl/test/canvasbitmaptest.cxx
+++ b/vcl/test/canvasbitmaptest.cxx
@@ -173,8 +173,7 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
     int      nDepth = nOriginalDepth;
 
     {
-        ScopedBitmapReadAccess pAcc( aContainedBmp.AcquireReadAccess(),
-                                     aContainedBmp );
+        Bitmap::ScopedReadAccess pAcc( aContainedBmp );
         nDepth = pAcc->GetBitCount();
     }
 
@@ -324,8 +323,7 @@ void checkBitmapImport( const rtl::Reference<VclCanvasBitmap>& xBmp,
     int      nDepth = nOriginalDepth;
 
     {
-        ScopedBitmapReadAccess pAcc( aContainedBmp.AcquireReadAccess(),
-                                     aContainedBmp );
+        Bitmap::ScopedReadAccess pAcc( aContainedBmp );
         nDepth = pAcc->GetBitCount();
     }
 
@@ -888,8 +886,7 @@ void TestWindow::Paint( const Rectangle& )
             Bitmap aBitmap(Size(200,200),nDepth);
             aBitmap.Erase(COL_WHITE);
             {
-                ScopedBitmapWriteAccess pAcc(aBitmap.AcquireWriteAccess(),
-                                             aBitmap);
+                Bitmap::ScopedWriteAccess pAcc(aBitmap);
                 if( pAcc.get() )
                 {
                     BitmapColor aBlack(0);
@@ -919,8 +916,7 @@ void TestWindow::Paint( const Rectangle& )
             Bitmap aMask(Size(200,200),1);
             aMask.Erase(COL_WHITE);
             {
-                ScopedBitmapWriteAccess pAcc(aMask.AcquireWriteAccess(),
-                                             aMask);
+                Bitmap::ScopedWriteAccess pAcc(aMask);
                 if( pAcc.get() )
                 {
                     pAcc->SetFillColor(COL_BLACK);


More information about the Libreoffice-commits mailing list