[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 27 16:33:04 UTC 2020


 sw/qa/extras/uiwriter/data/tdf134931.odt |binary
 sw/qa/extras/uiwriter/uiwriter.cxx       |   35 +++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)

New commits:
commit 49307ae2cef2d2d43fee92f99809d2bf192343de
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Jul 31 16:47:56 2020 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Tue Oct 27 17:32:28 2020 +0100

    tdf#134931: sw_uiwriter: Add unittest
    
    Change-Id: I737296f1a0646065288be2cb0be3ef7f939fb536
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99878
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    (cherry picked from commit 99284a22f3cda8518cd2207128928c2e455c89ee)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104825
    Tested-by: Michael Stahl <michael.stahl at cib.de>
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/qa/extras/uiwriter/data/tdf134931.odt b/sw/qa/extras/uiwriter/data/tdf134931.odt
new file mode 100644
index 000000000000..bfd1ccf2e561
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf134931.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index f3f43f193310..43abc73da811 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -4526,6 +4526,41 @@ void SwUiWriterTest::testTdf88986()
     CPPUNIT_ASSERT(aSet.HasItem(SID_COLOR_TABLE));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134931)
+{
+    load(DATA_DIRECTORY, "tdf134931.odt");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(),
+                                                         uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+    lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    lcl_dispatchCommand(mxComponent, ".uno:Copy", {});
+    Scheduler::ProcessEventsToIdle();
+
+    lcl_dispatchCommand(mxComponent, ".uno:GoDown", {});
+
+    for (sal_Int32 i = 0; i < 10; ++i)
+    {
+        lcl_dispatchCommand(mxComponent, ".uno:Paste", {});
+        Scheduler::ProcessEventsToIdle();
+    }
+
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(11), xIndexAccess->getCount());
+
+    // Without the fix in place, this test would have failed with:
+    // - Expected: 4
+    // - Actual  : 1
+    // Because the tables are pasted but not displayed
+
+    CPPUNIT_ASSERT_EQUAL(4, getPages());
+}
+
 void SwUiWriterTest::testTdf87922()
 {
     // Create an SwDrawTextInfo.


More information about the Libreoffice-commits mailing list