summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorJonathan Clark <jonathan@libreoffice.org>2024-09-06 04:00:26 -0600
committerJonathan Clark <jonathan@libreoffice.org>2024-09-09 15:43:42 +0200
commit6eb0523e27473fe2ebe281b2682a5045f3b39312 (patch)
tree9879b251acca9128d268362534acbd5dc5c0ce56 /editeng/source
parent7e93e2721f200940547a23814eccc2348e1d6adf (diff)
tdf#162803 editeng: Fix invalid kashida array after layout
This change updates editeng to clear the kashida array during layout, at the same time it clears other justification data. Previously, editeng could recycle stale kashida arrays and apply them to lines with different lengths. This would result in stray kashida rendered at inappropriate positions in lines, or accessing memory past the end of the kashida array, resulting in assertions or nondeterministic crashes. Change-Id: I9c06239298d630f2d61b5e67a54f4c3e079c1193 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172967 Reviewed-by: Jonathan Clark <jonathan@libreoffice.org> Tested-by: Jenkins
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/editeng/impedit3.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index d7c3111d9e8e..6f7d1e7ac928 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -921,6 +921,9 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
// =>...
pLine->GetCharPosArray().clear();
+ // tdf#162803: Stale kashida position data also needs to be cleared on each layout.
+ pLine->GetKashidaArray().clear();
+
sal_Int32 nTmpPos = nIndex;
sal_Int32 nTmpPortion = pLine->GetStartPortion();
tools::Long nTmpWidth = 0;