summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-07-02 12:09:59 +0200
committerAndras Timar <andras.timar@collabora.com>2015-08-06 12:52:58 +0200
commit1712a27d1e15abd4e54c9bd7c14f365e1a88e9d8 (patch)
tree9042e23b00a7880e352261c42e256332ac231587 /vcl
parent74905d016ad35579e16bd00a35ea12b1d41287b2 (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 (cherry picked from commit b45040d1ec1a0b765f1b2284fffaed2b17b6227b)
Diffstat (limited to 'vcl')
-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 e8ab9c90da40..2b3759ea28a4 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);