[Libreoffice-commits] core.git: vcl/source
Miklos Vajna
vmiklos at collabora.co.uk
Thu Jul 2 03:11:00 PDT 2015
vcl/source/control/button.cxx | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit b45040d1ec1a0b765f1b2284fffaed2b17b6227b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jul 2 12:09:59 2015 +0200
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
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 35c0262..0c330d6 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);
More information about the Libreoffice-commits
mailing list