diff options
Diffstat (limited to 'filter/source/svg/svgwriter.cxx')
-rw-r--r-- | filter/source/svg/svgwriter.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 364036f35fb1..2267b928820f 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,8 +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 ); const FontMetric aMetric( mpVDev->GetFontMetric() ); @@ -1134,18 +1133,18 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, else aPos = rPos; + boost::shared_array<sal_Int32> xTmpArray(new sal_Int32[nLen]); // get text sizes if( pDXArray ) { aNormSize = Size( mpVDev->GetTextWidth( rText ), 0 ); - pDX = const_cast< sal_Int32* >( pDXArray ); + memcpy(xTmpArray.get(), pDXArray, nLen * sizeof(sal_Int32)); } else { - apTmpArray.reset( new sal_Int32[ nLen ] ); - aNormSize = Size( mpVDev->GetTextArray( rText, apTmpArray.get() ), 0 ); - pDX = apTmpArray.get(); + aNormSize = Size( mpVDev->GetTextArray( rText, xTmpArray.get() ), 0 ); } + sal_Int32* pDX = xTmpArray.get(); // if text is rotated, set transform matrix at new g element if( rFont.GetOrientation() ) @@ -1252,7 +1251,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, } if( bCont ) - nX = aPos.X() + pDXArray[ nCurPos - 1 ]; + nX = aPos.X() + pDX[ nCurPos - 1 ]; } } } |