Blob Blame History Raw
From c5aac6c349e0d227f5594005948012088045bf3f Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Thu, 19 Nov 2015 15:09:05 +0100
Subject: [PATCH 347/398] editeng lok: invalidate on scroll

E.g. when a Witer comment has long enough contents to get scrolled, the
desktop case repaints its contents by vcl::Window::Scroll(), followed by
a vcl::Window::Update(), i.e. vcl::Window::Invalidate() is not called.

The result of this in case of tiled rendering is that no tile is
repainted, so call vcl::Window::Invalidate() after scrolling manually.

A generic VCL-level invalidate-after-scroll is not wanted, as the
scrolling of the document contents and the main document window is not
in sync when tiled rendering.

(cherry picked from commit 162ae47a046b0c501e09d611a9834e875db884b8)

Change-Id: I74296a0f0e52c92cf3db6aefa73f28bb2b202871
---
 editeng/source/editeng/impedit.cxx | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 0207155e4d75..54ce4b06188f 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -47,6 +47,8 @@
 #include <sot/exchange.hxx>
 #include <sot/formats.hxx>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <comphelper/string.hxx>
+#include <comphelper/lok.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -1085,6 +1087,11 @@ Pair ImpEditView::Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck )
         aVisDocStartPos = pOutWin->PixelToLogic( aVisDocStartPos );
         Rectangle aRect( aOutArea );
         pOutWin->Scroll( nRealDiffX, nRealDiffY, aRect, SCROLL_CLIP );
+
+        if (comphelper::LibreOfficeKit::isActive())
+            // Need to invalidate the window, otherwise no tile will be re-painted.
+            pOutWin->Invalidate();
+
         pOutWin->Update();
         pCrsr->SetPos( pCrsr->GetPos() + Point( nRealDiffX, nRealDiffY ) );
         if ( bVisCursor )
-- 
2.12.0