summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/textlayout.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi/textlayout.cxx')
-rw-r--r--vcl/source/gdi/textlayout.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx
index 7d336b511390..05b44b2dd939 100644
--- a/vcl/source/gdi/textlayout.cxx
+++ b/vcl/source/gdi/textlayout.cxx
@@ -32,6 +32,8 @@
#include <rtl/strbuf.hxx>
#endif
+#include <boost/scoped_array.hpp>
+
namespace vcl
{
@@ -222,10 +224,10 @@ namespace vcl
return;
}
- sal_Int32* pCharWidths = new sal_Int32[ _nLength ];
- long nTextWidth = GetTextArray( _rText, pCharWidths, _nStartIndex, _nLength );
- m_rTargetDevice.DrawTextArray( _rStartPoint, _rText, pCharWidths, _nStartIndex, _nLength );
- delete[] pCharWidths;
+ boost::scoped_array<sal_Int32> pCharWidths(new sal_Int32[ _nLength ]);
+ long nTextWidth = GetTextArray( _rText, pCharWidths.get(), _nStartIndex, _nLength );
+ m_rTargetDevice.DrawTextArray( _rStartPoint, _rText, pCharWidths.get(), _nStartIndex, _nLength );
+ pCharWidths.reset();
m_aCompleteTextRect.Union( Rectangle( _rStartPoint, Size( nTextWidth, m_rTargetDevice.GetTextHeight() ) ) );
}