summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/pdfwriter_impl.cxx
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2009-12-18 11:48:57 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2009-12-18 11:48:57 +0100
commita0c826b44af446e44b7dc4e80919c1c7f00c2eee (patch)
treec324db935ecffe5e205e429809da102f6abb0d57 /vcl/source/gdi/pdfwriter_impl.cxx
parentf4ccd00d3626347be13ca5919a07bb39b58729c5 (diff)
#vcl108: #i106704# use shared_array as is more appropriate
Diffstat (limited to 'vcl/source/gdi/pdfwriter_impl.cxx')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 7db8325bfedd..496ce037e1b3 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -64,8 +64,6 @@
#include "implncvt.hxx"
-#include <boost/shared_ptr.hpp>
-
#include "cppuhelper/implbase1.hxx"
#include <icc/sRGB-IEC61966-2.1.hxx>
@@ -3175,7 +3173,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
}
else
{
- boost::shared_ptr<unsigned char> pWriteBuffer( (unsigned char*)rtl_allocateMemory( nLength2 ), rtl_freeMemory );
+ boost::shared_array<unsigned char> pWriteBuffer( new unsigned char[ nLength2 ] );
rtl_zeroMemory( pWriteBuffer.get(), nLength2 );
int nWriteIndex = 0;
@@ -9367,15 +9365,15 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
else
{
const int nScanLineBytes = pAccess->Width()*3;
- boost::shared_ptr<sal_uInt8> pCol( (sal_uInt8*)rtl_allocateMemory( nScanLineBytes ), rtl_freeMemory );
+ boost::shared_array<sal_uInt8> pCol( new sal_uInt8[ nScanLineBytes ] );
for( int y = 0; y < pAccess->Height(); y++ )
{
for( int x = 0; x < pAccess->Width(); x++ )
{
BitmapColor aColor = pAccess->GetColor( y, x );
- pCol.get()[3*x+0] = aColor.GetRed();
- pCol.get()[3*x+1] = aColor.GetGreen();
- pCol.get()[3*x+2] = aColor.GetBlue();
+ pCol[3*x+0] = aColor.GetRed();
+ pCol[3*x+1] = aColor.GetGreen();
+ pCol[3*x+2] = aColor.GetBlue();
}
CHECK_RETURN( writeBuffer( pCol.get(), nScanLineBytes ) );
}