diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-15 23:44:04 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-10-31 22:53:56 +0100 |
commit | 9af45cc8f109a70b5314202303daa42a425b11be (patch) | |
tree | 99d3240c82930910cc709eb16e910bbf4bc561dd /sw | |
parent | 0338a2a18d3252251439210ff737e9fa7f07c10a (diff) |
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@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105094
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 2a649608a796..f2e88e03b3c5 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -291,6 +291,7 @@ public: void testTdf84695Tab(); void testTableStyleUndo(); void testRedlineCopyPaste(); + void testTdf135260(); void testRedlineParam(); void testRedlineViewAuthor(); void testTdf91292(); @@ -504,6 +505,7 @@ public: CPPUNIT_TEST(testTdf84695Tab); CPPUNIT_TEST(testTableStyleUndo); CPPUNIT_TEST(testRedlineCopyPaste); + CPPUNIT_TEST(testTdf135260); CPPUNIT_TEST(testRedlineParam); CPPUNIT_TEST(testRedlineViewAuthor); CPPUNIT_TEST(testTdf91292); @@ -5579,6 +5581,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. |