summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-29 16:53:59 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-29 15:43:32 +0000
commitb32b6c09d190effbe29389a87a80df36007d2e99 (patch)
tree5bbd0903cbf30cc3bb9004a024c0ae9b3a3b366e /sw/qa
parentc3399b0d4084d92879b1354bd05a9b891bd187a6 (diff)
sw lok: disable pixel alignment of cursor logic values
It just makes harder for a client to find out if the cursor of one view is at the same position as the cursor of an other view. Change-Id: Ifaebd1c93c45918c87f3c2c3d12bbb3af949184e Reviewed-on: https://gerrit.libreoffice.org/29393 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 47beefc70e54..82f5b11d139e 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -76,6 +76,7 @@ public:
void testCreateViewTextSelection();
void testRedlineColors();
void testCommentEndTextEdit();
+ void testCursorPosition();
CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
CPPUNIT_TEST(testRegisterCallback);
@@ -116,6 +117,7 @@ public:
CPPUNIT_TEST(testCreateViewTextSelection);
CPPUNIT_TEST(testRedlineColors);
CPPUNIT_TEST(testCommentEndTextEdit);
+ CPPUNIT_TEST(testCursorPosition);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1503,6 +1505,30 @@ void SwTiledRenderingTest::testCommentEndTextEdit()
comphelper::LibreOfficeKit::setActive(false);
}
+void SwTiledRenderingTest::testCursorPosition()
+{
+ // Load a document and register a callback, should get an own cursor.
+ comphelper::LibreOfficeKit::setActive();
+ SwXTextDocument* pXTextDocument = createDoc();
+ ViewCallback aView1;
+ SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView1);
+
+ // Crete a second view, so the first view gets a collaborative cursor.
+ SfxLokHelper::createView();
+ pXTextDocument->initializeForTiledRendering({});
+ ViewCallback aView2;
+ SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView2);
+
+ // Make sure the two are exactly the same.
+ // This failed, own cursor was at '1418, 1418', collaborative cursor was at
+ // '1425, 1425', due to pixel alignment.
+ CPPUNIT_ASSERT_EQUAL(aView1.m_aOwnCursor.toString(), aView1.m_aViewCursor.toString());
+
+ mxComponent->dispose();
+ mxComponent.clear();
+ comphelper::LibreOfficeKit::setActive(false);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest);
CPPUNIT_PLUGIN_IMPLEMENT();