From b45040d1ec1a0b765f1b2284fffaed2b17b6227b Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 2 Jul 2015 12:09:59 +0200 Subject: tdf#92443 PushButton::ImplDrawPushButtonFrame: fix Invalidate() loop Regression from commit 32a776c83b86db3efaa7177c479e9327f28fbf46 (Refactor Buttons to use RenderContext when painting, 2015-05-05), the problem was that we started to call vcl::Window::SetSettings(), which invokes Invalidate(), which should not happen, since we're in Paint(). Fix this by restoring the old behavior of calling OutputDevice::SetSettings() directly again. Change-Id: I57c8e7947764e8cdc2d144be2dd140d3c408255d --- vcl/source/control/button.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 35c0262db9f1..0c330d6d88ea 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -729,9 +729,13 @@ void PushButton::ImplDrawPushButtonFrame(vcl::RenderContext& rRenderContext, StyleSettings aStyleSettings = aSettings.GetStyleSettings(); aStyleSettings.Set3DColors(GetControlBackground()); aSettings.SetStyleSettings(aStyleSettings); - rRenderContext.SetSettings(aSettings); + + // Call OutputDevice::SetSettings() explicitly, as rRenderContext may + // be a vcl::Window in fact, and vcl::Window::SetSettings() will call + // Invalidate(), which is a problem, since we're in Paint(). + rRenderContext.OutputDevice::SetSettings(aSettings); rRect = aDecoView.DrawButton(rRect, nStyle); - rRenderContext.SetSettings(aOldSettings); + rRenderContext.OutputDevice::SetSettings(aOldSettings); } else rRect = aDecoView.DrawButton(rRect, nStyle); -- cgit