From 7c70afbcc2a2aea243caf6ddac606c15a06fc5f9 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 26 Jul 2023 08:45:29 +0200 Subject: improve override of Window::Invalidate(*) rather than having to override 3 different methods, have them override the ImplInvalidate, which is where the code ends up anywhere. This already exposes a couple of places that were not overriding all 3 methods. Change-Id: If76abcf18325b7138ea451fbd0213cd6c7b4daa5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154930 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svtools/source/brwbox/datwin.cxx | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'svtools/source') diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx index e3fd46bf1ecb..d0144a9d4f7c 100644 --- a/svtools/source/brwbox/datwin.cxx +++ b/svtools/source/brwbox/datwin.cxx @@ -628,28 +628,25 @@ void BrowserDataWin::SetUpdateMode( bool bMode ) void BrowserDataWin::DoOutstandingInvalidations() { for (const auto& rRect : aInvalidRegion) - Control::Invalidate( rRect ); + { + vcl::Region aRegion(rRect); + Control::ImplInvalidate( &aRegion, InvalidateFlags::NONE ); + } aInvalidRegion.clear(); } -void BrowserDataWin::Invalidate( InvalidateFlags nFlags ) +void BrowserDataWin::ImplInvalidate( const vcl::Region* pRegion, InvalidateFlags nFlags ) { if ( !GetUpdateMode() ) { aInvalidRegion.clear(); - aInvalidRegion.emplace_back( Point( 0, 0 ), GetOutputSizePixel() ); + if (!pRegion) + aInvalidRegion.emplace_back( Point( 0, 0 ), GetOutputSizePixel() ); + else + aInvalidRegion.emplace_back( pRegion->GetBoundRect() ); } else - Window::Invalidate( nFlags ); -} - - -void BrowserDataWin::Invalidate( const tools::Rectangle& rRect, InvalidateFlags nFlags ) -{ - if ( !GetUpdateMode() ) - aInvalidRegion.emplace_back( rRect ); - else - Window::Invalidate( rRect, nFlags ); + Window::ImplInvalidate( pRegion, nFlags ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit