diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2016-10-11 22:50:53 +0200 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2016-10-14 15:07:56 +0000 |
commit | d4ddc8cb005887e4b2810006425cccf12937347f (patch) | |
tree | a2def9f4d5e4d89eef1b4e099557be6245c2763c /sc/source/ui/view/tabview3.cxx | |
parent | cec94a4ecaad666f7222598fd1e2ad9ac05fb878 (diff) |
LOK: Calc: fixed missed tile invalidations on cell text editing
What's new:
1) when an edit view is killed, the area which was used by the edit
view is invalidated for both own window and other view windows after
the edit view has been destroyed;
2) when an edit view is created or its out area is expanded, the
windows of other views are invalidated too;
3) when a vertical scroll occurs in the edit view area the windows of
other view are invalidated too;
4) same methods renaming since now we add/remove windows not edit
views.
Change-Id: Iac54f5b182c9562f08bb724f9ddde1c26cffa2e7
Reviewed-on: https://gerrit.libreoffice.org/29783
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'sc/source/ui/view/tabview3.cxx')
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 06ef0b9dff9f..6c387bfa70cf 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -1941,12 +1941,12 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSa } } -void ScTabView::AddEditViewToOtherView(SfxViewShell* pViewShell, ScSplitPos eWhich) +void ScTabView::AddWindowToForeignEditView(SfxViewShell* pViewShell, ScSplitPos eWhich) { aExtraEditViewManager.Add(pViewShell, eWhich); } -void ScTabView::RemoveEditViewFromOtherView(SfxViewShell* pViewShell, ScSplitPos eWhich) +void ScTabView::RemoveWindowFromForeignEditView(SfxViewShell* pViewShell, ScSplitPos eWhich) { aExtraEditViewManager.Remove(pViewShell, eWhich); } @@ -1968,7 +1968,7 @@ void ScTabView::OnLibreOfficeKitTabChanged() { if (rOtherViewData.HasEditView( (ScSplitPos)(i))) { - pThisViewShell->AddEditViewToOtherView(pOtherViewShell, (ScSplitPos)(i)); + pThisViewShell->AddWindowToForeignEditView(pOtherViewShell, (ScSplitPos)(i)); } } } @@ -1978,7 +1978,7 @@ void ScTabView::OnLibreOfficeKitTabChanged() { if (rOtherViewData.HasEditView( (ScSplitPos)(i))) { - pThisViewShell->RemoveEditViewFromOtherView(pOtherViewShell, (ScSplitPos)(i)); + pThisViewShell->RemoveWindowFromForeignEditView(pOtherViewShell, (ScSplitPos)(i)); } } } @@ -2070,6 +2070,7 @@ void ScTabView::KillEditView( bool bNoPaint ) SCROW nRow2 = aViewData.GetEditEndRow(); bool bPaint[4]; bool bNotifyAcc = false; + Rectangle aRectangle[4]; bool bExtended = nRow1 != nRow2; // column is painted to the end anyway @@ -2080,7 +2081,12 @@ void ScTabView::KillEditView( bool bNoPaint ) { bPaint[i] = aViewData.HasEditView( (ScSplitPos) i ); if (bPaint[i]) + { bNotifyAcc = true; + + EditView* pView = aViewData.GetEditView( (ScSplitPos) i ); + aRectangle[i] = pView->GetInvalidateRect(); + } } // #108931#; notify accessibility before all things happen @@ -2096,8 +2102,26 @@ void ScTabView::KillEditView( bool bNoPaint ) pGridWin[i]->SetMapMode(pGridWin[i]->GetDrawMapMode()); + if (comphelper::LibreOfficeKit::isActive()) + { + const Rectangle& rInvRect = aRectangle[i]; + pGridWin[i]->Invalidate(rInvRect); + + // invalidate other views + auto lInvalidateWindows = + [&rInvRect] (ScTabView* pTabView) + { + for (ScGridWindow* pWin: pTabView->pGridWin) + { + if (pWin) + pWin->Invalidate(rInvRect); + } + }; + + SfxLokHelper::forEachOtherView(GetViewData().GetViewShell(), lInvalidateWindows); + } // #i73567# the cell still has to be repainted - if (bExtended || ( bAtCursor && !bNoPaint )) + else if (bExtended || ( bAtCursor && !bNoPaint )) { pGridWin[i]->Draw( nCol1, nRow1, nCol2, nRow2, SC_UPDATE_ALL ); pGridWin[i]->UpdateSelectionOverlay(); |