summaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/layout/data/abi11870-2.odtbin0 -> 117386 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx6
-rw-r--r--sw/source/core/text/itrform2.cxx2
-rw-r--r--sw/source/core/text/pormulti.cxx8
-rw-r--r--sw/source/core/text/porrst.cxx9
-rw-r--r--sw/source/core/text/porrst.hxx7
6 files changed, 15 insertions, 17 deletions
diff --git a/sw/qa/extras/layout/data/abi11870-2.odt b/sw/qa/extras/layout/data/abi11870-2.odt
new file mode 100644
index 000000000000..b02bb85646aa
--- /dev/null
+++ b/sw/qa/extras/layout/data/abi11870-2.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index ea4619f9c1bc..a6015fedaac3 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3482,6 +3482,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116501)
createDoc("tdf116501.odt");
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testAbi11870)
+{
+ //just care it doesn't assert
+ createDoc("abi11870-2.odt");
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118719)
{
// Insert a page break.
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 8a906b4bf2e3..7901c10ccadd 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1209,7 +1209,7 @@ SwLinePortion *SwTextFormatter::WhichFirstPortion(SwTextFormatInfo &rInf)
assert(bookmark & SwScriptInfo::MarkKind::Point);
mark = '|';
}
- pPor = new SwBookmarkPortion(rInf.GetLast(), mark);
+ pPor = new SwBookmarkPortion(mark);
}
}
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 650198e8a458..3bd45fee2180 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -2037,7 +2037,13 @@ bool SwTextFormatter::BuildMultiPortion( SwTextFormatInfo &rInf,
if (rInf.GetLast()->GetWhichPor() == PortionType::Bookmark)
{
auto const pBookmark(static_cast<SwBookmarkPortion*>(rInf.GetLast()));
- rInf.SetLast(pBookmark->Unchain());
+ auto *const pPrevious = pBookmark->FindPrevPortion(rInf.GetRoot());
+ assert(!pPrevious || pPrevious->GetNextPortion() == pBookmark);
+ if (pPrevious)
+ {
+ pPrevious->SetNextPortion(nullptr);
+ }
+ rInf.SetLast(pPrevious);
assert(m_pCurr->GetNextPortion() == nullptr);
m_pCurr->SetNextPortion(pBookmark);
}
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 47d980183c3c..797725e298f6 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -639,13 +639,4 @@ sal_uInt16 SwControlCharPortion::GetViewWidth( const SwTextSizeInfo& rInf ) cons
return mnViewWidth;
}
-SwLinePortion * SwBookmarkPortion::Unchain()
-{
- assert(!m_pPrevious || m_pPrevious->GetNextPortion() == this);
- m_pPrevious->SetNextPortion(nullptr);
- auto const pTmp(m_pPrevious);
- m_pPrevious = nullptr;
- return pTmp;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porrst.hxx b/sw/source/core/text/porrst.hxx
index dcb2cfcae7e9..0619c6babe16 100644
--- a/sw/source/core/text/porrst.hxx
+++ b/sw/source/core/text/porrst.hxx
@@ -156,13 +156,9 @@ public:
/// SwControlCharPortion these do not have a character in the text.
class SwBookmarkPortion : public SwControlCharPortion
{
-private:
- SwLinePortion * m_pPrevious;
-
public:
- explicit SwBookmarkPortion(SwLinePortion *const pPrevious, sal_Unicode const cChar)
+ explicit SwBookmarkPortion(sal_Unicode const cChar)
: SwControlCharPortion(cChar)
- , m_pPrevious(pPrevious)
{
SetWhichPor(PortionType::Bookmark);
SetLen(TextFrameIndex(0));
@@ -171,7 +167,6 @@ public:
virtual bool DoPaint(SwTextPaintInfo const& rInf,
OUString & rOutString, SwFont & rTmpFont, int & rDeltaY) const override;
virtual SwLinePortion * Compress() override { return this; }
- SwLinePortion * Unchain();
};
#endif