summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-07-06 12:02:56 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-07-06 23:05:07 +0200
commit656fd1ec9123de5dbeecb8db4de5254b05c21e76 (patch)
tree33b3434d65c8c9378bb4e8cab757c3b8889f863c /sw
parent72e4674aad60d17aef66020dd9ca6ec778508ac2 (diff)
tdf#134253: sw: Add unittest
Change-Id: Icd930f9c632a5c44d4391ca065afbc4db166ae37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98200 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/uiwriter/data3/tdf134253.odtbin0 -> 46144 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx29
2 files changed, 29 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf134253.odt b/sw/qa/extras/uiwriter/data3/tdf134253.odt
new file mode 100644
index 000000000000..234b0bdca7ff
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data3/tdf134253.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index d7f20d6bd21a..d191f6e4d453 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -310,6 +310,35 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133982)
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134253)
+{
+ load(DATA_DIRECTORY, "tdf134253.odt");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(),
+ uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
+ CPPUNIT_ASSERT_EQUAL(6, getPages());
+
+ //Use selectAll 3 times in a row
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+
+ dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+
+ //Without the fix in place, it would have crashed here
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
+ CPPUNIT_ASSERT_EQUAL(6, getPages());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf76636)
{
load(DATA_DIRECTORY, "tdf76636.doc");