summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorLászló Németh <laszlo.nemeth@collabora.com>2015-07-03 18:50:05 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2015-07-04 16:18:37 +0000
commitac7cc2b709469f1b88fe67dd8d069512ade6eb1c (patch)
treea42d4e6467507307c70fa52d13559d06ee89677a /vcl/source
parent3a19e79e8203de59d039da962aa07b0ac1bcab85 (diff)
tdf#92241 fix crashes and rendering of symbol set previews
Change-Id: I43397f2b0caa31c334f87acf11fc96df2e051ad8 Reviewed-on: https://gerrit.libreoffice.org/16744 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/control/ctrl.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 0c40a341b397..21056db4c58f 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -36,6 +36,8 @@ using namespace vcl;
void Control::ImplInitControlData()
{
mbHasControlFocus = false;
+ mbFont = false;
+ mbForeground = false;
mpControlData = new ImplControlData;
}
@@ -417,16 +419,23 @@ void Control::ApplySettings(vcl::RenderContext& rRenderContext)
{
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- vcl::Font rFont(GetCanonicalFont(rStyleSettings));
- ApplyControlFont(rRenderContext, rFont);
-
- ApplyControlForeground(rRenderContext, GetCanonicalTextColor(rStyleSettings));
+ if (mbFont)
+ {
+ vcl::Font rFont(GetCanonicalFont(rStyleSettings));
+ ApplyControlFont(rRenderContext, rFont);
+ }
- rRenderContext.SetTextFillColor();
+ if (mbFont || mbForeground)
+ {
+ ApplyControlForeground(rRenderContext, GetCanonicalTextColor(rStyleSettings));
+ rRenderContext.SetTextFillColor();
+ }
}
-void Control::ImplInitSettings(const bool, const bool)
+void Control::ImplInitSettings(const bool _bFont, const bool _bForeground)
{
+ mbFont = _bFont;
+ mbForeground = _bForeground;
ApplySettings(*this);
}