Kaydet (Commit) 7bda8fbd 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
üst 6f9bb9bd
......@@ -10758,14 +10758,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 ) );
......@@ -10925,8 +10917,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();
......@@ -11240,8 +11231,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
}
}
BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess();
AccessReleaser aReleaser( pAccess );
Bitmap::ScopedReadAccess pAccess(aBitmap);
bool bTrueColor;
sal_Int32 nBitsPerComponent;
......@@ -11421,7 +11411,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