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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 26 08:30:40 UTC 2020


 sw/qa/extras/uiwriter/uiwriter.cxx |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

New commits:
commit bebdc5e923c9e5dcb9d2f8d32244a9eeb925b31f
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Oct 15 23:44:04 2020 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Mon Oct 26 09:30:02 2020 +0100

    tdf#135260: sw_uiwriter: Add unittest
    
    Change-Id: Iec50c3129097e99ae57543601d40c5a380db678f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104391
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    (cherry picked from commit c143ad222a3c4c8d86699e1b3f20d3a5262da1e2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104746
    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/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 76e6b84445aa..6bdd32559330 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -292,6 +292,7 @@ public:
     void testTdf84695Tab();
     void testTableStyleUndo();
     void testRedlineCopyPaste();
+    void testTdf135260();
     void testRedlineParam();
     void testRedlineViewAuthor();
     void testTdf91292();
@@ -507,6 +508,7 @@ public:
     CPPUNIT_TEST(testTdf84695Tab);
     CPPUNIT_TEST(testTableStyleUndo);
     CPPUNIT_TEST(testRedlineCopyPaste);
+    CPPUNIT_TEST(testTdf135260);
     CPPUNIT_TEST(testRedlineParam);
     CPPUNIT_TEST(testRedlineViewAuthor);
     CPPUNIT_TEST(testTdf91292);
@@ -5622,6 +5624,32 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134436)
     CPPUNIT_ASSERT_EQUAL(OUString(""), pWrtShell->GetCursor()->GetText());
 }
 
+void SwUiWriterTest::testTdf135260()
+{
+    SwDoc* pDoc = createDoc();
+    SwDocShell* pDocShell = pDoc->GetDocShell();
+    SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+    pWrtShell->Insert("test");
+
+    // Turn on track changes
+    uno::Reference<beans::XPropertySet> xPropertySet(mxComponent, uno::UNO_QUERY);
+    xPropertySet->setPropertyValue("RecordChanges", uno::makeAny(true));
+
+    for(int i = 0; i < 4; i++) {
+        pWrtShell->DelLeft();
+    }
+
+    SwEditShell* const pEditShell(pDoc->GetEditShell());
+    // accept all redlines
+    while(pEditShell->GetRedlineCount())
+        pEditShell->AcceptRedline(0);
+
+    // Without the fix in place, this test would have failed with
+    // - Expected:
+    // - Actual  : tes
+    CPPUNIT_ASSERT_EQUAL(OUString(""), getParagraph(1)->getString());
+}
+
 void SwUiWriterTest::testRedlineParam()
 {
     // Create a document with minimal content.


More information about the Libreoffice-commits mailing list