diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2015-12-04 18:15:39 +0100 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2015-12-04 18:26:36 +0100 |
commit | 5a3e156f9595cc9490d6ac942a71c824429adea2 (patch) | |
tree | 40f02ad0962b126c24bfb3b7796ae1e720f904a9 /vcl/source | |
parent | 18f668d9e15cd86448bc3e470f5b3e8a534beb06 (diff) |
pdf export: use ScopedBitmapAccess and remove AccessReleaser
AccessReleaser does the same job as a ScopedBitmapAccess, but it
is a local class in pdf writer - removing it.
Change-Id: I3608a80fde8af938de479a9ecf44b134e1be7aa8
(cherry picked from commit 7bda8fbd17e271e8eaf3df2719da7f637465854a)
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index cea5b53bfe71..a04fa0d0613b 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -10759,14 +10759,6 @@ void PDFWriterImpl::drawPixel( const Point& rPoint, const Color& rColor ) setFillColor( aOldFillColor ); } -class AccessReleaser -{ - BitmapReadAccess* m_pAccess; -public: - explicit AccessReleaser( BitmapReadAccess* pAccess ) : m_pAccess( pAccess ){} - ~AccessReleaser() { delete m_pAccess; } -}; - bool PDFWriterImpl::writeTransparentObject( TransparencyEmit& rObject ) { CHECK_RETURN( updateObject( rObject.m_nObject ) ); @@ -10926,8 +10918,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject ) aDev->DrawGradient( Rectangle( Point( 0, 0 ), rObject.m_aSize ), rObject.m_aGradient ); Bitmap aSample = aDev->GetBitmap( Point( 0, 0 ), rObject.m_aSize ); - BitmapReadAccess* pAccess = aSample.AcquireReadAccess(); - AccessReleaser aReleaser( pAccess ); + Bitmap::ScopedReadAccess pAccess(aSample); Size aSize = aSample.GetSizePixel(); @@ -11241,8 +11232,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) } } - BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess(); - AccessReleaser aReleaser( pAccess ); + Bitmap::ScopedReadAccess pAccess(aBitmap); bool bTrueColor; sal_Int32 nBitsPerComponent; @@ -11422,7 +11412,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) #ifndef DEBUG_DISABLE_PDFCOMPRESSION if( nBitsPerComponent == 1 ) { - writeG4Stream( pAccess ); + writeG4Stream(pAccess.get()); } else #endif |