Kaydet (Commit) b45040d1 authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#92443 PushButton::ImplDrawPushButtonFrame: fix Invalidate() loop

Regression from commit 32a776c8
(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
üst 091fe76b
...@@ -729,9 +729,13 @@ void PushButton::ImplDrawPushButtonFrame(vcl::RenderContext& rRenderContext, ...@@ -729,9 +729,13 @@ void PushButton::ImplDrawPushButtonFrame(vcl::RenderContext& rRenderContext,
StyleSettings aStyleSettings = aSettings.GetStyleSettings(); StyleSettings aStyleSettings = aSettings.GetStyleSettings();
aStyleSettings.Set3DColors(GetControlBackground()); aStyleSettings.Set3DColors(GetControlBackground());
aSettings.SetStyleSettings(aStyleSettings); 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); rRect = aDecoView.DrawButton(rRect, nStyle);
rRenderContext.SetSettings(aOldSettings); rRenderContext.OutputDevice::SetSettings(aOldSettings);
} }
else else
rRect = aDecoView.DrawButton(rRect, nStyle); rRect = aDecoView.DrawButton(rRect, nStyle);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment