Kaydet (Commit) b72173c8 authored tarafından Katarina Behrens's avatar Katarina Behrens Kaydeden (comit) Andras Timar

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

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>
(cherry picked from commit 94ceda8b)

squashed commit from László Németh <laszlo.nemeth@collabora.com>

tdf#92600 fix missing font preview in character set widget

The previous fix for tdf#92600 (missing bold text in dialogs)
brought back the regression in the special character set
widget: the characters show always the default font
of the Control class instead of the chosen font, see in
the Insert->Special Character... dialog window of Writer.

Change-Id: Ib5074684ef1277d9b9b4646bd73dce4cbff3943e
2bdc2300f481dd680877f84ea2a717b9e749c64c
Reviewed-on: https://gerrit.libreoffice.org/17303Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 307ede67
...@@ -43,6 +43,7 @@ public: ...@@ -43,6 +43,7 @@ public:
SvxShowCharSet( vcl::Window* pParent ); SvxShowCharSet( vcl::Window* pParent );
virtual ~SvxShowCharSet(); virtual ~SvxShowCharSet();
virtual void dispose() SAL_OVERRIDE; virtual void dispose() SAL_OVERRIDE;
virtual void ApplySettings(vcl::RenderContext& rRenderContext) SAL_OVERRIDE;
void RecalculateFont(vcl::RenderContext& rRenderContext); void RecalculateFont(vcl::RenderContext& rRenderContext);
......
...@@ -41,8 +41,6 @@ protected: ...@@ -41,8 +41,6 @@ protected:
private: private:
bool mbHasControlFocus; bool mbHasControlFocus;
bool mbFont;
bool mbForeground;
Link<> maGetFocusHdl; Link<> maGetFocusHdl;
Link<> maLoseFocusHdl; Link<> maLoseFocusHdl;
......
...@@ -328,6 +328,7 @@ class SmShowSymbol : public Control ...@@ -328,6 +328,7 @@ class SmShowSymbol : public Control
Link<> aDblClickHdlLink; Link<> aDblClickHdlLink;
virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle&) SAL_OVERRIDE; 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 MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE;
......
...@@ -1384,6 +1384,10 @@ void SmShowSymbol::Resize() ...@@ -1384,6 +1384,10 @@ void SmShowSymbol::Resize()
Invalidate(); Invalidate();
} }
void SmShowSymbol::ApplySettings(vcl::RenderContext& /*rRenderContext*/ )
{
}
void SmShowSymbol::setFontSize(vcl::Font &rFont) const void SmShowSymbol::setFontSize(vcl::Font &rFont) const
{ {
rFont.SetSize(Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3)); rFont.SetSize(Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3));
......
...@@ -66,6 +66,10 @@ SvxShowCharSet::SvxShowCharSet(vcl::Window* pParent) ...@@ -66,6 +66,10 @@ SvxShowCharSet::SvxShowCharSet(vcl::Window* pParent)
init(); init();
} }
void SvxShowCharSet::ApplySettings(vcl::RenderContext& /*rRenderContext*/ )
{
}
void SvxShowCharSet::init() void SvxShowCharSet::init()
{ {
nSelectedIndex = -1; // TODO: move into init list when it is no longer static nSelectedIndex = -1; // TODO: move into init list when it is no longer static
......
...@@ -36,8 +36,6 @@ using namespace vcl; ...@@ -36,8 +36,6 @@ using namespace vcl;
void Control::ImplInitControlData() void Control::ImplInitControlData()
{ {
mbHasControlFocus = false; mbHasControlFocus = false;
mbFont = false;
mbForeground = false;
mpControlData = new ImplControlData; mpControlData = new ImplControlData;
} }
...@@ -419,23 +417,15 @@ void Control::ApplySettings(vcl::RenderContext& rRenderContext) ...@@ -419,23 +417,15 @@ void Control::ApplySettings(vcl::RenderContext& rRenderContext)
{ {
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
if (mbFont)
{
vcl::Font rFont(GetCanonicalFont(rStyleSettings)); vcl::Font rFont(GetCanonicalFont(rStyleSettings));
ApplyControlFont(rRenderContext, rFont); ApplyControlFont(rRenderContext, rFont);
}
if (mbFont || mbForeground)
{
ApplyControlForeground(rRenderContext, GetCanonicalTextColor(rStyleSettings)); ApplyControlForeground(rRenderContext, GetCanonicalTextColor(rStyleSettings));
rRenderContext.SetTextFillColor(); rRenderContext.SetTextFillColor();
}
} }
void Control::ImplInitSettings(const bool _bFont, const bool _bForeground) void Control::ImplInitSettings(const bool, const bool)
{ {
mbFont = _bFont;
mbForeground = _bForeground;
ApplySettings(*this); 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