summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-11-22 13:32:37 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-11-22 18:20:34 +0100
commit59e70256a358db136f5fd23651aea96d218b1a64 (patch)
tree0902e2d8bfd062674514edd79d819cdd1be971a8
parente29d89545eb4c714e6e7c82dbfb780097ee6745d (diff)
tdf#145207: sw_uiwriter3: Add unittest
Change-Id: I1a904f4261f80c2ce709a6e97767c9ba6a71b8f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125662 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sw/qa/extras/uiwriter/data/tdf145207.odtbin0 -> 14033 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx20
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf145207.odt b/sw/qa/extras/uiwriter/data/tdf145207.odt
new file mode 100644
index 000000000000..9e06862d777b
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf145207.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 72d3bfeb45c4..479bf9e990bf 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -2525,6 +2525,26 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf136385)
CPPUNIT_ASSERT_EQUAL(aPos.Y, xShape->getPosition().Y);
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145207)
+{
+ createSwDoc(DATA_DIRECTORY, "tdf145207.odt");
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+ CPPUNIT_ASSERT_EQUAL(3, getShapes());
+
+ //select one shape and use the TAB key to iterate over the different shapes
+ dispatchCommand(mxComponent, ".uno:JumpToNextFrame", {});
+ Scheduler::ProcessEventsToIdle();
+
+ for (sal_Int32 i = 0; i < 10; ++i)
+ {
+ // Without the fix in place, this test would have crashed here
+ pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_TAB);
+ Scheduler::ProcessEventsToIdle();
+ }
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf128782)
{
createSwDoc(DATA_DIRECTORY, "tdf128782.odt");