Kaydet (Commit) 94ceda8b authored tarafından Katarina Behrens's avatar Katarina Behrens Kaydeden (comit) Caolán McNamara

tdf#92600: Restore ability to apply font settings to controls

SmShowSymbol handles font/fg/bg settings by itself, so make
ApplySettings noop there.

This partially reverts commit b010e407

Change-Id: Ib5074684ef1277d9b9b4646bd73dce4cbff3943e
Reviewed-on: https://gerrit.libreoffice.org/17288Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b1760dc3
......@@ -41,8 +41,6 @@ protected:
private:
bool mbHasControlFocus;
bool mbFont;
bool mbForeground;
bool mbShowAccelerator;
Link<> maGetFocusHdl;
Link<> maLoseFocusHdl;
......
......@@ -327,6 +327,7 @@ class SmShowSymbol : public Control
Link<> aDblClickHdlLink;
virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle&) SAL_OVERRIDE;
virtual void ApplySettings(vcl::RenderContext& rRenderContext) SAL_OVERRIDE;
virtual void MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
......
......@@ -1384,6 +1384,10 @@ void SmShowSymbol::Resize()
Invalidate();
}
void SmShowSymbol::ApplySettings(vcl::RenderContext& /*rRenderContext*/ )
{
}
void SmShowSymbol::setFontSize(vcl::Font &rFont) const
{
rFont.SetSize(Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3));
......
......@@ -36,8 +36,6 @@ using namespace vcl;
void Control::ImplInitControlData()
{
mbHasControlFocus = false;
mbFont = false;
mbForeground = false;
mbShowAccelerator = false;
mpControlData = new ImplControlData;
}
......@@ -425,23 +423,15 @@ void Control::ApplySettings(vcl::RenderContext& rRenderContext)
{
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
if (mbFont)
{
vcl::Font rFont(GetCanonicalFont(rStyleSettings));
ApplyControlFont(rRenderContext, rFont);
}
if (mbFont || mbForeground)
{
ApplyControlForeground(rRenderContext, GetCanonicalTextColor(rStyleSettings));
rRenderContext.SetTextFillColor();
}
}
void Control::ImplInitSettings(const bool _bFont, const bool _bForeground)
void Control::ImplInitSettings(const bool, const bool)
{
mbFont = _bFont;
mbForeground = _bForeground;
ApplySettings(*this);
}
......
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