summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-06-30 17:08:10 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-07-01 09:37:15 +0200
commitf70b001fb10861e542bca1e736a376016c7b8260 (patch)
treee47649a87db97870d804b477d98a3aeb94386a6b /sw
parent7df1884118a0d995ec57679ef83e586c95063858 (diff)
tdf#134404: sw: Add unittest
Change-Id: I81e46e06ad7964e52b45ce3433a25758cc7d19fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97534 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/uiwriter/data3/tdf134404.odtbin0 -> 9928 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx31
2 files changed, 31 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf134404.odt b/sw/qa/extras/uiwriter/data3/tdf134404.odt
new file mode 100644
index 000000000000..53875f13822a
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data3/tdf134404.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 43f181678833..db45c779d04e 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -56,6 +56,37 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382)
CPPUNIT_ASSERT_EQUAL(8, getShapes());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134404)
+{
+ load(DATA_DIRECTORY, "tdf134404.odt");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ dispatchCommand(mxComponent, ".uno:GoToEndOfPage", {});
+ Scheduler::ProcessEventsToIdle();
+ dispatchCommand(mxComponent, ".uno:InsertPagebreak", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+
+ dispatchCommand(mxComponent, ".uno:SwBackspace", {});
+ Scheduler::ProcessEventsToIdle();
+
+ // Without the fix in place, the image would have been deleted
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132321)
{
load(DATA_DIRECTORY, "tdf132321.odt");