summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/dialogs/colorpicker.cxx4
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx8
-rw-r--r--drawinglayer/source/texture/texture3d.cxx9
-rw-r--r--filter/source/flash/swfwriter1.cxx10
-rw-r--r--filter/source/msfilter/svdfppt.cxx4
-rw-r--r--include/drawinglayer/texture/texture3d.hxx5
-rw-r--r--sc/source/filter/excel/xeescher.cxx4
-rw-r--r--sd/qa/unit/import-tests.cxx2
-rw-r--r--sd/source/ui/dlg/vectdlg.cxx14
-rw-r--r--sd/source/ui/slidesorter/view/SlsFramePainter.cxx7
-rw-r--r--sd/source/ui/table/TableDesignPane.cxx4
-rw-r--r--svx/source/dialog/dlgctrl.cxx4
-rw-r--r--svx/source/svdraw/svdetc.cxx8
-rw-r--r--svx/source/svdraw/svdfmtf.cxx8
-rw-r--r--svx/source/svdraw/svdoashp.cxx8
-rw-r--r--svx/source/xoutdev/_xoutbmp.cxx8
-rw-r--r--svx/source/xoutdev/xattrbmp.cxx4
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport8.cxx6
18 files changed, 50 insertions, 67 deletions
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 5299989c9e57..476dffe3a8f4 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -316,7 +316,7 @@ void ColorFieldControl::UpdateBitmap()
sal_uInt8* pRGB_Vert = maRGB_Vert.data();
sal_uInt16* pPercent_Vert = maPercent_Vert.data();
- BitmapWriteAccess* pWriteAccess = mpBitmap->AcquireWriteAccess();
+ Bitmap::ScopedWriteAccess pWriteAccess(*mpBitmap);
if (pWriteAccess)
{
BitmapColor aBitmapColor(maColor);
@@ -403,8 +403,6 @@ void ColorFieldControl::UpdateBitmap()
}
break;
}
-
- Bitmap::ReleaseAccess(pWriteAccess);
}
}
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index 6470f634c187..73fd8cbc4fae 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -52,8 +52,8 @@ namespace
sal_uInt8 nInitAlpha(255);
Bitmap aContent(aDestSize, 24);
AlphaMask aAlpha(aDestSize, &nInitAlpha);
- BitmapWriteAccess* pContent = aContent.AcquireWriteAccess();
- BitmapWriteAccess* pAlpha = aAlpha.AcquireWriteAccess();
+ Bitmap::ScopedWriteAccess pContent(aContent);
+ AlphaMask::ScopedWriteAccess pAlpha(aAlpha);
if (pContent && pAlpha)
{
@@ -118,8 +118,8 @@ namespace
}
}
- aAlpha.ReleaseAccess(pAlpha);
- Bitmap::ReleaseAccess(pContent);
+ pAlpha.reset();
+ pContent.reset();
aRetval = BitmapEx(aContent, aAlpha);
diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx
index 4e4d19b6dd5f..a1ba4cb39ce0 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -64,9 +64,7 @@ namespace drawinglayer
const BitmapEx& rBitmapEx,
const basegfx::B2DRange& rRange)
: maBitmapEx(rBitmapEx),
- mpReadBitmap(nullptr),
maTransparence(),
- mpReadTransparence(nullptr),
maTopLeft(rRange.getMinimum()),
maSize(rRange.getRange()),
mfMulX(0.0),
@@ -75,7 +73,8 @@ namespace drawinglayer
mbIsTransparent(maBitmapEx.IsTransparent())
{
// #121194# Todo: use alpha channel, too (for 3d)
- mpReadBitmap = maBitmapEx.GetBitmap().AcquireReadAccess();
+ maBitmap = maBitmapEx.GetBitmap();
+ mpReadBitmap = Bitmap::ScopedReadAccess(maBitmap);
OSL_ENSURE(mpReadBitmap, "GeoTexSvxBitmapEx: Got no read access to Bitmap (!)");
if(mbIsTransparent)
@@ -90,7 +89,7 @@ namespace drawinglayer
maTransparence = rBitmapEx.GetMask();
}
- mpReadTransparence = maTransparence.AcquireReadAccess();
+ mpReadTransparence = Bitmap::ScopedReadAccess(maTransparence);
}
mfMulX = (double)mpReadBitmap->Width() / maSize.getX();
@@ -109,8 +108,6 @@ namespace drawinglayer
GeoTexSvxBitmapEx::~GeoTexSvxBitmapEx()
{
- delete mpReadTransparence;
- delete mpReadBitmap;
}
sal_uInt8 GeoTexSvxBitmapEx::impGetTransparence(sal_Int32& rX, sal_Int32& rY) const
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index e3ab3ac39224..f5d4dba7a09f 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -704,8 +704,8 @@ void getBitmapData( const BitmapEx& aBmpEx, sal_uInt8*& tgadata, sal_uInt8*& tga
{
if( !aBmpEx.IsEmpty() )
{
- Bitmap aBmp( aBmpEx.GetBitmap() );
- BitmapReadAccess* pRAcc = aBmp.AcquireReadAccess();
+ Bitmap aBmp( aBmpEx.GetBitmap() );
+ Bitmap::ScopedReadAccess pRAcc(aBmp);
if( pRAcc )
{
@@ -727,7 +727,7 @@ void getBitmapData( const BitmapEx& aBmpEx, sal_uInt8*& tgadata, sal_uInt8*& tga
aAlpha = AlphaMask( aBmp.GetSizePixel(), &cAlphaVal );
}
- BitmapReadAccess* pAAcc = aAlpha.AcquireReadAccess();
+ AlphaMask::ScopedReadAccess pAAcc(aAlpha);
if( pAAcc )
{
@@ -755,11 +755,7 @@ void getBitmapData( const BitmapEx& aBmpEx, sal_uInt8*& tgadata, sal_uInt8*& tga
*pAlpha++ = 0xff - nAlpha;
}
}
-
- aAlpha.ReleaseAccess( pAAcc );
}
-
- Bitmap::ReleaseAccess( pRAcc );
}
}
}
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 74054409fe97..b5e8a5385361 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -5665,7 +5665,7 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, T
if ( aSize.Height() > 64 )
aSize.Height() = 64;
- BitmapReadAccess* pAcc = aBmp.AcquireReadAccess();
+ Bitmap::ScopedReadAccess pAcc(aBmp);
if( pAcc )
{
sal_uLong nRt = 0, nGn = 0, nBl = 0;
@@ -5694,7 +5694,7 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, T
}
}
}
- Bitmap::ReleaseAccess( pAcc );
+ pAcc.reset();
sal_uInt32 nC = ( aSize.Width() * aSize.Height() );
nRt /= nC;
nGn /= nC;
diff --git a/include/drawinglayer/texture/texture3d.hxx b/include/drawinglayer/texture/texture3d.hxx
index 70aefdc9a924..489c631b0b27 100644
--- a/include/drawinglayer/texture/texture3d.hxx
+++ b/include/drawinglayer/texture/texture3d.hxx
@@ -60,9 +60,10 @@ namespace drawinglayer
{
protected:
BitmapEx maBitmapEx;
- BitmapReadAccess* mpReadBitmap;
+ Bitmap maBitmap; // Bitmap held within maBitmapEx, to exist during mpReadBitmap scope
+ Bitmap::ScopedReadAccess mpReadBitmap;
Bitmap maTransparence;
- BitmapReadAccess* mpReadTransparence;
+ Bitmap::ScopedReadAccess mpReadTransparence;
basegfx::B2DPoint maTopLeft;
basegfx::B2DVector maSize;
double mfMulX;
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index c5a66a5a2e5b..5ceb584dc15c 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -402,7 +402,8 @@ void XclExpImgData::Save( XclExpStream& rStrm )
if( aBmp.GetBitCount() != 24 )
aBmp.Convert( BMP_CONVERSION_24BIT );
- if( BitmapReadAccess* pAccess = aBmp.AcquireReadAccess() )
+ Bitmap::ScopedReadAccess pAccess(aBmp);
+ if( pAccess )
{
sal_Int32 nWidth = ::std::min< sal_Int32 >( pAccess->Width(), 0xFFFF );
sal_Int32 nHeight = ::std::min< sal_Int32 >( pAccess->Height(), 0xFFFF );
@@ -434,7 +435,6 @@ void XclExpImgData::Save( XclExpStream& rStrm )
rStrm.EndRecord();
}
- Bitmap::ReleaseAccess( pAccess );
}
}
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index fd58d72b5588..110baa9433b1 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1384,7 +1384,7 @@ void SdImportTest::testTdf99729()
vcl::PNGReader aPNGReader(aFileStream);
BitmapEx aBMPEx = aPNGReader.Read();
Bitmap aBMP = aBMPEx.GetBitmap();
- BitmapReadAccess* pRead = aBMP.AcquireReadAccess();
+ Bitmap::ScopedReadAccess pRead(aBMP);
for (long nX = 154; nX < (154 + 12); ++nX)
{
for (long nY = 16; nY < (16 + 96); ++nY)
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx
index 54818e24a3be..32d9b2051945 100644
--- a/sd/source/ui/dlg/vectdlg.cxx
+++ b/sd/source/ui/dlg/vectdlg.cxx
@@ -163,8 +163,8 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf )
if( m_pCbFillHoles->IsChecked() )
{
- GDIMetaFile aNewMtf;
- BitmapReadAccess* pRAcc = aTmp.AcquireReadAccess();
+ GDIMetaFile aNewMtf;
+ Bitmap::ScopedReadAccess pRAcc(aTmp);
if( pRAcc )
{
@@ -186,10 +186,10 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf )
const long nY = nTY * nTileY;
for( long nTX = 0; nTX < nCountX; nTX++ )
- AddTile( pRAcc, aNewMtf, nTX * nTileX, nTY * nTileY, nTileX, nTileY );
+ AddTile( pRAcc.get(), aNewMtf, nTX * nTileX, nTY * nTileY, nTileX, nTileY );
if( nRestX )
- AddTile( pRAcc, aNewMtf, nCountX * nTileX, nY, nRestX, nTileY );
+ AddTile( pRAcc.get(), aNewMtf, nCountX * nTileX, nY, nRestX, nTileY );
}
if( nRestY )
@@ -197,13 +197,13 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf )
const long nY = nCountY * nTileY;
for( long nTX = 0; nTX < nCountX; nTX++ )
- AddTile( pRAcc, aNewMtf, nTX * nTileX, nY, nTileX, nRestY );
+ AddTile( pRAcc.get(), aNewMtf, nTX * nTileX, nY, nTileX, nRestY );
if( nRestX )
- AddTile( pRAcc, aNewMtf, nCountX * nTileX, nCountY * nTileY, nRestX, nRestY );
+ AddTile( pRAcc.get(), aNewMtf, nCountX * nTileX, nCountY * nTileY, nRestX, nRestY );
}
- Bitmap::ReleaseAccess( pRAcc );
+ pRAcc.reset();
for( size_t n = 0, nCount = rMtf.GetActionSize(); n < nCount; n++ )
aNewMtf.AddAction( rMtf.GetAction( n )->Clone() );
diff --git a/sd/source/ui/slidesorter/view/SlsFramePainter.cxx b/sd/source/ui/slidesorter/view/SlsFramePainter.cxx
index bb297c922a05..a82de19e863e 100644
--- a/sd/source/ui/slidesorter/view/SlsFramePainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsFramePainter.cxx
@@ -78,11 +78,12 @@ void FramePainter::AdaptColor (
// Get the source color.
if (maCenter.maBitmap.IsEmpty())
return;
- BitmapReadAccess* pReadAccess = maCenter.maBitmap.GetBitmap().AcquireReadAccess();
- if (pReadAccess == nullptr)
+ Bitmap aBitmap = maCenter.maBitmap.GetBitmap();
+ Bitmap::ScopedReadAccess pReadAccess(aBitmap);
+ if (!pReadAccess)
return;
const Color aSourceColor = pReadAccess->GetColor(0,0);
- Bitmap::ReleaseAccess(pReadAccess);
+ pReadAccess.reset();
// Erase the center bitmap.
maCenter.maBitmap.SetEmpty();
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index 93bd711931fe..0e55c21f9bc1 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -622,7 +622,7 @@ const Bitmap CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle,
// bbbbbbbbbbbb
Bitmap aPreviewBmp( Size( nBitmapWidth, nBitmapHeight), 24, nullptr );
- BitmapWriteAccess* pAccess = aPreviewBmp.AcquireWriteAccess();
+ Bitmap::ScopedWriteAccess pAccess(aPreviewBmp);
if( pAccess )
{
pAccess->Erase( Color( bIsPageDark ? COL_BLACK : COL_WHITE ) );
@@ -715,7 +715,7 @@ const Bitmap CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle,
}
}
- Bitmap::ReleaseAccess( pAccess );
+ pAccess.reset();
}
return aPreviewBmp;
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index d8f312bda281..2fafd853b05f 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1064,7 +1064,7 @@ void SvxPixelCtl::SetXBitmap( const BitmapEx& rBitmapEx )
if(isHistorical8x8(rBitmapEx, aBack, aFront))
{
Bitmap aBitmap(rBitmapEx.GetBitmap());
- BitmapReadAccess* pRead = aBitmap.AcquireReadAccess();
+ Bitmap::ScopedReadAccess pRead(aBitmap);
aBackgroundColor = aBack;
aPixelColor = aFront;
@@ -1082,8 +1082,6 @@ void SvxPixelCtl::SetXBitmap( const BitmapEx& rBitmapEx )
*( pPixel + i ) = 1;
}
}
-
- Bitmap::ReleaseAccess(pRead);
}
}
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index f10b09f81ed5..83479041ed07 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -302,7 +302,7 @@ bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol)
const Size aSize(aBitmap.GetSizePixel());
const sal_uInt32 nWidth = aSize.Width();
const sal_uInt32 nHeight = aSize.Height();
- BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess();
+ Bitmap::ScopedReadAccess pAccess(aBitmap);
if(pAccess && nWidth > 0 && nHeight > 0)
{
@@ -335,12 +335,6 @@ bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol)
bRetval = true;
}
-
- if(pAccess)
- {
- Bitmap::ReleaseAccess(pAccess);
- }
-
break;
}
default: break;
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index a19a53422688..52a11eceb751 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -1595,7 +1595,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaFloatTransparentAction& rAct)
aOldMask = aBitmapEx.GetBitmap().CreateMask(aBitmapEx.GetTransparentColor());
}
- BitmapWriteAccess* pOld = aOldMask.AcquireWriteAccess();
+ AlphaMask::ScopedWriteAccess pOld(aOldMask);
if(pOld)
{
@@ -1618,7 +1618,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaFloatTransparentAction& rAct)
}
else
{
- BitmapReadAccess* pNew = aNewMask.AcquireReadAccess();
+ AlphaMask::ScopedReadAccess pNew(aNewMask);
if(pNew)
{
@@ -1641,7 +1641,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaFloatTransparentAction& rAct)
OSL_ENSURE(false, "Alpha masks have different sizes (!)");
}
- aNewMask.ReleaseAccess(pNew);
+ pNew.reset();
}
else
{
@@ -1649,7 +1649,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaFloatTransparentAction& rAct)
}
}
- aOldMask.ReleaseAccess(pOld);
+ pOld.reset();
}
else
{
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 314b4ba319c6..5f053caad956 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -349,12 +349,12 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS
if(!aBitmap.IsEmpty())
{
- BitmapReadAccess* pReadAccess = aBitmap.AcquireReadAccess();
+ Bitmap::ScopedReadAccess pReadAccess(aBitmap);
if(pReadAccess)
{
Bitmap aDestBitmap(aBitmap.GetSizePixel(), 24L);
- BitmapWriteAccess* pWriteAccess = aDestBitmap.AcquireWriteAccess();
+ Bitmap::ScopedWriteAccess pWriteAccess(aDestBitmap);
if(pWriteAccess)
{
@@ -371,10 +371,10 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS
}
}
- Bitmap::ReleaseAccess(pWriteAccess);
+ pWriteAccess.reset();
}
- Bitmap::ReleaseAccess(pReadAccess);
+ pReadAccess.reset();
if(aBitmapEx.IsTransparent())
{
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 0f5113e0f8ec..888482e19e99 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -446,8 +446,8 @@ Bitmap XOutBitmap::DetectEdges( const Bitmap& rBmp, const sal_uInt8 cThreshold )
bool bRet = false;
Bitmap aDstBmp( aSize, 1 );
- BitmapReadAccess* pReadAcc = aWorkBmp.AcquireReadAccess();
- BitmapWriteAccess* pWriteAcc = aDstBmp.AcquireWriteAccess();
+ Bitmap::ScopedReadAccess pReadAcc(aWorkBmp);
+ Bitmap::ScopedWriteAccess pWriteAcc(aDstBmp);
if( pReadAcc && pWriteAcc )
{
@@ -499,8 +499,8 @@ Bitmap XOutBitmap::DetectEdges( const Bitmap& rBmp, const sal_uInt8 cThreshold )
bRet = true;
}
- Bitmap::ReleaseAccess( pReadAcc );
- Bitmap::ReleaseAccess( pWriteAcc );
+ pReadAcc.reset();
+ pWriteAcc.reset();
if( bRet )
aRetBmp = aDstBmp;
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index 49186fe1673d..93abb7e0ddd3 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -198,7 +198,7 @@ Bitmap createHistorical8x8FromArray(const sal_uInt16* pArray, Color aColorPix, C
aPalette[1] = BitmapColor(aColorPix);
Bitmap aBitmap(Size(8, 8), 1, &aPalette);
- BitmapWriteAccess* pContent = aBitmap.AcquireWriteAccess();
+ Bitmap::ScopedWriteAccess pContent(aBitmap);
if(pContent)
{
@@ -217,7 +217,7 @@ Bitmap createHistorical8x8FromArray(const sal_uInt16* pArray, Color aColorPix, C
}
}
- Bitmap::ReleaseAccess(pContent);
+ pContent.reset();
}
return aBitmap;
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index eff96c776d12..4b3f75705b90 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -1414,7 +1414,7 @@ DECLARE_OOXMLEXPORT_TEST(testPictureWithSchemeColor, "picture-with-schemecolor.d
uno::Reference<graphic::XGraphic> xGraphic = getProperty<uno::Reference<graphic::XGraphic> >(xImage, "Graphic");
Graphic aVclGraphic(xGraphic);
Bitmap aBitmap(aVclGraphic.GetBitmap());
- BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess();
+ Bitmap::ScopedReadAccess pAccess(aBitmap);
CPPUNIT_ASSERT(pAccess);
CPPUNIT_ASSERT_EQUAL(341L, pAccess->Width());
CPPUNIT_ASSERT_EQUAL(181L, pAccess->Height());
@@ -1422,7 +1422,6 @@ DECLARE_OOXMLEXPORT_TEST(testPictureWithSchemeColor, "picture-with-schemecolor.d
CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), RGB_COLORDATA( 0xb1, 0xc8, 0xdd ));
aColor = pAccess->GetPixel(130, 260);
CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), RGB_COLORDATA( 0xb1, 0xc8, 0xdd ));
- Bitmap::ReleaseAccess(pAccess);
}
DECLARE_OOXMLEXPORT_TEST(testFdo69656, "Table_cell_auto_width_fdo69656.docx")
@@ -1593,13 +1592,12 @@ DECLARE_OOXMLEXPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.docx"
uno::Reference<awt::XBitmap> bitmap(graphic, uno::UNO_QUERY);
Graphic aVclGraphic(graphic);
Bitmap aBitmap(aVclGraphic.GetBitmap());
- BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess();
+ Bitmap::ScopedReadAccess pAccess(aBitmap);
CPPUNIT_ASSERT(pAccess);
CPPUNIT_ASSERT_EQUAL(58L, pAccess->Width());
CPPUNIT_ASSERT_EQUAL(320L, pAccess->Height());
Color aColor(pAccess->GetPixel(30, 20));
CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), RGB_COLORDATA( 0xce, 0xce, 0xce ));
- Bitmap::ReleaseAccess(pAccess);
}
DECLARE_OOXMLEXPORT_TEST(testChartSize, "chart-size.docx")