summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-07-02 12:09:59 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-07-02 12:10:14 +0200
commitb45040d1ec1a0b765f1b2284fffaed2b17b6227b (patch)
tree6c546d66ebc22f6ab3f87f77bd0d05b4b61bc371
parent091fe76b6329b4bb974987554369cbfadd8f2401 (diff)
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
-rw-r--r--vcl/source/control/button.cxx8
1 files changed, 6 insertions, 2 deletions
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);