diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-26 08:45:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-26 19:09:18 +0200 |
commit | 7c70afbcc2a2aea243caf6ddac606c15a06fc5f9 (patch) | |
tree | 46fe9dc8b2ce7aad9f25c9ffd762e7beff4a4ae6 /svtools/source/brwbox | |
parent | 70f84abd6379c47db96d81d4b028041daa8c5d24 (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source/brwbox')
-rw-r--r-- | svtools/source/brwbox/datwin.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
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: */ |