summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2016-10-11 22:50:53 +0200
committerMarco Cecchetti <mrcekets@gmail.com>2016-10-14 15:07:56 +0000
commitd4ddc8cb005887e4b2810006425cccf12937347f (patch)
treea2def9f4d5e4d89eef1b4e099557be6245c2763c /editeng
parentcec94a4ecaad666f7222598fd1e2ad9ac05fb878 (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 'editeng')
-rw-r--r--editeng/source/editeng/editview.cxx25
-rw-r--r--editeng/source/editeng/impedit.cxx4
-rw-r--r--editeng/source/editeng/impedit3.cxx8
3 files changed, 26 insertions, 11 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 63b7b30c57cc..3ada3d3fb264 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -173,10 +173,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 );
@@ -185,10 +185,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 7426862afabd..f23bd81943e5 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 7d30eda43478..1d62eba9c4ed 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -289,13 +289,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 );
}
}