Kaydet (Commit) 87c67a4a authored tarafından Marco Cecchetti's avatar Marco Cecchetti Kaydeden (comit) Marco Cecchetti

LOK - Calc: unit test for invalidation on copy/paste to the doc bottom

Change-Id: I92b6a3f1c3b3c6c260b25b046bd19b249be0db0b
Reviewed-on: https://gerrit.libreoffice.org/30977Reviewed-by: 's avatarMarco Cecchetti <mrcekets@gmail.com>
Tested-by: 's avatarMarco Cecchetti <mrcekets@gmail.com>
üst 580c2072
...@@ -68,6 +68,7 @@ public: ...@@ -68,6 +68,7 @@ public:
void testGraphicInvalidate(); void testGraphicInvalidate();
void testAutoSum(); void testAutoSum();
void testHideColRow(); void testHideColRow();
void testInvalidateOnCopyPasteCells();
CPPUNIT_TEST_SUITE(ScTiledRenderingTest); CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
CPPUNIT_TEST(testRowColumnSelections); CPPUNIT_TEST(testRowColumnSelections);
...@@ -87,6 +88,7 @@ public: ...@@ -87,6 +88,7 @@ public:
CPPUNIT_TEST(testGraphicInvalidate); CPPUNIT_TEST(testGraphicInvalidate);
CPPUNIT_TEST(testAutoSum); CPPUNIT_TEST(testAutoSum);
CPPUNIT_TEST(testHideColRow); CPPUNIT_TEST(testHideColRow);
CPPUNIT_TEST(testInvalidateOnCopyPasteCells);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -937,6 +939,48 @@ void ScTiledRenderingTest::testHideColRow() ...@@ -937,6 +939,48 @@ void ScTiledRenderingTest::testHideColRow()
mxComponent.clear(); mxComponent.clear();
comphelper::LibreOfficeKit::setActive(false); comphelper::LibreOfficeKit::setActive(false);
} }
void ScTiledRenderingTest::testInvalidateOnCopyPasteCells()
{
// Load a document
comphelper::LibreOfficeKit::setActive();
ScModelObj* pModelObj = createDoc("small.ods");
CPPUNIT_ASSERT(pModelObj);
// view
ViewCallback aView;
SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView);
aView.m_bInvalidateTiles = false;
uno::Sequence<beans::PropertyValue> aArgs;
// select and copy cells
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_HOME | KEY_MOD1);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_HOME | KEY_MOD1);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN | KEY_SHIFT);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DOWN | KEY_SHIFT);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RIGHT | KEY_SHIFT);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RIGHT | KEY_SHIFT);
Scheduler::ProcessEventsToIdle();
comphelper::dispatchCommand(".uno:Copy", aArgs);
// move to destination cell
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DOWN);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN | KEY_MOD1);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DOWN | KEY_MOD1);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_UP);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_UP);
Scheduler::ProcessEventsToIdle();
// paste cells
aView.m_bInvalidateTiles = false;
comphelper::dispatchCommand(".uno:Paste", aArgs);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
mxComponent->dispose();
mxComponent.clear();
comphelper::LibreOfficeKit::setActive(false);
}
} }
CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest); CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment