summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-06-14 14:24:07 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-06-15 08:27:32 +0200
commit4e8295638e68295d73b49ddb80e23c3509a49b3e (patch)
tree48526acd118d8a4758842f933af74703d138dc41 /sw/qa
parentac4719fe7365fb77c82bf5d937af069942671084 (diff)
tdf#148868: sw_uiwriter3: Add unittest
Change-Id: I110079662cb001bbe3044138a1e7d23383cc083d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135827 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/uiwriter/data/tdf148868.odtbin0 -> 11112 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx19
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf148868.odt b/sw/qa/extras/uiwriter/data/tdf148868.odt
new file mode 100644
index 000000000000..7ebf68a82ea3
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf148868.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 3c794a3da60e..1c7c4a87d3c5 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -352,6 +352,25 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147126)
}
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf148868)
+{
+ SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf148868.odt");
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ pWrtShell->EndPg(/*bSelect=*/false);
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 5, /*bBasicCall=*/false);
+ pWrtShell->Insert("X");
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: 1
+ // - Actual : 0
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382)
{
SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf129382.docx");