summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2025-01-13 10:16:41 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2025-02-13 17:46:06 +0100
commitff7bd4d2ac03f39f1da8ead9a6474e84d0f7b277 (patch)
tree9c265b85fb16d7cc85c037bbb2b32b1ad869893c /sw/qa
parent449aca5c02c9a927f44b3c6cae99248903fb492c (diff)
tdf#164620: sw_uiwriter3: Add unittest
and fix another edge case it found. Change-Id: Ia57ae1c9a13279f240b78f90fd05faa2f0da7ce5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180162 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/uiwriter/data/tdf164620.docxbin0 -> 10635 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx18
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf164620.docx b/sw/qa/extras/uiwriter/data/tdf164620.docx
new file mode 100644
index 000000000000..6e74b6bf7fe3
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf164620.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 9be08e248dfc..2d2ad13e20bb 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -1222,6 +1222,24 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf100691)
CPPUNIT_ASSERT_EQUAL(u"Text\t1"_ustr, pNext->GetText());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf164620)
+{
+ createSwDoc("tdf164620.docx");
+
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+
+ dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
+
+ // Without the fix in place, this test would have crashed here
+ dispatchCommand(mxComponent, u".uno:Delete"_ustr, {});
+
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
+
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134404)
{
createSwDoc("tdf134404.odt");