From 3604738373198feb4c1c7a9ef82b6ea1579265d8 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Fri, 24 Sep 2021 11:47:30 +0200 Subject: optimize out a bit of Invalidate() in LOK mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3c076e2506c9cade7e6bb874a2cddfa1ef0db6a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122641 Tested-by: Jenkins CollaboraOffice Reviewed-by: Luboš Luňák --- vcl/source/window/paint.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index c7c3b7544937..8531ead70012 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -1202,8 +1202,11 @@ void Window::Invalidate( const tools::Rectangle& rRect, InvalidateFlags nFlags ) tools::Rectangle aRect = pOutDev->ImplLogicToDevicePixel( rRect ); if ( !aRect.IsEmpty() ) { - vcl::Region aRegion( aRect ); - ImplInvalidate( &aRegion, nFlags ); + if (!comphelper::LibreOfficeKit::isActive()) + { // ImplInvalidate() immediatelly returns in LOK mode, skip useless Region construction + vcl::Region aRegion( aRect ); + ImplInvalidate( &aRegion, nFlags ); + } tools::Rectangle aLogicRectangle(rRect); LogicInvalidate(&aLogicRectangle); } -- cgit v1.2.3