diff options
-rw-r--r-- | sw/qa/extras/layout/data/forcepoint99.html | bin | 0 -> 14034 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 8 | ||||
-rwxr-xr-x | sw/source/core/text/itrform2.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/text/itrform2.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/porlay.cxx | 4 |
5 files changed, 24 insertions, 5 deletions
diff --git a/sw/qa/extras/layout/data/forcepoint99.html b/sw/qa/extras/layout/data/forcepoint99.html Binary files differnew file mode 100644 index 000000000000..6eb36a616e26 --- /dev/null +++ b/sw/qa/extras/layout/data/forcepoint99.html diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 97950bd8d497..81c1eb53e716 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -300,6 +300,14 @@ void SwLayoutWriter::testTdf118058() pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout(); } +//just care it doesn't crash/assert +#if 0 // no createSwWebDoc +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint99) +{ + createSwWebDoc(DATA_DIRECTORY, "forcepoint99.html"); +} +#endif + void SwLayoutWriter::testTdf117188() { createDoc("tdf117188.docx"); diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 8f3f8284d850..f1b179518f4f 100755 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -148,6 +148,16 @@ sal_uInt16 SwTextFormatter::GetFrameRstHeight() const return sal_uInt16( nHeight ); } +bool SwTextFormatter::ClearIfIsFirstOfBorderMerge(const SwLinePortion* pPortion) +{ + if (pPortion == m_pFirstOfBorderMerge) + { + m_pFirstOfBorderMerge = nullptr; + return true; + } + return false; +} + SwLinePortion *SwTextFormatter::Underflow( SwTextFormatInfo &rInf ) { // Save values and initialize rInf @@ -276,11 +286,8 @@ SwLinePortion *SwTextFormatter::Underflow( SwTextFormatInfo &rInf ) SwLinePortion* pNext = pPor->GetPortion(); while (pNext) { - if (pNext == m_pFirstOfBorderMerge) - { - m_pFirstOfBorderMerge = nullptr; + if (ClearIfIsFirstOfBorderMerge(pNext)) break; - } pNext = pNext->GetPortion(); } pPor->Truncate(); diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx index ff430b8616d1..08b0582b1569 100644 --- a/sw/source/core/text/itrform2.hxx +++ b/sw/source/core/text/itrform2.hxx @@ -239,6 +239,8 @@ public: * @param rInf contain information **/ void MergeCharacterBorder( SwLinePortion& rPortion, SwLinePortion const *pPrev, SwTextFormatInfo& rInf ); + + bool ClearIfIsFirstOfBorderMerge(SwLinePortion const *pPortion); }; #endif diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 1968e48a30ab..be7a30c3468d 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -369,7 +369,9 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf ) if( !GetAscent() ) SetAscent( pPos->GetAscent() ); } - delete pLast->Cut( pPos ); + SwLinePortion* pPortion = pLast->Cut( pPos ); + rLine.ClearIfIsFirstOfBorderMerge(pPortion); + delete pPortion; pPos = pLast->GetPortion(); continue; } |