Kaydet (Commit) 5a3e156f authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

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 7bda8fbd)
üst 18f668d9
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment