f325b2
From c5aac6c349e0d227f5594005948012088045bf3f Mon Sep 17 00:00:00 2001
f325b2
From: Miklos Vajna <vmiklos@collabora.co.uk>
f325b2
Date: Thu, 19 Nov 2015 15:09:05 +0100
f325b2
Subject: [PATCH 347/398] editeng lok: invalidate on scroll
f325b2
f325b2
E.g. when a Witer comment has long enough contents to get scrolled, the
f325b2
desktop case repaints its contents by vcl::Window::Scroll(), followed by
f325b2
a vcl::Window::Update(), i.e. vcl::Window::Invalidate() is not called.
f325b2
f325b2
The result of this in case of tiled rendering is that no tile is
f325b2
repainted, so call vcl::Window::Invalidate() after scrolling manually.
f325b2
f325b2
A generic VCL-level invalidate-after-scroll is not wanted, as the
f325b2
scrolling of the document contents and the main document window is not
f325b2
in sync when tiled rendering.
f325b2
f325b2
(cherry picked from commit 162ae47a046b0c501e09d611a9834e875db884b8)
f325b2
f325b2
Change-Id: I74296a0f0e52c92cf3db6aefa73f28bb2b202871
f325b2
---
f325b2
 editeng/source/editeng/impedit.cxx | 7 +++++++
f325b2
 1 file changed, 7 insertions(+)
f325b2
f325b2
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
f325b2
index 0207155e4d75..54ce4b06188f 100644
f325b2
--- a/editeng/source/editeng/impedit.cxx
f325b2
+++ b/editeng/source/editeng/impedit.cxx
f325b2
@@ -47,6 +47,8 @@
f325b2
 #include <sot/exchange.hxx>
f325b2
 #include <sot/formats.hxx>
f325b2
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
f325b2
+#include <comphelper/string.hxx>
f325b2
+#include <comphelper/lok.hxx>
f325b2
 
f325b2
 using namespace ::com::sun::star;
f325b2
 using namespace ::com::sun::star::uno;
f325b2
@@ -1085,6 +1087,11 @@ Pair ImpEditView::Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck )
f325b2
         aVisDocStartPos = pOutWin->PixelToLogic( aVisDocStartPos );
f325b2
         Rectangle aRect( aOutArea );
f325b2
         pOutWin->Scroll( nRealDiffX, nRealDiffY, aRect, SCROLL_CLIP );
f325b2
+
f325b2
+        if (comphelper::LibreOfficeKit::isActive())
f325b2
+            // Need to invalidate the window, otherwise no tile will be re-painted.
f325b2
+            pOutWin->Invalidate();
f325b2
+
f325b2
         pOutWin->Update();
f325b2
         pCrsr->SetPos( pCrsr->GetPos() + Point( nRealDiffX, nRealDiffY ) );
f325b2
         if ( bVisCursor )
f325b2
-- 
f325b2
2.12.0
f325b2