summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2011-05-16 13:27:04 +0200
committerDavid Tardon <dtardon@redhat.com>2011-05-16 15:39:28 +0200
commitf1b0e6c78d6c9d34c4d64348c06833f9907f1b3d (patch)
tree2b40b504cf393b999b79ec3d29f2220cbc8b0ec0
parent4815030a61637b30e3b23e80e682cac1c68df64a (diff)
do not leak memory
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index f4f3077fe0..0ec1263488 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -347,13 +347,9 @@ namespace drawinglayer
if(nTextLength)
{
aRetval.reserve(nTextLength);
- sal_Int32* pArray = new sal_Int32[nTextLength];
- mrDevice.GetTextArray(rText, pArray, nIndex, nLength);
-
- for(sal_uInt32 a(0); a < nTextLength; a++)
- {
- aRetval.push_back(pArray[a]);
- }
+ ::std::vector<sal_Int32> aArray(nTextLength);
+ mrDevice.GetTextArray(rText, &aArray[0], nIndex, nLength);
+ aRetval.assign(aArray.begin(), aArray.end());
}
return aRetval;