diff options
author | Mark Page <aptitude@btconnect.com> | 2016-12-05 14:03:12 +0000 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-06 18:17:56 +0000 |
commit | d08db164dcac8f6aa88158b2848abb5ad66a4052 (patch) | |
tree | bacb0e7b183115e3b00bd4c375b37908264f0f87 /sd | |
parent | 0c6c37cb01c242ad9324bc91ac15c974529086c5 (diff) |
Change Read/Write access to Scoped Read/Write access
Change-Id: Idbe8e393b64f2a151e20c1851d7c14fa161acf97
Reviewed-on: https://gerrit.libreoffice.org/31635
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/vectdlg.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsFramePainter.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/table/TableDesignPane.cxx | 4 |
4 files changed, 14 insertions, 13 deletions
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; |