diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-12 13:55:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-11 17:56:01 +0200 |
commit | be53f32655973c7a18824d5145eed992be788d2f (patch) | |
tree | 5ace1cd4952594b86485ecce44ea07550d78810c /vcl | |
parent | 88629b55041b9e7ff5c94afeb2aae725a5898687 (diff) |
rename vcl::Window::Update to PaintImmediately
To make the code easier to read.
Change-Id: Iebc648150391939fba5d1cd815c72dbcf02ceec6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90378
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/help.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/imivctl1.cxx | 10 | ||||
-rw-r--r-- | vcl/source/control/imp_listbox.cxx | 8 | ||||
-rw-r--r-- | vcl/source/control/scrbar.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/slider.cxx | 6 | ||||
-rw-r--r-- | vcl/source/edit/textview.cxx | 4 | ||||
-rw-r--r-- | vcl/source/treelist/iconviewimpl.cxx | 16 | ||||
-rw-r--r-- | vcl/source/treelist/svimpbox.cxx | 34 | ||||
-rw-r--r-- | vcl/source/treelist/treelistbox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/menufloatingwindow.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/paint.cxx | 10 | ||||
-rw-r--r-- | vcl/source/window/split.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/splitwin.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/winproc.cxx | 2 | ||||
-rw-r--r-- | vcl/workben/vcldemo.cxx | 2 |
18 files changed, 58 insertions, 60 deletions
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index b5a7cb4cc057..54f0dbbfb4d3 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -369,7 +369,7 @@ void HelpTextWindow::ImplShow() VclPtr<HelpTextWindow> xWindow( this ); Show( true, ShowFlags::NoActivate ); if( !xWindow->IsDisposed() ) - Update(); + PaintImmediately(); } void HelpTextWindow::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 43636df0f94a..b16fc3d9c46c 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -3315,7 +3315,7 @@ void CheckBox::GetFocus() Invalidate(); // Trigger drawing to initialize the mouse rectangle, otherwise the mouse button down // handler would ignore the mouse event. - Update(); + PaintImmediately(); } else ShowFocus( ImplGetFocusRect() ); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 49ae5be42405..d177eb1fb7bc 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -441,7 +441,7 @@ void Edit::ImplInvalidateOrRepaint() Invalidate(); // FIXME: this is currently only on macOS if( ImplGetSVData()->maNWFData.mbNoFocusRects ) - Update(); + PaintImmediately(); } else Invalidate(); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 9a762d64fbeb..4efb7596abbb 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1857,7 +1857,7 @@ void SvxIconChoiceCtrl_Impl::ShowCursor( bool bShow ) void SvxIconChoiceCtrl_Impl::HideDDIcon() { - pView->Update(); + pView->PaintImmediately(); } bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) @@ -2025,7 +2025,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const tools::Rectangle& rRect, bool bS if( GetUpdateMode() ) { HideDDIcon(); - pView->Update(); + pView->PaintImmediately(); ShowCursor( false ); } @@ -2063,7 +2063,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const tools::Rectangle& rRect, bool bS // check if we still need scrollbars CheckScrollBars(); if( bScrollable && GetUpdateMode() ) - pView->Update(); + pView->PaintImmediately(); // If the requested area can not be made completely visible, the // Vis-Rect-Changed handler is called in any case. This case may occur e.g. @@ -2301,7 +2301,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const tools::Rectangle& rRect, bool bAd nFlags |= IconChoiceFlags::SelectingRect; CheckBoundingRects(); - pView->Update(); + pView->PaintImmediately(); const size_t nCount = maZOrderList.size(); tools::Rectangle aRect( rRect ); @@ -2381,7 +2381,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const tools::Rectangle& rRect, bool bAd if( !bAlreadySelectingRect ) nFlags &= ~IconChoiceFlags::SelectingRect; - pView->Update(); + pView->PaintImmediately(); if( bResetClipRegion ) pView->SetClipRegion(); } diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 0ef0b31b9e45..52fe1dc48132 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -1976,11 +1976,11 @@ void ImplListBoxWindow::SetTopEntry( sal_Int32 nTop ) { ImplClearLayoutData(); long nDiff = mpEntryList->GetAddedHeight( mnTop, nTop ); - Update(); + PaintImmediately(); ImplHideFocusRect(); mnTop = nTop; Scroll( 0, nDiff ); - Update(); + PaintImmediately(); if( HasFocus() ) ImplShowFocusRect(); maScrollHdl.Call( this ); @@ -2019,10 +2019,10 @@ void ImplListBoxWindow::ScrollHorz( long n ) { ImplClearLayoutData(); mnLeft = sal::static_int_cast<sal_uInt16>(mnLeft + nDiff); - Update(); + PaintImmediately(); ImplHideFocusRect(); Scroll( -nDiff, 0 ); - Update(); + PaintImmediately(); if( HasFocus() ) ImplShowFocusRect(); maScrollHdl.Call( this ); diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 221664f7d9ae..e0a11cf877b6 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -817,7 +817,7 @@ void ScrollBar::ImplDragThumb( const Point& rMousePos ) if (SupportsDoubleBuffering()) { Invalidate(); - Update(); + PaintImmediately(); } else ImplDraw(*this); diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index aec48bc32176..0fdc49441bbb 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -654,7 +654,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt ) // store Start position for cancel and EndScroll delta mnStartPos = mnThumbPos; ImplDoMouseAction( rMousePos, meScrollType != ScrollType::Set ); - Update(); + PaintImmediately(); if( meScrollType != ScrollType::Set ) StartTracking( nTrackFlags ); @@ -704,7 +704,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt ) { // after dragging, recalculate to a rounded Thumb position ImplCalc(); - Update(); + PaintImmediately(); } meScrollType = ScrollType::DontKnow; @@ -735,7 +735,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt ) if ( nOldPos != mnThumbPos ) { ImplUpdateRects(); - Update(); + PaintImmediately(); if ( nOldPos != mnThumbPos ) { Slide(); diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 02cfa74f83ac..b5dc9703e5ae 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -933,13 +933,13 @@ void TextView::Scroll( long ndX, long ndY ) { bool bVisCursor = mpImpl->mpCursor->IsVisible(); mpImpl->mpCursor->Hide(); - mpImpl->mpWindow->Update(); + mpImpl->mpWindow->PaintImmediately(); mpImpl->maStartDocPos = aNewStartPos; if ( mpImpl->mpTextEngine->IsRightToLeft() ) nDiffX = -nDiffX; mpImpl->mpWindow->Scroll( nDiffX, nDiffY ); - mpImpl->mpWindow->Update(); + mpImpl->mpWindow->PaintImmediately(); mpImpl->mpCursor->SetPos( mpImpl->mpCursor->GetPos() + Point( nDiffX, nDiffY ) ); if ( bVisCursor && !mpImpl->mbReadOnly ) mpImpl->mpCursor->Show(); diff --git a/vcl/source/treelist/iconviewimpl.cxx b/vcl/source/treelist/iconviewimpl.cxx index 5df7ae1a7345..c2640dfc0ccd 100644 --- a/vcl/source/treelist/iconviewimpl.cxx +++ b/vcl/source/treelist/iconviewimpl.cxx @@ -43,12 +43,12 @@ void IconViewImpl::CursorUp() m_nFlags &= ~LBoxFlags::Filling; long nEntryHeight = m_pView->GetEntryHeight(); ShowCursor( false ); - m_pView->Update(); + m_pView->PaintImmediately(); m_pStartEntry = pPrevFirstToDraw; tools::Rectangle aArea( GetVisibleArea() ); aArea.AdjustBottom( -nEntryHeight ); m_pView->Scroll( 0, nEntryHeight, aArea, ScrollFlags::NoChildren ); - m_pView->Update(); + m_pView->PaintImmediately(); ShowCursor( true ); m_pView->NotifyScrolled(); } @@ -67,11 +67,11 @@ void IconViewImpl::CursorDown() { m_nFlags &= ~LBoxFlags::Filling; ShowCursor( false ); - m_pView->Update(); + m_pView->PaintImmediately(); m_pStartEntry = pNextFirstToDraw; tools::Rectangle aArea( GetVisibleArea() ); m_pView->Scroll( 0, -(m_pView->GetEntryHeight()), aArea, ScrollFlags::NoChildren ); - m_pView->Update(); + m_pView->PaintImmediately(); ShowCursor( true ); m_pView->NotifyScrolled(); } @@ -105,9 +105,9 @@ void IconViewImpl::PageDown( sal_uInt16 nDelta ) tools::Rectangle aArea( GetVisibleArea() ); long nScroll = m_pView->GetEntryHeight() * static_cast<long>(nRealDelta); nScroll = -nScroll; - m_pView->Update(); + m_pView->PaintImmediately(); m_pView->Scroll( 0, nScroll, aArea, ScrollFlags::NoChildren ); - m_pView->Update(); + m_pView->PaintImmediately(); m_pView->NotifyScrolled(); } @@ -139,9 +139,9 @@ void IconViewImpl::PageUp( sal_uInt16 nDelta ) { long nEntryHeight = m_pView->GetEntryHeight(); tools::Rectangle aArea( GetVisibleArea() ); - m_pView->Update(); + m_pView->PaintImmediately(); m_pView->Scroll( 0, nEntryHeight*nRealDelta, aArea, ScrollFlags::NoChildren ); - m_pView->Update(); + m_pView->PaintImmediately(); m_pView->NotifyScrolled(); } diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index cbee4c937dee..d80f6b2fefc5 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -308,7 +308,7 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar, void ) if( m_pView->IsEditingActive() ) { m_pView->EndEditing( true ); // Cancel - m_pView->Update(); + m_pView->PaintImmediately(); } BeginScroll(); @@ -341,11 +341,11 @@ void SvImpLBox::CursorDown() { m_nFlags &= ~LBoxFlags::Filling; ShowCursor( false ); - m_pView->Update(); + m_pView->PaintImmediately(); m_pStartEntry = pNextFirstToDraw; tools::Rectangle aArea( GetVisibleArea() ); m_pView->Scroll( 0, -(m_pView->GetEntryHeight()), aArea, ScrollFlags::NoChildren ); - m_pView->Update(); + m_pView->PaintImmediately(); ShowCursor( true ); m_pView->NotifyScrolled(); } @@ -363,12 +363,12 @@ void SvImpLBox::CursorUp() m_nFlags &= ~LBoxFlags::Filling; long nEntryHeight = m_pView->GetEntryHeight(); ShowCursor( false ); - m_pView->Update(); + m_pView->PaintImmediately(); m_pStartEntry = pPrevFirstToDraw; tools::Rectangle aArea( GetVisibleArea() ); aArea.AdjustBottom( -nEntryHeight ); m_pView->Scroll( 0, nEntryHeight, aArea, ScrollFlags::NoChildren ); - m_pView->Update(); + m_pView->PaintImmediately(); ShowCursor( true ); m_pView->NotifyScrolled(); } @@ -390,22 +390,21 @@ void SvImpLBox::PageDown( sal_uInt16 nDelta ) ShowCursor( false ); m_nFlags &= ~LBoxFlags::Filling; - m_pView->Update(); m_pStartEntry = pNext; if( nRealDelta >= m_nVisibleCount ) { m_pView->Invalidate( GetVisibleArea() ); - m_pView->Update(); + m_pView->PaintImmediately(); } else { tools::Rectangle aArea( GetVisibleArea() ); long nScroll = m_pView->GetEntryHeight() * static_cast<long>(nRealDelta); nScroll = -nScroll; - m_pView->Update(); + m_pView->PaintImmediately(); m_pView->Scroll( 0, nScroll, aArea, ScrollFlags::NoChildren ); - m_pView->Update(); + m_pView->PaintImmediately(); m_pView->NotifyScrolled(); } @@ -428,20 +427,19 @@ void SvImpLBox::PageUp( sal_uInt16 nDelta ) m_nFlags &= ~LBoxFlags::Filling; ShowCursor( false ); - m_pView->Update(); m_pStartEntry = pPrev; if( nRealDelta >= m_nVisibleCount ) { m_pView->Invalidate( GetVisibleArea() ); - m_pView->Update(); + m_pView->PaintImmediately(); } else { long nEntryHeight = m_pView->GetEntryHeight(); tools::Rectangle aArea( GetVisibleArea() ); - m_pView->Update(); + m_pView->PaintImmediately(); m_pView->Scroll( 0, nEntryHeight*nRealDelta, aArea, ScrollFlags::NoChildren ); - m_pView->Update(); + m_pView->PaintImmediately(); m_pView->NotifyScrolled(); } @@ -706,7 +704,7 @@ IMPL_LINK( SvImpLBox, ScrollLeftRightHdl, ScrollBar *, pScrollBar, void ) if( m_pView->IsEditingActive() ) { m_pView->EndEditing( true ); // Cancel - m_pView->Update(); + m_pView->PaintImmediately(); } m_pView->nFocusWidth = -1; KeyLeftRight( nDelta ); @@ -716,7 +714,7 @@ IMPL_LINK( SvImpLBox, ScrollLeftRightHdl, ScrollBar *, pScrollBar, void ) void SvImpLBox::KeyLeftRight( long nDelta ) { if( !(m_nFlags & LBoxFlags::InResize) ) - m_pView->Update(); + m_pView->PaintImmediately(); BeginScroll(); m_nFlags &= ~LBoxFlags::Filling; ShowCursor( false ); @@ -1251,7 +1249,7 @@ void SvImpLBox::AdjustScrollBars( Size& rSize ) if( m_pView->IsEditingActive() ) { m_pView->EndEditing( true ); // Cancel - m_pView->Update(); + m_pView->PaintImmediately(); } m_pView->nFocusWidth = -1; KeyLeftRight( nTemp ); @@ -1837,7 +1835,7 @@ void SvImpLBox::EntryInserted( SvTreeListEntry* pEntry ) ShowVerSBar(); ShowCursor( true ); if( m_pStartEntry != m_pView->First() && (m_nFlags & LBoxFlags::Filling) ) - m_pView->Update(); + m_pView->PaintImmediately(); } @@ -3248,7 +3246,7 @@ IMPL_LINK(SvImpLBox, MyUserEvent, void*, pArg, void ) if( !pArg ) { m_pView->Invalidate(); - m_pView->Update(); + m_pView->PaintImmediately(); } else { diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index 9e23479518a9..22c67368c52d 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -1190,7 +1190,7 @@ void SvTreeListBox::StartDrag( sal_Int8, const Point& rPosPixel ) bool bOldUpdateMode = Control::IsUpdateMode(); Control::SetUpdateMode( true ); - Update(); + PaintImmediately(); Control::SetUpdateMode( bOldUpdateMode ); // Disallow using the selection and its children as drop targets. @@ -3383,7 +3383,7 @@ void SvTreeListBox::ModelNotification( SvListAction nActionId, SvTreeListEntry* case SvListAction::CLEARED: if( IsUpdateMode() ) - Update(); + PaintImmediately(); break; default: break; diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 1c82fa805160..365f80614697 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -501,7 +501,7 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) pPopup->pWindow->SetParentToDefaultWindow(); pPopup->pWindow.disposeAndClear(); - Update(); + PaintImmediately(); } } } @@ -626,7 +626,7 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt ) void MenuFloatingWindow::ImplScroll( bool bUp ) { KillActivePopup(); - Update(); + PaintImmediately(); if (!pMenu) return; diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 33cddf352ce4..b62abdaf56df 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -848,7 +848,7 @@ void Window::ImplInvalidate( const vcl::Region* pRegion, InvalidateFlags nFlags } if ( nFlags & InvalidateFlags::Update ) - pOpaqueWindow->Update(); // start painting at the opaque parent + pOpaqueWindow->PaintImmediately(); // start painting at the opaque parent } void Window::ImplMoveInvalidateRegion( const tools::Rectangle& rRect, @@ -1281,11 +1281,11 @@ bool Window::HasPaintEvent() const return false; } -void Window::Update() +void Window::PaintImmediately() { if ( mpWindowImpl->mpBorderWindow ) { - mpWindowImpl->mpBorderWindow->Update(); + mpWindowImpl->mpBorderWindow->PaintImmediately(); return; } @@ -1337,7 +1337,7 @@ void Window::Update() vcl::Window* pUpdateOverlapWindow = ImplGetFirstOverlapWindow()->mpWindowImpl->mpFirstOverlap; while ( pUpdateOverlapWindow ) { - pUpdateOverlapWindow->Update(); + pUpdateOverlapWindow->PaintImmediately(); pUpdateOverlapWindow = pUpdateOverlapWindow->mpWindowImpl->mpNext; } @@ -1824,7 +1824,7 @@ void Window::ImplScroll( const tools::Rectangle& rRect, } if ( nFlags & ScrollFlags::Update ) - Update(); + PaintImmediately(); if ( mpWindowImpl->mpCursor ) mpWindowImpl->mpCursor->ImplResume(); diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx index 6a12d0cada6c..44b44d33e73d 100644 --- a/vcl/source/window/split.cxx +++ b/vcl/source/window/split.cxx @@ -303,7 +303,7 @@ void Splitter::Tracking( const TrackingEvent& rTEvt ) Split(); } - GetParent()->Update(); + GetParent()->PaintImmediately(); } else { @@ -422,7 +422,7 @@ void Splitter::ImplKbdTracking( vcl::KeyCode aKeyCode ) mnLastSplitPos = 0; Split(); } - GetParent()->Update(); + GetParent()->PaintImmediately(); } } } diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index b6d4e96f16d4..4c8dac465a47 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -2039,7 +2039,7 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) if ( mbDragFull ) { - Update(); + PaintImmediately(); mnMStartPos = mnMSplitPos; } } diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index c7ba32cc9527..182c085a152e 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -233,7 +233,7 @@ void ToolBox::ImplCheckUpdate() // this is only required for transparent toolbars (see ImplDrawTransparentBackground() ) if( !IsBackground() && HasPaintEvent() && !IsInPaint() ) - Update(); + PaintImmediately(); } void ToolBox::ImplDrawGrip(vcl::RenderContext& rRenderContext, @@ -3210,7 +3210,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) if ( mbFormat ) { ImplFormat(); - Update(); + PaintImmediately(); } Point aMousePos = rMEvt.GetPosPixel(); diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 6ae5be59debb..e2613b3da9ec 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1623,7 +1623,7 @@ static void ImplHandlePaint( vcl::Window* pWindow, const tools::Rectangle& rBoun // (GetSizePixel does that for us) pWindow->GetSizePixel(); // force drawing immediately - pWindow->Update(); + pWindow->PaintImmediately(); } } diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 35e9bdd13641..5ca05d716c85 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -2092,7 +2092,7 @@ class DemoPopup : public FloatingWindow SetBackground(Wallpaper(COL_YELLOW)); Show( true, ShowFlags::NoActivate ); - Update(); + PaintImmediately(); } virtual void Paint(vcl::RenderContext& /*rRenderContext*/, const tools::Rectangle&) override |