summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-01-07 22:50:29 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-01-10 16:56:10 +0100
commit2de9b8ad9eaadb420b70ed9b5604c876f161c04c (patch)
tree3026eed8f203dbb6d11722dafacb3eeacc351e78
parenttdf#146617: iterators may be invalidated during handler call (diff)
downloadcore-2de9b8ad9eaadb420b70ed9b5604c876f161c04c.tar.gz
core-2de9b8ad9eaadb420b70ed9b5604c876f161c04c.zip
tdf#144890 Invalid selection area when text in LTR run
In commit ec50b9e5eaec7c94df35617676077ef0d65cecc7 no need to allocate Sw2LinesPos separately on heap I made this change, // If there's no doubleline portion involved or start and end are both // in the same doubleline portion, all works fine, but otherwise // we need the following... - if( pSt2Pos != pEnd2Pos && ( !pSt2Pos || !pEnd2Pos || + if( (pSt2Pos || pEnd2Pos) && ( !pSt2Pos || !pEnd2Pos || pSt2Pos->aPortion != pEnd2Pos->aPortion ) ) I tried to follow the explanation in the comment, since the existing comparison of pointers made no sense, since the two objects would always be distinct. However, that appears to have caused this bug, so change the comparison to directly represent the original logic. Change-Id: I95d6d870cecd762d4eb809d371e4a61b6641c85e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128133 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 563af8fd15aa37e75af8882cccbdf8914ebe8e61) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128155 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sw/source/core/layout/trvlfrm.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 2ce4542351bd..1ad00bdc05ca 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2145,7 +2145,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor)
// If there's no doubleline portion involved or start and end are both
// in the same doubleline portion, all works fine, but otherwise
// we need the following...
- if( (pSt2Pos || pEnd2Pos) && ( !pSt2Pos || !pEnd2Pos ||
+ if( (!pSt2Pos && !pEnd2Pos) && ( !pSt2Pos || !pEnd2Pos ||
pSt2Pos->aPortion != pEnd2Pos->aPortion ) )
{
// If we have a start(end) position inside a doubleline portion