diff options
author | Henry Castro <hcastro@collabora.com> | 2016-10-22 16:25:57 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2016-10-23 13:31:40 +0000 |
commit | 8dc495c93239739629683bb29e4110f5c57c94f0 (patch) | |
tree | 0ff49a1ee0cdbdddae04468011a48884cf19d5a2 /sc/qa | |
parent | e4cb0742c8f1ee68df180f16f9b4f0cbc69e1b9c (diff) |
sc lok: fix cell cursor when hide column/row
Change-Id: Icfa7debe06f6dfae3efcbd9d878d3b2d5aecf92f
Reviewed-on: https://gerrit.libreoffice.org/30169
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/tiledrendering/tiledrendering.cxx | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 83db147f15b3..9aa51155200a 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -67,6 +67,7 @@ public: void testTextEditViewInvalidations(); void testGraphicInvalidate(); void testAutoSum(); + void testHideColRow(); CPPUNIT_TEST_SUITE(ScTiledRenderingTest); CPPUNIT_TEST(testRowColumnSelections); @@ -85,6 +86,7 @@ public: CPPUNIT_TEST(testTextEditViewInvalidations); CPPUNIT_TEST(testGraphicInvalidate); CPPUNIT_TEST(testAutoSum); + CPPUNIT_TEST(testHideColRow); CPPUNIT_TEST_SUITE_END(); private: @@ -863,6 +865,78 @@ void ScTiledRenderingTest::testAutoSum() mxComponent.clear(); comphelper::LibreOfficeKit::setActive(false); } + +void ScTiledRenderingTest::testHideColRow() +{ + // Load a document + comphelper::LibreOfficeKit::setActive(); + createDoc("small.ods"); + { + uno::Sequence<beans::PropertyValue> aArgs(2); + + aArgs[0].Name = OUString::fromUtf8("Col"); + aArgs[0].Value <<= static_cast<sal_Int32>(2 - 1); + aArgs[1].Name = OUString::fromUtf8("Modifier"); + aArgs[1].Value <<= static_cast<sal_uInt16>(KEY_SHIFT); + + comphelper::dispatchCommand(".uno:SelectColumn", aArgs); + + aArgs[0].Name = OUString::fromUtf8("Col"); + aArgs[0].Value <<= static_cast<sal_Int32>(3 - 1); + aArgs[1].Name = OUString::fromUtf8("Modifier"); + aArgs[1].Value <<= static_cast<sal_uInt16>(0); + + comphelper::dispatchCommand(".uno:SelectColumn", aArgs); + Scheduler::ProcessEventsToIdle(); + } + + SCCOL nOldCurX = ScDocShell::GetViewData()->GetCurX(); + SCROW nOldCurY = ScDocShell::GetViewData()->GetCurY(); + { + uno::Sequence<beans::PropertyValue> aArgs; + comphelper::dispatchCommand(".uno:HideColumn", aArgs); + Scheduler::ProcessEventsToIdle(); + } + + SCCOL nNewCurX = ScDocShell::GetViewData()->GetCurX(); + SCROW nNewCurY = ScDocShell::GetViewData()->GetCurY(); + CPPUNIT_ASSERT(nNewCurX > nOldCurX); + CPPUNIT_ASSERT_EQUAL(nOldCurY, nNewCurY); + { + uno::Sequence<beans::PropertyValue> aArgs(2); + + aArgs[0].Name = OUString::fromUtf8("Row"); + aArgs[0].Value <<= static_cast<sal_Int32>(6 - 1); + aArgs[1].Name = OUString::fromUtf8("Modifier"); + aArgs[1].Value <<= static_cast<sal_uInt16>(KEY_SHIFT); + + comphelper::dispatchCommand(".uno:SelectRow", aArgs); + + aArgs[0].Name = OUString::fromUtf8("Row"); + aArgs[0].Value <<= static_cast<sal_Int32>(7 - 1); + aArgs[1].Name = OUString::fromUtf8("Modifier"); + aArgs[1].Value <<= static_cast<sal_uInt16>(0); + + comphelper::dispatchCommand(".uno:SelectRow", aArgs); + Scheduler::ProcessEventsToIdle(); + } + + nOldCurX = ScDocShell::GetViewData()->GetCurX(); + nOldCurY = ScDocShell::GetViewData()->GetCurY(); + { + uno::Sequence<beans::PropertyValue> aArgs; + comphelper::dispatchCommand(".uno:HideRow", aArgs); + Scheduler::ProcessEventsToIdle(); + } + nNewCurX = ScDocShell::GetViewData()->GetCurX(); + nNewCurY = ScDocShell::GetViewData()->GetCurY(); + CPPUNIT_ASSERT(nNewCurY > nOldCurY); + CPPUNIT_ASSERT_EQUAL(nOldCurX, nNewCurX); + + mxComponent->dispose(); + mxComponent.clear(); + comphelper::LibreOfficeKit::setActive(false); +} } CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest); |