Skip to content

Commit

Permalink
tdf#144890 Invalid selection area when text in LTR run
Browse files Browse the repository at this point in the history
In
    commit ec50b9e
    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>
  • Loading branch information
grandinj authored and Noel Grandin committed Jan 8, 2022
1 parent b2d742f commit 563af8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sw/source/core/layout/trvlfrm.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 563af8f

Please sign in to comment.