diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-02 20:05:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-04 08:17:06 +0200 |
commit | d4dc6b5cfdb02ad00a06ad32650948648abe010d (patch) | |
tree | 02446cd93e68aba9b78db6eb7fc902e782c6faf9 /toolkit | |
parent | 86fa9c907387e96c9c93f1e17239730271fedbfd (diff) |
use std::vector for fetching DX array data
because I'm trying to track down a related heap corruption, and that is
much easier if the access to the array is checked by the std::vector
debug runtime
Change-Id: Ia665f5cebb7f14d88942e88b4b400ad3c28ef5d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxfont.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx index f7159c1bedd6..35648afdc1fc 100644 --- a/toolkit/source/awt/vclxfont.cxx +++ b/toolkit/source/awt/vclxfont.cxx @@ -156,12 +156,12 @@ sal_Int32 VCLXFont::getStringWidthArray( const OUString& str, css::uno::Sequence { vcl::Font aOldFont = pOutDev->GetFont(); pOutDev->SetFont( maFont ); - std::unique_ptr<tools::Long []> pDXA(new tools::Long[str.getLength()]); - nRet = pOutDev->GetTextArray( str, pDXA.get() ); + std::vector<tools::Long> aDXA; + nRet = pOutDev->GetTextArray( str, &aDXA ); rDXArray = css::uno::Sequence<sal_Int32>( str.getLength() ); for(int i = 0; i < str.getLength(); i++) { - rDXArray[i] = pDXA[i]; + rDXArray[i] = aDXA[i]; } pOutDev->SetFont( aOldFont ); } |