diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-29 17:03:29 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-04-05 14:53:19 +0000 |
commit | f75cf4c772279f680839e288b3f6104f9f98c13c (patch) | |
tree | b1a7943be7d5d5a2001ddf313951d90b47a583ab | |
parent | 14028af4d978f126779e641a9605c6d4d864b3b6 (diff) |
Resolves: tdf#106080 fix explicitly setting automatic in search by format
this is still somewhat broken in that what you see is not what you get
if you don't explicitly set automatic, but clears the regression part
of things in that the old broken behavior is restored instead of the
new broken behavior
Change-Id: I8f53a276ee60f5c9f2f28d3b92a13990cc20314a
(cherry picked from commit d7f1a1689d70b2d66d0f727b6a898ef1a971da9d)
Reviewed-on: https://gerrit.libreoffice.org/35894
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | cui/source/inc/chardlg.hxx | 3 | ||||
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 25 |
2 files changed, 21 insertions, 7 deletions
diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx index e537150d1c18..1d54b6890b0f 100644 --- a/cui/source/inc/chardlg.hxx +++ b/cui/source/inc/chardlg.hxx @@ -173,6 +173,9 @@ class SvxCharEffectsPage : public SvxCharBasePage private: static const sal_uInt16 pEffectsRanges[]; + bool m_bOrigFontColor; + bool m_bNewFontColor; + Color m_aOrigFontColor; VclPtr<FixedText> m_pFontColorFT; VclPtr<SvxColorListBox> m_pFontColorLB; diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index fb2d9a5b995b..b606199999cf 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -1343,6 +1343,8 @@ void SvxCharNamePage::PageCreated(const SfxAllItemSet& aSet) SvxCharEffectsPage::SvxCharEffectsPage( vcl::Window* pParent, const SfxItemSet& rInSet ) : SvxCharBasePage(pParent, "EffectsPage", "cui/ui/effectspage.ui", rInSet) + , m_bOrigFontColor(false) + , m_bNewFontColor(false) { get(m_pFontColorFT, "fontcolorft"); get(m_pFontColorLB, "fontcolorlb"); @@ -1559,6 +1561,7 @@ void SvxCharEffectsPage::ResetColor_Impl( const SfxItemSet& rSet ) sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_COLOR ); SfxItemState eState = rSet.GetItemState( nWhich ); + m_bOrigFontColor = false; switch ( eState ) { case SfxItemState::UNKNOWN: @@ -1592,22 +1595,29 @@ void SvxCharEffectsPage::ResetColor_Impl( const SfxItemSet& rSet ) m_pPreviewWin->Invalidate(); m_pFontColorLB->SelectEntry(aColor); + + m_aOrigFontColor = aColor; + m_bOrigFontColor = true; break; } } + m_bNewFontColor = false; } bool SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet ) { sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_COLOR ); - const SvxColorItem* pOld = static_cast<const SvxColorItem*>(GetOldItem( rSet, SID_ATTR_CHAR_COLOR )); - bool bChanged = true; const SfxItemSet& rOldSet = GetItemSet(); - Color aSelectedColor = m_pFontColorLB->GetSelectEntryColor(); + Color aSelectedColor; + bool bChanged = m_bNewFontColor; - if (pOld && pOld->GetValue() == aSelectedColor) - bChanged = false; + if (bChanged) + { + aSelectedColor = m_pFontColorLB->GetSelectEntryColor(); + if (m_bOrigFontColor) + bChanged = aSelectedColor != m_aOrigFontColor; + } if (bChanged) rSet.Put( SvxColorItem( aSelectedColor, nWhich ) ); @@ -1677,8 +1687,10 @@ IMPL_LINK_NOARG(SvxCharEffectsPage, TristClickHdl_Impl, Button*, void) } -IMPL_LINK_NOARG(SvxCharEffectsPage, ColorBoxSelectHdl_Impl, SvxColorListBox&, void) +IMPL_LINK(SvxCharEffectsPage, ColorBoxSelectHdl_Impl, SvxColorListBox&, rBox, void) { + if (m_pFontColorLB == &rBox) + m_bNewFontColor = true; UpdatePreview_Impl(); } @@ -2113,7 +2125,6 @@ void SvxCharEffectsPage::ChangesApplied() m_pShadowBtn->SaveValue(); m_pBlinkingBtn->SaveValue(); m_pHiddenBtn->SaveValue(); - m_pFontColorLB->SaveValue(); } bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet ) |