sw/qa/extras/uiwriter/data/tdf145207.odt |binary
 sw/qa/extras/uiwriter/uiwriter3.cxx      |   20 ++++++++++++++++++++
 2 files changed, 20 insertions(+)

New commits:
commit 59e70256a358db136f5fd23651aea96d218b1a64
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Nov 22 13:32:37 2021 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Nov 22 18:20:34 2021 +0100

    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 <xiscofa...@libreoffice.org>

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
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf145207.odt 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");

Reply via email to