diff options
-rw-r--r-- | sw/source/core/text/itrpaint.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/text/itrpaint.hxx | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx index c2a455641715..f88e6ec07c70 100644 --- a/sw/source/core/text/itrpaint.cxx +++ b/sw/source/core/text/itrpaint.cxx @@ -70,7 +70,7 @@ void SwTextPainter::CtorInitTextPainter( SwTextFrame *pNewFrame, SwTextPaintInfo m_bPaintDrop = false; } -SwLinePortion *SwTextPainter::CalcPaintOfst( const SwRect &rPaint ) +SwLinePortion *SwTextPainter::CalcPaintOfst(const SwRect &rPaint, bool& rbSkippedNumPortions) { SwLinePortion *pPor = m_pCurr->GetFirstPortion(); GetInfo().SetPaintOfst( 0 ); @@ -98,6 +98,11 @@ SwLinePortion *SwTextPainter::CalcPaintOfst( const SwRect &rPaint ) } else pPor->Move( GetInfo() ); + if (pPor->InNumberGrp() + && !static_cast<SwNumberPortion const*>(pPor)->HasFollow()) + { + rbSkippedNumPortions = true; // all numbering portions were skipped? + } pLast = pPor; pPor = pPor->GetNextPortion(); } @@ -145,7 +150,16 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip, // 6882: blank lines can't be optimized by removing them if Formatting Marks are shown const bool bEndPor = GetInfo().GetOpt().IsParagraph() && GetInfo().GetText().isEmpty(); - SwLinePortion *pPor = bEndPor ? m_pCurr->GetFirstPortion() : CalcPaintOfst( rPaint ); + bool bSkippedNumPortions(false); + SwLinePortion *pPor = bEndPor ? m_pCurr->GetFirstPortion() : CalcPaintOfst(rPaint, bSkippedNumPortions); + + if (bSkippedNumPortions) // ugly but hard to check earlier in PaintSwFrame: + { // there is a num portion but it is outside of the frame area and not painted + assert(!roTaggedLabel); + assert(!roTaggedParagraph); + Frame_Info aFrameInfo(*m_pFrame); // open LBody + roTaggedParagraph.emplace(nullptr, &aFrameInfo, nullptr, *GetInfo().GetOut()); + } // Optimization! SwTwips nMaxRight = std::min<SwTwips>( rPaint.Right(), Right() ); diff --git a/sw/source/core/text/itrpaint.hxx b/sw/source/core/text/itrpaint.hxx index 1c614e2a34d3..893db371dbb4 100644 --- a/sw/source/core/text/itrpaint.hxx +++ b/sw/source/core/text/itrpaint.hxx @@ -31,7 +31,7 @@ class SwTextPainter : public SwTextCursor { bool m_bPaintDrop; - SwLinePortion *CalcPaintOfst( const SwRect &rPaint ); + SwLinePortion *CalcPaintOfst(const SwRect &rPaint, bool& rbSkippedNumPortions); void CheckSpecialUnderline( const SwLinePortion* pPor, tools::Long nAdjustBaseLine = 0 ); protected: |