diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-06-03 16:03:09 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-06-04 08:40:00 +0200 |
commit | 417353e1c0dca23d888f554ff272f66e40b77eab (patch) | |
tree | 1edb2fd643016a72bc345a6c1c8d1c45068b077d | |
parent | b83ac35bf46ecbebf7f806235eca38a71e521c32 (diff) |
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@cib.de>
-rw-r--r-- | sw/source/core/text/porlay.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
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() ) ) ) ) |