[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 4 10:41:00 UTC 2020


 sw/source/core/text/porlay.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 4927143b6652ce2d19e6f476923112f0ab7fc273
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Jun 3 16:03:09 2020 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Thu Jun 4 12:40:26 2020 +0200

    tdf#130804 sw: fix bookmark portions in line containing only as-char fly
    
    There were 2 problems:
    
    * due to the first bookmark portion, the line got an additional 55 twips
      of its descent added to its height in SwLineLayout::CalcLine().
    
    * when called from SwTextFrame::CalcHeightOfLastLine(),
      SwLineLayout::MaxAscentDescent() is supposed to ignore FlyInCnt
      portions, but it didn't ignore the bookmark portion which had the same
      height, hence the resulting line spacing was 855 instead of 0 and the
      upper margin of the next paragraph increased similarly.
    
    (regression from 4ce8120f1e53f7b81e653b01d141643013bc69ab)
    
    Change-Id: I52b154a48c5d712b7e3e323d2e3e08f37bf1afd1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95438
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 97d77b670d1c2e5dd045130427c42a6b74d55889)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95423
    Tested-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 2b51a2eca9bc..499dac050009 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -408,7 +408,9 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf )
                 }
 
                 // Ignore drop portion height
-                if( pPos->IsDropPortion() && static_cast<SwDropPortion*>(pPos)->GetLines() > 1)
+                // tdf#130804 ... and bookmark portions
+                if ((pPos->IsDropPortion() && static_cast<SwDropPortion*>(pPos)->GetLines() > 1)
+                    || pPos->GetWhichPor() == PortionType::Bookmark)
                 {
                     pLast = pPos;
                     pPos = pPos->GetNextPortion();
@@ -618,6 +620,8 @@ void SwLineLayout::MaxAscentDescent( SwTwips& _orAscent,
     while ( pTmpPortion )
     {
         if ( !pTmpPortion->IsBreakPortion() && !pTmpPortion->IsFlyPortion() &&
+            // tdf#130804 ignore bookmark portions
+             pTmpPortion->GetWhichPor() != PortionType::Bookmark &&
              ( !_bNoFlyCntPorAndLinePor ||
                ( !pTmpPortion->IsFlyCntPortion() &&
                  !(pTmpPortion == this && pTmpPortion->GetNextPortion() ) ) ) )


More information about the Libreoffice-commits mailing list