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 /svx | |
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 'svx')
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdetc.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdfmtf.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 8 | ||||
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 8 | ||||
-rw-r--r-- | svx/source/xoutdev/xattrbmp.cxx | 4 |
6 files changed, 16 insertions, 24 deletions
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; |