diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2022-03-30 17:02:30 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-04-03 17:33:46 +0200 |
commit | 87c1615c1f6525c3f0e0d16dd98269744d21d183 (patch) | |
tree | 11e9e9e305aa387747e7fdc5762595856f08c7c9 /writerfilter | |
parent | 83852d3e002e38f607a1e97793f0c43a0cc49514 (diff) |
tdf#148273 docx import: fix section break format leak to bullets
Fixes RES_PARATR_LIST_AUTOFMT leaking into the next section.
Achieves this by resetting list related attributes on the cursor's
text node in DomainMapper_Impl::RemoveLastParagraph() after the
deletion of the paragraph.
Change-Id: Ib4d09c5f190b8b8fd3bdc119ddd57d91f353de2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132324
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132440
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index ffa829351baa..691e876d4859 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3768,10 +3768,10 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) static_cast<ParagraphPropertyMap*>(xContext.get())->SetListId(-1);; xContext->Erase(PROP_NUMBERING_LEVEL); } - m_pImpl->SetParaSectpr(false); finishParagraph(bRemove, bNoNumbering); if (bRemove) m_pImpl->RemoveLastParagraph(); + m_pImpl->SetParaSectpr(false); } else { diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 8afcede51d13..7eb9964e36a4 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -716,6 +716,14 @@ void DomainMapper_Impl::RemoveLastParagraph( ) // delete xCursor->setString(OUString()); + // While removing paragraphs that contain section properties, reset list + // related attributes to prevent them leaking into the following section's lists + if (GetParaSectpr()) + { + uno::Reference<beans::XPropertySet> XCursorProps(xCursor, uno::UNO_QUERY); + XCursorProps->setPropertyValue("ResetParagraphListAttributes", uno::Any()); + } + // call to xCursor->setString possibly did remove final bookmark // from previous paragraph. We need to restore it, if there was any. if (sLastBookmarkName.getLength()) |