summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-29 17:03:29 +0100
committerAndras Timar <andras.timar@collabora.com>2017-04-07 07:53:07 +0200
commit73616e6ae184806f57b75b475fb7e11734501b86 (patch)
tree6b3ec27ec23534dcdd675e5d3e69e4af3194fda8 /cui
parent0e3c6fc907dada12d677de8b730280cebcc46a4d (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> (cherry picked from commit f75cf4c772279f680839e288b3f6104f9f98c13c)
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/chardlg.hxx3
-rw-r--r--cui/source/tabpages/chardlg.cxx25
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 )