diff options
author | Eike Rathke <erack@redhat.com> | 2017-06-20 23:56:44 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-06-21 00:02:53 +0200 |
commit | aee66aa85e75f67135e5c6079a281e18402d261a (patch) | |
tree | 71f50832010787167e9176f077bac9b13c7237e9 /cui | |
parent | c2da33ead8b093b12ebb9a0ea9c06d156c41a3e6 (diff) |
Resolves: tdf#105740 select without selecting.. tdf#101588 b0rk
The initial color, if determined, must result in being selected. Differentiate
between pre-selected and user-selected.
Regression of
commit 429be969b39867d6d9f36978c9ac15b601e78ba6
Date: Mon Dec 12 21:24:20 2016 +0100
Change-Id: I928af131d03c61a8e474e5cd356aea8b766112fa
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/backgrnd.hxx | 1 | ||||
-rw-r--r-- | cui/source/tabpages/backgrnd.cxx | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx index 59776c8acb40..d95fe6084ea3 100644 --- a/cui/source/inc/backgrnd.hxx +++ b/cui/source/inc/backgrnd.hxx @@ -107,6 +107,7 @@ private: bool bIsGraphicValid : 1; bool bLinkOnly : 1; bool bHighlighting : 1; + bool m_bColorSelected : 1; Graphic aBgdGraphic; OUString aBgdGraphicPath; OUString aBgdGraphicFilter; diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 7d52eb2d5c20..d4bd7501b56a 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -331,6 +331,7 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const SfxItemSe , bIsGraphicValid(false) , bLinkOnly(false) , bHighlighting(false) + , m_bColorSelected(false) , pPageImpl(new SvxBackgroundPage_Impl) , pImportDlg(nullptr) , pTableBck_Impl(nullptr) @@ -449,6 +450,8 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet ) return; } + m_bColorSelected = false; + // condition of the preview button is persistent due to UserData OUString aUserData = GetUserData(); m_pBtnPreview->Check( !aUserData.isEmpty() && '1' == aUserData[0] ); @@ -682,7 +685,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet ) { // Brush-treatment: if ( rOldItem.GetColor() != aBgdColor || - (SfxItemState::DEFAULT >= eOldItemState && !m_pBackgroundColorSet->IsNoSelection())) + (SfxItemState::DEFAULT >= eOldItemState && m_bColorSelected)) { bModified = true; rCoreSet->Put( SvxBrushItem( aBgdColor, nWhich ) ); @@ -1136,6 +1139,7 @@ IMPL_LINK_NOARG(SvxBackgroundTabPage, BackgroundColorHdl_Impl, ValueSet*, void) sal_uInt16 nItemId = m_pBackgroundColorSet->GetSelectItemId(); Color aColor = nItemId ? ( m_pBackgroundColorSet->GetItemColor( nItemId ) ) : Color( COL_TRANSPARENT ); aBgdColor = aColor; + m_bColorSelected = true; m_pPreviewWin1->NotifyChange( aBgdColor ); } @@ -1421,13 +1425,9 @@ 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 ); |