cui/source/inc/backgrnd.hxx      |    1 +
 cui/source/tabpages/backgrnd.cxx |   12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit f9a0f6bad57949c508024a7fcbca1f783788ec03
Author: Eike Rathke <er...@redhat.com>
Date:   Tue Jun 20 23:56:44 2017 +0200

    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
    Reviewed-on: https://gerrit.libreoffice.org/49256
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    Tested-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx
index e2b8d84e5ca1..06497440b7c7 100644
--- a/cui/source/inc/backgrnd.hxx
+++ b/cui/source/inc/backgrnd.hxx
@@ -108,6 +108,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 1f34633e6fcd..59df9a96c345 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -330,6 +330,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)
@@ -447,6 +448,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] );
@@ -681,7 +684,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 ) );
@@ -1135,6 +1138,7 @@ IMPL_LINK_NOARG_TYPED(SvxBackgroundTabPage, 
BackgroundColorHdl_Impl, ValueSet*,
     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 );
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to