sc/qa/unit/tiledrendering/tiledrendering.cxx | 50 ++++++++++++++++++++++++++- sc/source/ui/view/tabview3.cxx | 39 ++++++++------------- sd/qa/unit/import-tests.cxx | 2 - 3 files changed, 66 insertions(+), 25 deletions(-)
New commits: commit 3ec47ebbbb8fa8c354d5274c526698e89aca7ec5 Author: Marco Cecchetti <[email protected]> Date: Fri Nov 18 18:24:29 2016 +0100 Fixed build error in unit test for tdf#103876 Change-Id: I7b1be7d1318385ad57d6fcda828ea61ccba65881 diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 208c627..f8af062 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -1258,7 +1258,7 @@ void SdImportTest::testTdf103792() void SdImportTest::testTdf103876() { // Title text shape's placeholder text did not inherit the corresponding text properties - sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf103876.pptx"), PPTX); + sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/tdf103876.pptx"), PPTX); uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); // Check paragraph alignment commit 2f9f7383281a9848f27b6e0b321cbe103bb57eed Author: Marco Cecchetti <[email protected]> Date: Fri Nov 18 17:58:26 2016 +0100 LOK - Calc: unit test for invalidation on row insert Change-Id: I999bcef29b90fafcd803243a967fcb8109e61db8 diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 5547b71..74a08a3 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -68,6 +68,7 @@ public: void testAutoSum(); void testHideColRow(); void testInvalidateOnCopyPasteCells(); + void testInvalidateOnInserRowCol(); CPPUNIT_TEST_SUITE(ScTiledRenderingTest); CPPUNIT_TEST(testRowColumnSelections); @@ -87,6 +88,7 @@ public: CPPUNIT_TEST(testAutoSum); CPPUNIT_TEST(testHideColRow); CPPUNIT_TEST(testInvalidateOnCopyPasteCells); + CPPUNIT_TEST(testInvalidateOnInserRowCol); CPPUNIT_TEST_SUITE_END(); private: @@ -916,6 +918,7 @@ void ScTiledRenderingTest::testHideColRow() mxComponent.clear(); comphelper::LibreOfficeKit::setActive(false); } + void ScTiledRenderingTest::testInvalidateOnCopyPasteCells() { // Load a document @@ -927,7 +930,6 @@ void ScTiledRenderingTest::testInvalidateOnCopyPasteCells() 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); @@ -958,6 +960,52 @@ void ScTiledRenderingTest::testInvalidateOnCopyPasteCells() mxComponent.clear(); comphelper::LibreOfficeKit::setActive(false); } + +void ScTiledRenderingTest::testInvalidateOnInserRowCol() +{ + // Load a document + comphelper::LibreOfficeKit::setActive(); + ScModelObj* pModelObj = createDoc("small.ods"); + CPPUNIT_ASSERT(pModelObj); + + // view + ViewCallback aView; + SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView); + + uno::Sequence<beans::PropertyValue> aArgs; + // move downward + for (int i = 0; i < 200; ++i) + { + pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN); + pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DOWN); + } + Scheduler::ProcessEventsToIdle(); + + // insert row + aView.m_bInvalidateTiles = false; + comphelper::dispatchCommand(".uno:InsertRows", aArgs); + Scheduler::ProcessEventsToIdle(); + CPPUNIT_ASSERT(aView.m_bInvalidateTiles); + + // move on the right + for (int i = 0; i < 200; ++i) + { + pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RIGHT); + pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RIGHT); + } + Scheduler::ProcessEventsToIdle(); + + // insert column + aView.m_bInvalidateTiles = false; + comphelper::dispatchCommand(".uno:InsertColumns", aArgs); + Scheduler::ProcessEventsToIdle(); + CPPUNIT_ASSERT(aView.m_bInvalidateTiles); + + mxComponent->dispose(); + mxComponent.clear(); + comphelper::LibreOfficeKit::setActive(false); +} + } CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest); commit 88e68a88533faa9061cd3fc48015456fb99f6664 Author: Marco Cecchetti <[email protected]> Date: Fri Nov 18 17:23:17 2016 +0100 LOK - Calc: use GetMaxTiledCol/GetMaxTiledRow instead of GetPrintArea By using GetPrintArea, there is no tile invalidation when a row is inserted or resized below any text content. Change-Id: I5269a7186eafac977cc557fcf04f29b53bba999b diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index e9259a5..e3f5f75 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -2193,21 +2193,13 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO nCol2 = nEndCol; nRow2 = nEndRow; + SCCOL nLastX = 0; + SCROW nLastY = 0; + if (comphelper::LibreOfficeKit::isActive()) { - SCCOL nLastX = 0; - SCROW nLastY = 0; - SCTAB nTab = aViewData.GetTabNo(); - ScDocument& rDoc = aViewData.GetDocShell()->GetDocument(); - if (rDoc.GetPrintArea(nTab, nLastX, nLastY, false)) - { - nCol2 = nLastX; - nRow2 = nLastY; - } - - if (nCol2 > MAXCOL) nCol2 = MAXCOL; - if (nRow2 > MAXROW) nRow2 = MAXROW; - bOut = nCol1 > nCol2 || nRow1 > nRow2; + nLastX = aViewData.GetMaxTiledCol(); + nLastY = aViewData.GetMaxTiledRow(); } else { @@ -2229,18 +2221,19 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO if (nRow2 < nScrY) bOut = true; - SCCOL nLastX = nScrX + aViewData.VisibleCellsX( eHWhich ) + 1; - SCROW nLastY = nScrY + aViewData.VisibleCellsY( eVWhich ) + 1; - if (nCol1 > nLastX) - bOut = true; - if (nCol2 > nLastX) - nCol2 = nLastX; - if (nRow1 > nLastY) - bOut = true; - if (nRow2 > nLastY) - nRow2 = nLastY; + nLastX = nScrX + aViewData.VisibleCellsX( eHWhich ) + 1; + nLastY = nScrY + aViewData.VisibleCellsY( eVWhich ) + 1; } + if (nCol1 > nLastX) + bOut = true; + if (nCol2 > nLastX) + nCol2 = nLastX; + if (nRow1 > nLastY) + bOut = true; + if (nRow2 > nLastY) + nRow2 = nLastY; + if (bOut) continue; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
