summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2016-09-28 12:20:10 +0200
committerMarco Cecchetti <mrcekets@gmail.com>2016-10-03 12:13:15 +0000
commit8ef20328866320cba9267027ea7284f8ec7edccf (patch)
treea5b8d1a16d2b5c991d17c7ca365f5e6d1cdc8a3c /sc/qa
parentcae57d2e588a4b5a104171e022b00abcc1605775 (diff)
Calc: implemented parallel cell text editing
Change-Id: If8cc7a637cee6ba66813d55b25160fee13a2a219 Reviewed-on: https://gerrit.libreoffice.org/29410 Reviewed-by: Marco Cecchetti <mrcekets@gmail.com> Tested-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx58
1 files changed, 58 insertions, 0 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index a39db6ea2206..83c56d13ce3f 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -64,6 +64,7 @@ public:
void testUndoShells();
void testCreateViewGraphicSelection();
void testTextEditViews();
+ void testTextEditViewInvalidations();
void testGraphicInvalidate();
CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
@@ -80,6 +81,7 @@ public:
CPPUNIT_TEST(testUndoShells);
CPPUNIT_TEST(testCreateViewGraphicSelection);
CPPUNIT_TEST(testTextEditViews);
+ CPPUNIT_TEST(testTextEditViewInvalidations);
CPPUNIT_TEST(testGraphicInvalidate);
CPPUNIT_TEST_SUITE_END();
@@ -386,6 +388,7 @@ public:
bool m_bGraphicSelection;
bool m_bGraphicViewSelection;
bool m_bFullInvalidateTiles;
+ bool m_bInvalidateTiles;
bool m_bViewLock;
ViewCallback()
@@ -395,6 +398,7 @@ public:
m_bGraphicSelection(false),
m_bGraphicViewSelection(false),
m_bFullInvalidateTiles(false),
+ m_bInvalidateTiles(false),
m_bViewLock(false)
{
}
@@ -448,6 +452,10 @@ public:
{
m_bFullInvalidateTiles = true;
}
+ else
+ {
+ m_bInvalidateTiles = true;
+ }
}
}
}
@@ -692,6 +700,56 @@ void ScTiledRenderingTest::testTextEditViews()
comphelper::LibreOfficeKit::setActive(false);
}
+void ScTiledRenderingTest::testTextEditViewInvalidations()
+{
+ comphelper::LibreOfficeKit::setActive();
+
+ ScModelObj* pModelObj = createDoc("small.ods");
+ CPPUNIT_ASSERT(pModelObj);
+ ScViewData* pViewData = ScDocShell::GetViewData();
+ CPPUNIT_ASSERT(pViewData);
+
+ // view #1
+ ViewCallback aView1;
+ int nView1 = SfxLokHelper::getView();
+ SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView1);
+ CPPUNIT_ASSERT(!lcl_hasEditView(*pViewData));
+
+ // view #2
+ SfxLokHelper::createView();
+ ViewCallback aView2;
+ pModelObj->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
+ SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView2);
+
+ // text edit a cell in view #1
+ SfxLokHelper::setView(nView1);
+ aView2.m_bInvalidateTiles = false;
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 'x', 0);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(lcl_hasEditView(*pViewData));
+ CPPUNIT_ASSERT(aView2.m_bInvalidateTiles);
+
+ // view #3
+ SfxLokHelper::createView();
+ ViewCallback aView3;
+ pModelObj->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
+ SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView3);
+
+ // text edit a cell in view #1
+ SfxLokHelper::setView(nView1);
+ aView3.m_bInvalidateTiles = false;
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'y', 0);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 'y', 0);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(aView3.m_bInvalidateTiles);
+
+ mxComponent->dispose();
+ mxComponent.clear();
+
+ comphelper::LibreOfficeKit::setActive(false);
+}
+
void ScTiledRenderingTest::testCreateViewGraphicSelection()
{
// Load a document