sw/qa/extras/uiwriter/data3/tdf138482.docx |binary
 sw/qa/extras/uiwriter/uiwriter3.cxx        |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit c1137082458cd982eb70393e13e60fc09d31958b
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu Feb 11 13:03:29 2021 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Feb 11 15:16:25 2021 +0100

    tdf#138482: sw_uiwriter3: Add unittest
    
    Change-Id: Ic8c175572ca5554673a802a26b696bcf7ac07f54
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110761
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/data3/tdf138482.docx 
b/sw/qa/extras/uiwriter/data3/tdf138482.docx
new file mode 100644
index 000000000000..7bb4623e2c0c
Binary files /dev/null and b/sw/qa/extras/uiwriter/data3/tdf138482.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index b755378b0b72..a24cdb3329f5 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -150,6 +150,28 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135412)
     CPPUNIT_ASSERT_EQUAL(OUString("X"), xShape->getString());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf138482)
+{
+    load(DATA_DIRECTORY, "tdf138482.docx");
+
+    SwXTextDocument* pTextDoc = 
dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    CPPUNIT_ASSERT_EQUAL(2, getShapes());
+
+    dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    Scheduler::ProcessEventsToIdle();
+
+    // Without the fix in place, this test would have crashed here
+    dispatchCommand(mxComponent, ".uno:Delete", {});
+    Scheduler::ProcessEventsToIdle();
+    CPPUNIT_ASSERT_EQUAL(0, getShapes());
+
+    dispatchCommand(mxComponent, ".uno:Undo", {});
+    Scheduler::ProcessEventsToIdle();
+    CPPUNIT_ASSERT_EQUAL(2, getShapes());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132911)
 {
     load(DATA_DIRECTORY, "tdf132911.odt");
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to