sw/qa/core/unocore/data/tdf108272-1-minimal.docx |binary sw/qa/core/unocore/unocore.cxx | 6 ++++++ sw/source/core/unocore/unotext.cxx | 1 + 3 files changed, 7 insertions(+)
New commits: commit 43868de0ddabba952b923f6189d1fefeddb70bcf Author: Jaume Pujantell <jaume.pujant...@collabora.com> AuthorDate: Mon Nov 20 10:24:18 2023 +0100 Commit: Jaume Pujantell <jaume.pujant...@collabora.com> CommitDate: Mon Nov 20 12:18:23 2023 +0100 fix a regression crash Fixes a crash introduced by commit 5082d50. Change-Id: Id33c49165c4d345d652a546db14df98ee0ff754a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159736 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sw/qa/core/unocore/data/tdf108272-1-minimal.docx b/sw/qa/core/unocore/data/tdf108272-1-minimal.docx new file mode 100644 index 000000000000..28efdf65b9af Binary files /dev/null and b/sw/qa/core/unocore/data/tdf108272-1-minimal.docx differ diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx index fd5c139e979a..00c61a042b77 100644 --- a/sw/qa/core/unocore/unocore.cxx +++ b/sw/qa/core/unocore/unocore.cxx @@ -1025,6 +1025,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testTdf149555) CPPUNIT_ASSERT_EQUAL(OUString("HEADER 2"), xHeaderText->getString()); } +// just care that it doesn't crash/assert +CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testTdf108272Crash) +{ + createSwDoc("tdf108272-1-minimal.docx"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 5fef89f3ffde..f959d6a6104c 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1579,6 +1579,7 @@ SwXText::convertToTextFrame( (pStartStartNode != GetStartNode())) { // if not - remove the additional paragraphs and throw + oAnchorCheckPam.reset(); // clear SwIndex before deleting nodes if (bParaBeforeInserted) { SwCursor aDelete(*pStartPam->GetPoint(), nullptr);