diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-05-22 17:13:31 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-05-22 23:01:07 +0200 |
commit | 4a149da412dc72fa92c944edc91cc96eb7267636 (patch) | |
tree | acf89b14caec21d97a39e242bae36d0ab7f3af7e /vcl/source | |
parent | cc223fa12a61ba0e580b884386a7f5d7efd0541f (diff) |
VCL replace some code with common function calls
Replaces some code with calls to ApplyControlForeground and
ApplyControlFont.
Change-Id: I16837ad7c48ed46fa48b1f2a33a84c7e94f63482
Reviewed-on: https://gerrit.libreoffice.org/72789
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/edit.cxx | 21 | ||||
-rw-r--r-- | vcl/source/control/imp_listbox.cxx | 28 | ||||
-rw-r--r-- | vcl/source/control/prgsbar.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/status.cxx | 7 |
4 files changed, 12 insertions, 52 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 3f20145b5736..a1b1af252dc5 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2225,7 +2225,7 @@ void Edit::StateChanged( StateChangedType nType ) } } - else if (nType == StateChangedType::Zoom) + else if ((nType == StateChangedType::Zoom) || (nType == StateChangedType::ControlFont)) { if (!mpSubEdit) { @@ -2234,24 +2234,7 @@ void Edit::StateChanged( StateChangedType nType ) Invalidate(); } } - else if (nType == StateChangedType::ControlFont) - { - if (!mpSubEdit) - { - ApplySettings(*this); - ImplShowCursor(); - Invalidate(); - } - } - else if (nType == StateChangedType::ControlForeground) - { - if (!mpSubEdit) - { - ApplySettings(*this); - Invalidate(); - } - } - else if (nType == StateChangedType::ControlBackground) + else if ((nType == StateChangedType::ControlForeground) || (nType == StateChangedType::ControlBackground)) { if (!mpSubEdit) { diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index e7e2344f5096..d6efa0e726ab 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -520,15 +520,8 @@ void ImplListBoxWindow::ApplySettings(vcl::RenderContext& rRenderContext) { const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); - vcl::Font aFont = rStyleSettings.GetFieldFont(); - if (IsControlFont()) - aFont.Merge(GetControlFont()); - SetZoomedPointFont(rRenderContext, aFont); - - Color aTextColor = rStyleSettings.GetFieldTextColor(); - if (IsControlForeground()) - aTextColor = GetControlForeground(); - rRenderContext.SetTextColor(aTextColor); + ApplyControlFont(rRenderContext, rStyleSettings.GetFieldFont()); + ApplyControlForeground(rRenderContext, rStyleSettings.GetFieldTextColor()); if (IsControlBackground()) rRenderContext.SetBackground(GetControlBackground()); @@ -2733,7 +2726,9 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout) else { Color aColor; - if( ImplGetSVData()->maNWFData.mbDDListBoxNoTextArea ) + if (IsControlForeground()) + aColor = GetControlForeground(); + else if (ImplGetSVData()->maNWFData.mbDDListBoxNoTextArea) { if( bNativeOK && (nState & ControlState::ROLLOVER) ) aColor = rStyleSettings.GetButtonRolloverTextColor(); @@ -2747,8 +2742,6 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout) else aColor = rStyleSettings.GetFieldTextColor(); } - if (IsControlForeground()) - aColor = GetControlForeground(); rRenderContext.SetTextColor(aColor); if (!bNativeOK) rRenderContext.Erase(maFocusRect); @@ -2777,15 +2770,8 @@ void ImplWin::ApplySettings(vcl::RenderContext& rRenderContext) { const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); - vcl::Font aFont = rStyleSettings.GetFieldFont(); - if (IsControlFont()) - aFont.Merge(GetControlFont()); - SetZoomedPointFont(rRenderContext, aFont); - - Color aTextColor = rStyleSettings.GetFieldTextColor(); - if (IsControlForeground()) - aTextColor = GetControlForeground(); - rRenderContext.SetTextColor(aTextColor); + ApplyControlFont(rRenderContext, rStyleSettings.GetFieldFont()); + ApplyControlForeground(rRenderContext, rStyleSettings.GetFieldTextColor()); if (IsControlBackground()) rRenderContext.SetBackground(GetControlBackground()); diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx index 08a0296dacdb..61ba2b67a1fe 100644 --- a/vcl/source/control/prgsbar.cxx +++ b/vcl/source/control/prgsbar.cxx @@ -65,13 +65,7 @@ void ProgressBar::ImplInitSettings( bool bFont, /* FIXME: !!! We do not support text output at the moment if ( bFont ) - { - Font aFont; - aFont = rStyleSettings.GetAppFont(); - if ( IsControlFont() ) - aFont.Merge( GetControlFont() ); - SetZoomedPointFont( aFont ); - } + ApplyControlFont(*this, rStyleSettings.GetAppFont()); */ if ( bBackground ) diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 723ab9d07b4f..61c17df48dab 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -164,10 +164,7 @@ void StatusBar::ApplySettings(vcl::RenderContext& rRenderContext) rRenderContext.SetLineColor(); const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); - vcl::Font aFont = rStyleSettings.GetToolFont(); - if (IsControlFont()) - aFont.Merge(GetControlFont()); - SetZoomedPointFont(rRenderContext, aFont); + ApplyControlFont(rRenderContext, rStyleSettings.GetToolFont()); Color aColor; if (IsControlForeground()) @@ -176,8 +173,8 @@ void StatusBar::ApplySettings(vcl::RenderContext& rRenderContext) aColor = rStyleSettings.GetButtonTextColor(); else aColor = rStyleSettings.GetWindowTextColor(); - rRenderContext.SetTextColor(aColor); + rRenderContext.SetTextFillColor(); if (IsControlBackground()) |