diff options
author | julien2412 <serval2412@yahoo.fr> | 2011-09-03 18:36:26 +0200 |
---|---|---|
committer | Thorsten Behrens <tbehrens@novell.com> | 2011-09-03 18:38:57 +0200 |
commit | b2fed82803156bad01cf30043f5f4b3eb8668799 (patch) | |
tree | bd22e2980dfbc6cedfc6b69de6759e17c37b32ff /filter | |
parent | add LibreOffice branding: logos and colors (diff) | |
download | core-b2fed82803156bad01cf30043f5f4b3eb8668799.tar.gz core-b2fed82803156bad01cf30043f5f4b3eb8668799.zip |
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.
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/svg/svgwriter.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
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 <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(); } |