[Libreoffice-commits] .: filter/source

Thorsten Behrens thorsten at kemper.freedesktop.org
Sat Sep 3 09:39:52 PDT 2011


 filter/source/svg/svgwriter.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b2fed82803156bad01cf30043f5f4b3eb8668799
Author: julien2412 <serval2412 at yahoo.fr>
Date:   Sat Sep 3 18:36:26 2011 +0200

    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.

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 364036f..7910f0a 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -36,6 +36,7 @@
 #include "svgfontexport.hxx"
 #include "svgwriter.hxx"
 #include <vcl/unohelp.hxx>
+#include <boost/shared_array.hpp>
 
 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<sal_Int32> apTmpArray(new sal_Int32[ nLen ]);
         aNormSize = Size( mpVDev->GetTextArray( rText, apTmpArray.get() ), 0 );
         pDX = apTmpArray.get();
     }


More information about the Libreoffice-commits mailing list