summaryrefslogtreecommitdiffstats
path: root/drawinglayer
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-02 20:05:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-04 08:17:06 +0200
commitd4dc6b5cfdb02ad00a06ad32650948648abe010d (patch)
tree02446cd93e68aba9b78db6eb7fc902e782c6faf9 /drawinglayer
parentfix comment left behind (diff)
downloadcore-d4dc6b5cfdb02ad00a06ad32650948648abe010d.tar.gz
core-d4dc6b5cfdb02ad00a06ad32650948648abe010d.zip
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 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx2
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx7
2 files changed, 5 insertions, 4 deletions
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 0a0ab23b7d22..c36c73658a08 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -309,7 +309,7 @@ std::vector<double> TextLayouterDevice::getTextArray(const OUString& rText, sal_
{
aRetval.reserve(nTextLength);
std::vector<tools::Long> aArray(nTextLength);
- mrDevice.GetTextArray(rText, aArray.data(), nIndex, nLength);
+ mrDevice.GetTextArray(rText, &aArray, nIndex, nLength);
aRetval.assign(aArray.begin(), aArray.end());
}
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 30de0626d6e5..77a3adae255d 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -286,8 +286,8 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
sal_Int32 nPos = rTextCandidate.getTextPosition();
sal_Int32 nLen = rTextCandidate.getTextLength();
- tools::Long* pDXArray
- = !aTransformedDXArray.empty() ? aTransformedDXArray.data() : nullptr;
+ std::vector<tools::Long>* pDXArray
+ = !aTransformedDXArray.empty() ? &aTransformedDXArray : nullptr;
if (rTextCandidate.isFilled())
{
@@ -314,7 +314,8 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
if (!aTransformedDXArray.empty())
{
- mpOutputDevice->DrawTextArray(aStartPoint, aText, pDXArray, nPos, nLen);
+ mpOutputDevice->DrawTextArray(aStartPoint, aText,
+ pDXArray ? pDXArray->data() : nullptr, nPos, nLen);
}
else
{