diff options
Diffstat (limited to 'cui')
-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 5bb00f455dc9..f9958c81dd1c 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 ) |