diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/tiledrendering/tiledrendering.cxx | 11 | ||||
-rw-r--r-- | sc/source/ui/view/tabview5.cxx | 8 |
2 files changed, 16 insertions, 3 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 59700cfccc9c..2dd5dcfbb2cd 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -453,6 +453,7 @@ public: bool m_bFullInvalidateTiles; bool m_bInvalidateTiles; std::vector<tools::Rectangle> m_aInvalidations; + std::vector<int> m_aInvalidationsParts; bool m_bViewLock; OString m_sCellFormula; boost::property_tree::ptree m_aCommentCallbackResult; @@ -542,6 +543,8 @@ public: aInvalidationRect.setWidth(aSeq[2].toInt32()); aInvalidationRect.setHeight(aSeq[3].toInt32()); m_aInvalidations.push_back(aInvalidationRect); + if (aSeq.getLength() == 5) + m_aInvalidationsParts.push_back(aSeq[4].toInt32()); m_bInvalidateTiles = true; } } @@ -1696,12 +1699,16 @@ void ScTiledRenderingTest::testSheetChangeInvalidation() SfxLokHelper::setView(nView1); aView1.m_bInvalidateTiles = false; aView1.m_aInvalidations.clear(); + aView1.m_aInvalidationsParts.clear(); pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::PAGEDOWN | KEY_MOD1); pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEDOWN | KEY_MOD1); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT(aView1.m_bInvalidateTiles); - CPPUNIT_ASSERT_EQUAL(size_t(3), aView1.m_aInvalidations.size()); + CPPUNIT_ASSERT_EQUAL(size_t(2), aView1.m_aInvalidations.size()); CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1310720, 268435456), aView1.m_aInvalidations[0]); + CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1000000000, 1000000000), aView1.m_aInvalidations[1]); + CPPUNIT_ASSERT_EQUAL(size_t(1), aView1.m_aInvalidationsParts.size()); + CPPUNIT_ASSERT_EQUAL(pModelObj->getPart(), aView1.m_aInvalidationsParts[0]); } void ScTiledRenderingTest::testInsertDeletePageInvalidation() @@ -1729,7 +1736,7 @@ void ScTiledRenderingTest::testInsertDeletePageInvalidation() comphelper::dispatchCommand(".uno:Insert", aArgs); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT(aView1.m_bInvalidateTiles); - CPPUNIT_ASSERT_EQUAL(size_t(8), aView1.m_aInvalidations.size()); + CPPUNIT_ASSERT_EQUAL(size_t(6), aView1.m_aInvalidations.size()); CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1000000000, 1000000000), aView1.m_aInvalidations[0]); CPPUNIT_ASSERT_EQUAL(2, pModelObj->getParts()); diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx index 3ece4d760efb..9d611736f1bb 100644 --- a/sc/source/ui/view/tabview5.cxx +++ b/sc/source/ui/view/tabview5.cxx @@ -327,8 +327,14 @@ void ScTabView::TabChanged( bool bSameTabButMoved ) ss << aDocSize.Width() << ", " << aDocSize.Height(); OString sRect = ss.str().c_str(); ScTabViewShell* pViewShell = aViewData.GetViewShell(); + + // Invalidate first + tools::Rectangle aRectangle(0, 0, 1000000000, 1000000000); + OString sPayload = aRectangle.toString() + OString(", ") + OString::number(aViewData.GetTabNo()); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sPayload.getStr()); + ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(pViewShell->GetCurrentDocument()); - SfxLokHelper::notifyDocumentSizeChanged(pViewShell, sRect, pModel); + SfxLokHelper::notifyDocumentSizeChanged(pViewShell, sRect, pModel, false); } } } |