diff options
author | Eike Rathke <erack@redhat.com> | 2016-12-12 21:24:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-12-13 11:29:03 +0000 |
commit | 96068bd2c9dc17d9af7550ba5a02673c5c7eabad (patch) | |
tree | 2fe75c5dec47f960d1fe8393677630554fad84cc | |
parent | 41fc6366c53323c46769f2c367d8f8d6cf02878b (diff) |
Resolves: tdf#101588, do not prevent color de-selection tdf#96382 follow-up
Comparing colors to determine whether to set one in the result item set does
not work if the color previously was set before SaveValue() was called
unconditionally even for the "undetermined" color state. Actually we want to
know whether the user selected a color instead.
Change-Id: I508f791684ebd79ba4af9cb654f9aa0bb25bff5d
(cherry picked from commit 429be969b39867d6d9f36978c9ac15b601e78ba6)
Reviewed-on: https://gerrit.libreoffice.org/31923
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | cui/source/tabpages/backgrnd.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index aa9c595d3eb2..1070990463f3 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -683,7 +683,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet ) { // Brush-treatment: if ( rOldItem.GetColor() != aBgdColor || - (SfxItemState::DEFAULT >= eOldItemState && m_pBackgroundColorSet->GetSavedValue() != m_pBackgroundColorSet->GetSelectItemId())) + (SfxItemState::DEFAULT >= eOldItemState && !m_pBackgroundColorSet->IsNoSelection())) { bModified = true; rCoreSet->Put( SvxBrushItem( aBgdColor, nWhich ) ); @@ -1422,9 +1422,13 @@ void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr, } else { + bool bNoSelection = m_pBackgroundColorSet->IsNoSelection(); m_pBackgroundColorSet->SelectItem( nCol ); + m_pBackgroundColorSet->SaveValue(); + // The actual selection is user set, not what we preset. + if (bNoSelection) + m_pBackgroundColorSet->SetNoSelection(); } - m_pBackgroundColorSet->SaveValue(); m_pPreviewWin1->NotifyChange( aBgdColor ); |