summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-03-16 15:48:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-03-16 19:09:02 +0100
commita7de363cead5cd0021d2e3df4573d4cbe27df23b (patch)
treef9e60ff583c1621bf6a5eee2a36eb22b41052708
parent2f7f34bf9fb744a2615426e4414dff3ca6fbe6e4 (diff)
remove unnecessary Window::Update() calls, which immediately follow Invalidate
Update() is effectively "paint immediately". Rather just let the invalidate do it's thing and have the widget paint on the next paint loop, along with the rest of the stuff. This is probably mostly cargo-cult, from the days when our invalidate/paint timer could take a long time to kick in. Change-Id: Idff06526e9a2892244cfd8ce6947916032b0d1a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90567 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
-rw-r--r--basctl/source/dlged/dlgedview.cxx1
-rw-r--r--reportdesign/source/ui/report/SectionView.cxx1
-rw-r--r--sc/source/ui/view/olinewin.cxx1
-rw-r--r--sd/source/ui/slidesorter/view/SlideSorterView.cxx1
-rw-r--r--sw/source/core/view/vprint.cxx1
-rw-r--r--vcl/source/control/button.cxx17
-rw-r--r--vcl/source/control/imp_listbox.cxx1
-rw-r--r--vcl/source/control/prgsbar.cxx1
-rw-r--r--vcl/source/control/slider.cxx1
-rw-r--r--vcl/source/control/spinbtn.cxx7
-rw-r--r--vcl/source/control/spinfld.cxx5
-rw-r--r--vcl/source/treelist/iconviewimpl.cxx4
-rw-r--r--vcl/source/treelist/svimpbox.cxx5
-rw-r--r--vcl/source/window/status.cxx21
14 files changed, 2 insertions, 65 deletions
diff --git a/basctl/source/dlged/dlgedview.cxx b/basctl/source/dlged/dlgedview.cxx
index 3eda45a289d1..3ec0f72e1fda 100644
--- a/basctl/source/dlged/dlgedview.cxx
+++ b/basctl/source/dlged/dlgedview.cxx
@@ -110,7 +110,6 @@ void DlgEdView::MakeVisible( const tools::Rectangle& rRect, vcl::Window& rWin )
rWin.Scroll( -nScrollX, -nScrollY );
aMap.SetOrigin( Point( aOrg.X() - nScrollX, aOrg.Y() - nScrollY ) );
rWin.SetMapMode( aMap );
- rWin.Update();
rWin.Invalidate();
// update scroll bars
diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx
index 9a23632da48a..100703eef03e 100644
--- a/reportdesign/source/ui/report/SectionView.cxx
+++ b/reportdesign/source/ui/report/SectionView.cxx
@@ -110,7 +110,6 @@ void OSectionView::MakeVisible( const tools::Rectangle& rRect, vcl::Window& rWin
rWin.Scroll( -nScrollX, -nScrollY );
aMap.SetOrigin( Point( aOrg.X() - nScrollX, aOrg.Y() - nScrollY ) );
rWin.SetMapMode( aMap );
- rWin.Update();
rWin.Invalidate();
if ( m_pReportWindow )
diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx
index feaec576e295..ea117e566c90 100644
--- a/sc/source/ui/view/olinewin.cxx
+++ b/sc/source/ui/view/olinewin.cxx
@@ -123,7 +123,6 @@ void ScOutlineWindow::ScrollPixel( long nDiff )
ScrollRel( nDiff, nStart, nEnd );
Invalidate( GetRectangle( 0, nInvStart, GetOutputSizeLevel() - 1, nInvEnd ) );
- Update();
// if focus becomes invisible, move it to next visible button
ImplMoveFocusToVisible( nDiff < 0 );
diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
index 31df3f5ae004..82eb09404c3d 100644
--- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx
+++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
@@ -826,7 +826,6 @@ SlideSorterView::DrawLock::~DrawLock()
if (mpWindow)
{
mpWindow->Invalidate(mrView.maRedrawRegion);
- mpWindow->Update();
}
}
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 5f09eb999216..be73000769d9 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -114,7 +114,6 @@ void SwPaintQueue::Repaint()
{
// for previewing, since rows/columns are known in PaintHdl (UI)
pSh->GetWin()->Invalidate();
- pSh->GetWin()->Update();
}
}
else
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index e859625f6d63..43636df0f94a 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1462,7 +1462,6 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt )
else
{
pBorder->Invalidate( InvalidateFlags::NoErase );
- pBorder->Update();
}
}
else if( (GetStyle() & WB_FLATBUTTON) ||
@@ -2206,7 +2205,6 @@ void RadioButton::ImplCallClick( bool bGrabFocus, GetFocusFlags nFocusFlags )
mbChecked = true;
mpWindowImpl->mnStyle |= WB_TABSTOP;
Invalidate();
- Update();
VclPtr<vcl::Window> xWindow = this;
if ( mbRadioCheck )
ImplUncheckAllOther();
@@ -2255,7 +2253,6 @@ void RadioButton::MouseButtonDown( const MouseEvent& rMEvt )
{
GetButtonState() |= DrawButtonFlags::Pressed;
Invalidate();
- Update();
StartTracking();
return;
}
@@ -2280,7 +2277,6 @@ void RadioButton::Tracking( const TrackingEvent& rTEvt )
else
{
Invalidate();
- Update();
}
}
}
@@ -2292,7 +2288,6 @@ void RadioButton::Tracking( const TrackingEvent& rTEvt )
{
GetButtonState() |= DrawButtonFlags::Pressed;
Invalidate();
- Update();
}
}
else
@@ -2301,7 +2296,6 @@ void RadioButton::Tracking( const TrackingEvent& rTEvt )
{
GetButtonState() &= ~DrawButtonFlags::Pressed;
Invalidate();
- Update();
}
}
}
@@ -2317,14 +2311,12 @@ void RadioButton::KeyInput( const KeyEvent& rKEvt )
{
GetButtonState() |= DrawButtonFlags::Pressed;
Invalidate();
- Update();
}
}
else if ( (GetButtonState() & DrawButtonFlags::Pressed) && (aKeyCode.GetCode() == KEY_ESCAPE) )
{
GetButtonState() &= ~DrawButtonFlags::Pressed;
Invalidate();
- Update();
}
else
Button::KeyInput( rKEvt );
@@ -2447,7 +2439,6 @@ void RadioButton::LoseFocus()
{
GetButtonState() &= ~DrawButtonFlags::Pressed;
Invalidate();
- Update();
}
HideFocus();
@@ -3092,7 +3083,6 @@ void CheckBox::ImplCheck()
VclPtr<vcl::Window> xWindow = this;
Invalidate();
- Update();
Toggle();
if ( xWindow->IsDisposed() )
return;
@@ -3112,7 +3102,6 @@ void CheckBox::MouseButtonDown( const MouseEvent& rMEvt )
{
GetButtonState() |= DrawButtonFlags::Pressed;
Invalidate();
- Update();
StartTracking();
return;
}
@@ -3137,7 +3126,6 @@ void CheckBox::Tracking( const TrackingEvent& rTEvt )
else
{
Invalidate();
- Update();
}
}
}
@@ -3149,7 +3137,6 @@ void CheckBox::Tracking( const TrackingEvent& rTEvt )
{
GetButtonState() |= DrawButtonFlags::Pressed;
Invalidate();
- Update();
}
}
else
@@ -3158,7 +3145,6 @@ void CheckBox::Tracking( const TrackingEvent& rTEvt )
{
GetButtonState() &= ~DrawButtonFlags::Pressed;
Invalidate();
- Update();
}
}
}
@@ -3174,14 +3160,12 @@ void CheckBox::KeyInput( const KeyEvent& rKEvt )
{
GetButtonState() |= DrawButtonFlags::Pressed;
Invalidate();
- Update();
}
}
else if ( (GetButtonState() & DrawButtonFlags::Pressed) && (aKeyCode.GetCode() == KEY_ESCAPE) )
{
GetButtonState() &= ~DrawButtonFlags::Pressed;
Invalidate();
- Update();
}
else
Button::KeyInput( rKEvt );
@@ -3346,7 +3330,6 @@ void CheckBox::LoseFocus()
{
GetButtonState() &= ~DrawButtonFlags::Pressed;
Invalidate();
- Update();
}
HideFocus();
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index 9e29102e55ec..8ffbc5f4660d 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -2638,7 +2638,6 @@ bool ImplWin::PreNotify( NotifyEvent& rNEvt )
&& ! IsNativeControlSupported(ControlType::Listbox, ControlPart::ButtonDown) )
{
GetParent()->GetWindow( GetWindowType::Border )->Invalidate( InvalidateFlags::NoErase );
- GetParent()->GetWindow( GetWindowType::Border )->Update();
}
}
}
diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx
index 16ec32de0597..a99c84af2d4e 100644
--- a/vcl/source/control/prgsbar.cxx
+++ b/vcl/source/control/prgsbar.cxx
@@ -169,7 +169,6 @@ void ProgressBar::SetValue( sal_uInt16 nNewPercent )
if ( IsReallyVisible() )
{
Invalidate();
- Update();
}
}
else if ( mnPercent != nNewPercent )
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index e7d21293fcf0..aec48bc32176 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -588,7 +588,6 @@ void Slider::ImplDoMouseAction( const Point& rMousePos, bool bCallAction )
{
if ( ImplDoAction() )
{
- Update();
Invalidate();
}
}
diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx
index 6c738b5056ad..645aba468a36 100644
--- a/vcl/source/control/spinbtn.cxx
+++ b/vcl/source/control/spinbtn.cxx
@@ -193,7 +193,6 @@ void SpinButton::MouseButtonDown( const MouseEvent& rMEvt )
if ( mbUpperIn || mbLowerIn )
{
- Update();
CaptureMouse();
if ( mbRepeat )
maRepeatTimer.Start();
@@ -213,14 +212,12 @@ void SpinButton::MouseButtonUp( const MouseEvent& )
{
mbUpperIn = false;
Invalidate( maUpperRect );
- Update();
Up();
}
else if ( mbLowerIn )
{
mbLowerIn = false;
Invalidate( maLowerRect );
- Update();
Down();
}
@@ -238,7 +235,6 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
mbUpperIn = false;
maRepeatTimer.Stop();
Invalidate( maUpperRect );
- Update();
}
else if ( !maLowerRect.IsInside( rMEvt.GetPosPixel() ) &&
mbLowerIn && mbInitialDown )
@@ -246,7 +242,6 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
mbLowerIn = false;
maRepeatTimer.Stop();
Invalidate( maLowerRect );
- Update();
}
else if ( maUpperRect.IsInside( rMEvt.GetPosPixel() ) &&
!mbUpperIn && mbInitialUp )
@@ -255,7 +250,6 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
if ( mbRepeat )
maRepeatTimer.Start();
Invalidate( maUpperRect );
- Update();
}
else if ( maLowerRect.IsInside( rMEvt.GetPosPixel() ) &&
!mbLowerIn && mbInitialDown )
@@ -264,7 +258,6 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
if ( mbRepeat )
maRepeatTimer.Start();
Invalidate( maLowerRect );
- Update();
}
}
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 20596fef23e9..4872d5b1436f 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -406,7 +406,6 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt )
if (mbUpperIn || mbLowerIn)
{
- Update();
CaptureMouse();
if (mbRepeat)
maRepeatTimer.Start();
@@ -428,14 +427,12 @@ void SpinField::MouseButtonUp(const MouseEvent& rMEvt)
{
mbUpperIn = false;
Invalidate(maUpperRect);
- Update();
Up();
}
else if (mbLowerIn)
{
mbLowerIn = false;
Invalidate(maLowerRect);
- Update();
Down();
}
@@ -461,7 +458,6 @@ void SpinField::MouseMove(const MouseEvent& rMEvt)
mbUpperIn = bNewUpperIn;
Invalidate(maUpperRect);
- Update();
}
}
else if (mbInitialDown)
@@ -479,7 +475,6 @@ void SpinField::MouseMove(const MouseEvent& rMEvt)
mbLowerIn = bNewLowerIn;
Invalidate(maLowerRect);
- Update();
}
}
}
diff --git a/vcl/source/treelist/iconviewimpl.cxx b/vcl/source/treelist/iconviewimpl.cxx
index 9305d7b3e456..3494dee741bc 100644
--- a/vcl/source/treelist/iconviewimpl.cxx
+++ b/vcl/source/treelist/iconviewimpl.cxx
@@ -94,13 +94,11 @@ void IconViewImpl::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();
}
else
{
@@ -132,12 +130,10 @@ void IconViewImpl::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();
}
else
{
diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index bc407216a696..50672b26f820 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -394,13 +394,11 @@ 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();
}
else
{
@@ -432,12 +430,10 @@ 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();
}
else
{
@@ -3268,7 +3264,6 @@ IMPL_LINK(SvImpLBox, MyUserEvent, void*, pArg, void )
if( !pArg )
{
m_pView->Invalidate();
- m_pView->Update();
}
else
{
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index e5ba91043c53..ce8bba89bbaf 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -504,7 +504,6 @@ void DrawProgress(vcl::Window* pWindow, vcl::RenderContext& rRenderContext, cons
pEraseWindow->Invalidate(aRect, InvalidateFlags::NoChildren |
InvalidateFlags::NoClipChildren |
InvalidateFlags::Transparent);
- pEraseWindow->Update();
}
rRenderContext.Push(PushFlags::CLIPREGION);
rRenderContext.IntersectClipRegion(rFramePosSize);
@@ -1173,7 +1172,6 @@ void StatusBar::SetItemText( sal_uInt16 nItemId, const OUString& rText, int nCha
{
tools::Rectangle aRect = ImplGetItemRectPos(nPos);
Invalidate(aRect);
- Update();
}
}
}
@@ -1228,7 +1226,6 @@ void StatusBar::SetItemData( sal_uInt16 nItemId, void* pNewData )
{
tools::Rectangle aRect = ImplGetItemRectPos(nPos);
Invalidate(aRect, InvalidateFlags::NoErase);
- Update();
}
}
}
@@ -1258,7 +1255,6 @@ void StatusBar::RedrawItem(sal_uInt16 nItemId)
{
tools::Rectangle aRect = ImplGetItemRectPos(nPos);
Invalidate(aRect);
- Update();
}
}
@@ -1333,7 +1329,6 @@ void StatusBar::StartProgressMode( const OUString& rText )
if ( IsReallyVisible() )
{
Invalidate();
- Update();
}
}
@@ -1354,7 +1349,6 @@ void StatusBar::SetProgressValue( sal_uInt16 nNewPercent )
if ((nTime_ms - mnLastProgressPaint_ms) > 100)
{
Invalidate(maPrgsFrameRect);
- Update();
mnLastProgressPaint_ms = nTime_ms;
}
}
@@ -1370,7 +1364,6 @@ void StatusBar::EndProgressMode()
if ( IsReallyVisible() )
{
Invalidate();
- Update();
}
}
@@ -1378,17 +1371,8 @@ void StatusBar::SetText(const OUString& rText)
{
if ((GetStyle() & WB_RIGHT) && !mbProgressMode && IsReallyVisible() && IsUpdateMode())
{
- if (mbFormat)
- {
- Invalidate();
- Window::SetText(rText);
- }
- else
- {
- Invalidate();
- Window::SetText(rText);
- Update();
- }
+ Window::SetText(rText);
+ Invalidate();
}
else if (mbProgressMode)
{
@@ -1396,7 +1380,6 @@ void StatusBar::SetText(const OUString& rText)
if (IsReallyVisible())
{
Invalidate();
- Update();
}
}
else