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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Thu May 7 11:12:03 UTC 2020


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

New commits:
commit 0f73c9f8847c1febc9a01ee84625981005797a2e
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue May 5 15:26:49 2020 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Thu May 7 13:11:31 2020 +0200

    tdf#132187: sw: Add unittest
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93485
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
    (cherry picked from commit 823a224843ee78a33f2d346c02344a88a77b2758)
    
    Change-Id: I767f96fd8d373df9b8cbecd9cb75ed114166d0f8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93616
    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/tdf132187.odt b/sw/qa/extras/uiwriter/data/tdf132187.odt
new file mode 100644
index 000000000000..27bea84b6584
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf132187.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 88a8fe9d3930..74e5f93c8174 100755
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -220,6 +220,7 @@ public:
     void testSearchWithTransliterate();
     void testTdf73660();
     void testNewDocModifiedState();
+    void testTdf132187();
     void testTdf77342();
     void testTdf63553();
     void testTdf74230();
@@ -418,6 +419,7 @@ public:
     CPPUNIT_TEST(testSearchWithTransliterate);
     CPPUNIT_TEST(testTdf73660);
     CPPUNIT_TEST(testNewDocModifiedState);
+    CPPUNIT_TEST(testTdf132187);
     CPPUNIT_TEST(testTdf77342);
     CPPUNIT_TEST(testTdf63553);
     CPPUNIT_TEST(testTdf74230);
@@ -4149,6 +4151,31 @@ void SwUiWriterTest::testUnicodeNotationToggle()
     CPPUNIT_ASSERT_EQUAL( sDocString, sOriginalDocString );
 }
 
+void SwUiWriterTest::testTdf132187()
+{
+    load(DATA_DIRECTORY, "tdf132187.odt");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+    lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    lcl_dispatchCommand(mxComponent, ".uno:Copy", {});
+    lcl_dispatchCommand(mxComponent, ".uno:GoToEndOfDoc", {});
+
+    for (sal_Int32 i = 0; i < 10; ++i)
+    {
+        lcl_dispatchCommand(mxComponent, ".uno:Paste", {});
+        Scheduler::ProcessEventsToIdle();
+    }
+
+    //without the fix in place, this test would fail with:
+    //- Expected: 1
+    //- Actual  : 70
+
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 void SwUiWriterTest::testTdf34957()
 {
     load(DATA_DIRECTORY, "tdf34957.odt");


More information about the Libreoffice-commits mailing list