summaryrefslogtreecommitdiffstats
path: root/sw/qa/extras/tiledrendering
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2018-01-24 18:41:33 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2018-01-25 08:33:59 +0100
commitb4c0621134d24080479b7f11e07cbb2ea3d80769 (patch)
tree177f171c2d9af42dcd82729639b4c4890850d470 /sw/qa/extras/tiledrendering
parentloplugin:pointerbool (clang-cl) (diff)
downloadcore-b4c0621134d24080479b7f11e07cbb2ea3d80769.tar.gz
core-b4c0621134d24080479b7f11e07cbb2ea3d80769.zip
Test for tdf#115088.
Change-Id: I27c97d174089c6567e38899522603d4a39d8ad40 Reviewed-on: https://gerrit.libreoffice.org/48540 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw/qa/extras/tiledrendering')
-rw-r--r--sw/qa/extras/tiledrendering/data/tdf115088.odtbin0 -> 8108 bytes
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx37
2 files changed, 37 insertions, 0 deletions
diff --git a/sw/qa/extras/tiledrendering/data/tdf115088.odt b/sw/qa/extras/tiledrendering/data/tdf115088.odt
new file mode 100644
index 000000000000..b29681eb8ef1
--- /dev/null
+++ b/sw/qa/extras/tiledrendering/data/tdf115088.odt
Binary files differ
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 5a90230be574..62a70ea74d11 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -99,6 +99,7 @@ public:
void testDocumentRepair();
void testPageHeader();
void testPageFooter();
+ void testTdf115088();
CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
CPPUNIT_TEST(testRegisterCallback);
@@ -148,6 +149,7 @@ public:
CPPUNIT_TEST(testDocumentRepair);
CPPUNIT_TEST(testPageHeader);
CPPUNIT_TEST(testPageFooter);
+ CPPUNIT_TEST(testTdf115088);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2024,6 +2026,41 @@ void SwTiledRenderingTest::testPageFooter()
comphelper::LibreOfficeKit::setActive(false);
}
+void SwTiledRenderingTest::testTdf115088()
+{
+ comphelper::LibreOfficeKit::setActive();
+
+ // We have three lines in the test document and we try to copy the second and third line
+ // To the beginning of the document
+ SwXTextDocument* pXTextDocument = createDoc("tdf115088.odt");
+
+ // Select and copy second and third line
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_HOME | KEY_MOD1);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_HOME | KEY_MOD1);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DOWN);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN | KEY_SHIFT);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DOWN | KEY_SHIFT);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RIGHT | KEY_SHIFT);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RIGHT | KEY_SHIFT);
+ Scheduler::ProcessEventsToIdle();
+ comphelper::dispatchCommand(".uno:Copy", uno::Sequence<beans::PropertyValue>());
+
+ // Move cursor to the begining of the first line and paste
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_HOME | KEY_MOD1);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_HOME | KEY_MOD1);
+ Scheduler::ProcessEventsToIdle();
+ comphelper::dispatchCommand(".uno:PasteUnformatted", uno::Sequence<beans::PropertyValue>());
+ Scheduler::ProcessEventsToIdle();
+
+ // Check the resulting text in the document. (it was 1text\n1\1)
+ CPPUNIT_ASSERT_EQUAL(OUString("1\n1Text\n1\n1"), pXTextDocument->getText()->getString());
+
+ mxComponent->dispose();
+ mxComponent.clear();
+ comphelper::LibreOfficeKit::setActive(false);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest);
CPPUNIT_PLUGIN_IMPLEMENT();