diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-09-07 13:42:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-08 15:07:22 +0200 |
commit | 842c71a1fae1def3e8b694ae3b820b34ad26bce4 (patch) | |
tree | 8b00253118bb278c5dda9b2a97897e93e2f9e691 /svx | |
parent | 97b6fd8e9ec4c655a5b73cbb4f64be06e7057242 (diff) |
weld FontFeaturesDialog
Change-Id: I67ab7388593aceb00b660e4d40904a4eef247620
Reviewed-on: https://gerrit.libreoffice.org/60148
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/fntctrl.cxx | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 69d7b3a82450..93f168e85d75 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -1443,30 +1443,15 @@ Size SvxFontPrevWindow::GetOptimalSize() const return getPreviewStripSize(*this); } -void FontPrevWindow::ResetSettings() -{ - mbResetForeground = true; - mbResetBackground = true; - Invalidate(); -} - void FontPrevWindow::ApplySettings(vcl::RenderContext& rRenderContext) { const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - if (mbResetForeground) - { - svtools::ColorConfig aColorConfig; - Color aTextColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); - rRenderContext.SetTextColor(aTextColor); - mbResetForeground = false; - } + svtools::ColorConfig aColorConfig; + Color aTextColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); + rRenderContext.SetTextColor(aTextColor); - if (mbResetBackground) - { - rRenderContext.SetBackground(rStyleSettings.GetWindowColor()); - mbResetBackground = false; - } + rRenderContext.SetBackground(rStyleSettings.GetWindowColor()); } void FontPrevWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea) @@ -1490,12 +1475,10 @@ void FontPrevWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea) initFont(pImpl->maCJKFont); initFont(pImpl->maCTLFont); - ResetSettings(); + Invalidate(); } FontPrevWindow::FontPrevWindow() - : mbResetForeground(true) - , mbResetBackground(true) { } @@ -1513,12 +1496,6 @@ SvxFont& FontPrevWindow::GetCJKFont() return pImpl->maCJKFont; } -void FontPrevWindow::StyleUpdated() -{ - ResetSettings(); - CustomWidgetController::StyleUpdated(); -} - SvxFont& FontPrevWindow::GetFont() { pImpl->Invalidate100PercentFontWidth(); // because the user might change the size @@ -1541,6 +1518,16 @@ void FontPrevWindow::SetFontNameAsPreviewText() pImpl->mbUseFontNameAsText = true; } +void FontPrevWindow::SetFont( const SvxFont& rNormalOutFont, const SvxFont& rCJKOutFont, const SvxFont& rCTLFont ) +{ + setFont(rNormalOutFont, pImpl->maFont); + setFont(rCJKOutFont, pImpl->maCJKFont); + setFont(rCTLFont, pImpl->maCTLFont); + + pImpl->Invalidate100PercentFontWidth(); + Invalidate(); +} + void FontPrevWindow::SetBackColor(const Color &rColor) { pImpl->mpBackColor.reset(new Color(rColor)); |