From b2fed82803156bad01cf30043f5f4b3eb8668799 Mon Sep 17 00:00:00 2001 From: julien2412 Date: Sat, 3 Sep 2011 18:36:26 +0200 Subject: Cppcheck detected the use of an auto_ptr with new []. Since, auto_ptr shouldn't be used with new[] because it always does a delete (and not a delete[] in this case), the code is changed to use boost::shared_array. --- filter/source/svg/svgwriter.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'filter') diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 364036f35fb1..7910f0ab0304 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -36,6 +36,7 @@ #include "svgfontexport.hxx" #include "svgwriter.hxx" #include +#include using ::rtl::OUString; @@ -1117,7 +1118,6 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, { sal_Int32 nLen = rText.Len(); Size aNormSize; - ::std::auto_ptr< sal_Int32 > apTmpArray; sal_Int32* pDX; Point aPos; Point aBaseLinePos( rPos ); @@ -1142,7 +1142,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, } else { - apTmpArray.reset( new sal_Int32[ nLen ] ); + boost::shared_array apTmpArray(new sal_Int32[ nLen ]); aNormSize = Size( mpVDev->GetTextArray( rText, apTmpArray.get() ), 0 ); pDX = apTmpArray.get(); } -- cgit