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 9201a9f0aa239b4a2fce17b7c45175590855f349
Author:     Jaume Pujantell <jaume.pujant...@collabora.com>
AuthorDate: Mon Nov 20 10:24:18 2023 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Nov 23 14:09:02 2023 +0100

    fix a regression crash
    
    Fixes a crash introduced by commit 5082d50 in crashtesting file
    7693 bugtrackers/docx/tdf108272-1.docx.
    
    Change-Id: Id33c49165c4d345d652a546db14df98ee0ff754a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159736
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 43868de0ddabba952b923f6189d1fefeddb70bcf)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159760
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

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 f3b102f096cc..dd4d71eda57c 100644
--- a/sw/qa/core/unocore/unocore.cxx
+++ b/sw/qa/core/unocore/unocore.cxx
@@ -932,6 +932,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, 
testCollectFrameAtNodeWithLayout)
     assertXPath(pXmlDoc, "//draw:frame", 1);
 }
 
+// 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 98b9cecbf57c..3f8cf8dee72c 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1690,6 +1690,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);

Reply via email to