summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-10-15 23:44:04 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-10-16 13:27:15 +0200
commitc143ad222a3c4c8d86699e1b3f20d3a5262da1e2 (patch)
treed0d9b4109da390a48571f0e47cf72b146eb70e21
parent30668130ce82c3f45af38ab419ec04fdb67c4509 (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>
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 9807343e912c..3ca0e97850ae 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -296,6 +296,7 @@ public:
void testTdf84695Tab();
void testTableStyleUndo();
void testRedlineCopyPaste();
+ void testTdf135260();
void testRedlineParam();
void testRedlineViewAuthor();
void testTdf91292();
@@ -521,6 +522,7 @@ public:
CPPUNIT_TEST(testTdf84695Tab);
CPPUNIT_TEST(testTableStyleUndo);
CPPUNIT_TEST(testRedlineCopyPaste);
+ CPPUNIT_TEST(testTdf135260);
CPPUNIT_TEST(testRedlineParam);
CPPUNIT_TEST(testRedlineViewAuthor);
CPPUNIT_TEST(testTdf91292);
@@ -5649,6 +5651,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.