[Libreoffice-commits] core.git: sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 3 15:15:10 UTC 2020


 sw/qa/extras/uiwriter/data3/tdf132420.odt |binary
 sw/qa/extras/uiwriter/uiwriter3.cxx       |   23 +++++++++++++++++++++++
 2 files changed, 23 insertions(+)

New commits:
commit c9faea128e46a5284948343f4f2cfc6f9e9174b8
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Jun 3 14:28:36 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Jun 3 17:14:28 2020 +0200

    tdf#132420: sw: Add unittest
    
    Change-Id: Ic98667b688c8d865e637fb921913a2d8d57133f0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95431
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/data3/tdf132420.odt b/sw/qa/extras/uiwriter/data3/tdf132420.odt
new file mode 100644
index 000000000000..8e556aa5a2d4
Binary files /dev/null and b/sw/qa/extras/uiwriter/data3/tdf132420.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 2ba1db6974d2..2a3a749401c9 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -489,6 +489,29 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf131684)
     CPPUNIT_ASSERT_EQUAL(sectionId, textUpper);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132420)
+{
+    load(DATA_DIRECTORY, "tdf132420.odt");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    CPPUNIT_ASSERT_EQUAL(12, getShapes());
+
+    dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    Scheduler::ProcessEventsToIdle();
+
+    dispatchCommand(mxComponent, ".uno:Cut", {});
+    Scheduler::ProcessEventsToIdle();
+    CPPUNIT_ASSERT_EQUAL(0, getShapes());
+
+    dispatchCommand(mxComponent, ".uno:Undo", {});
+    Scheduler::ProcessEventsToIdle();
+
+    //Without the fix in place, 1 frame and 1 image would be gone and getShapes would return 10
+    CPPUNIT_ASSERT_EQUAL(12, getShapes());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf80663)
 {
     mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");


More information about the Libreoffice-commits mailing list