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 11:15:48 +0000 |
commit | 2cc717877527d0791cf879c3d9b38b967e0f094f (patch) | |
tree | 0027813d2eeb9c2741bbeaa3c708795ff726ae62 /editeng | |
parent | 171ad6702e3a2346ed18d352fdcc457fff0024ea (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/29740
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editview.cxx | 25 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 8 |
3 files changed, 26 insertions, 11 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index ba4c4c804270..c2cadb85d807 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -174,10 +174,10 @@ EditEngine* EditView::GetEditEngine() const return pImpEditView->pEditEngine; } -void EditView::Invalidate() +Rectangle EditView::GetInvalidateRect() const { if ( !pImpEditView->DoInvalidateMore() ) - pImpEditView->GetWindow()->Invalidate( pImpEditView->aOutArea ); + return pImpEditView->aOutArea; else { Rectangle aRect( pImpEditView->aOutArea ); @@ -186,10 +186,29 @@ void EditView::Invalidate() aRect.Right() += nMore; aRect.Top() -= nMore; aRect.Bottom() += nMore; - pImpEditView->GetWindow()->Invalidate( aRect ); + return aRect; + } +} + +void EditView::InvalidateOtherViewWindows( const Rectangle& rInvRect ) +{ + if (comphelper::LibreOfficeKit::isActive()) + { + for (auto& pWin: GetOtherViewWindows()) + { + if (pWin) + pWin->Invalidate( rInvRect ); + } } } +void EditView::Invalidate() +{ + const Rectangle& rInvRect = GetInvalidateRect(); + pImpEditView->GetWindow()->Invalidate( rInvRect ); + InvalidateOtherViewWindows( rInvRect ); +} + void EditView::SetReadOnly( bool bReadOnly ) { pImpEditView->bReadOnly = bReadOnly; diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 8e3b09343894..a4bea110f7ad 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -1150,8 +1150,10 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck ) pOutWin->Scroll( nRealDiffX, nRealDiffY, aRect, ScrollFlags::Clip ); if (comphelper::LibreOfficeKit::isActive()) + { // Need to invalidate the window, otherwise no tile will be re-painted. - pOutWin->Invalidate(); + pEditView->Invalidate(); + } pOutWin->Update(); pCrsr->SetPos( pCrsr->GetPos() + Point( nRealDiffX, nRealDiffY ) ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 908bf9fee19a..9bfaa3f74621 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -292,13 +292,7 @@ void ImpEditEngine::UpdateViews( EditView* pCurView ) // convert to window coordinates .... aClipRect = pView->pImpEditView->GetWindowPos( aClipRect ); pView->GetWindow()->Invalidate( aClipRect ); - - EditView::OutWindowSet& rOutWindowSet = pView->GetOtherViewWindows(); - for (auto pWin: rOutWindowSet) - { - if (pWin) - pWin->Invalidate(aClipRect); - } + pView->InvalidateOtherViewWindows( aClipRect ); } } |