cui/source/inc/cuitabarea.hxx    |    4 ++++
 cui/source/tabpages/backgrnd.cxx |   19 +++++++++++--------
 cui/source/tabpages/tparea.cxx   |   21 +++++++++++++--------
 3 files changed, 28 insertions(+), 16 deletions(-)

New commits:
commit 2761709acf77b1f64d76d5828d09ad9e7d9dc4cb
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Tue Mar 19 19:04:04 2019 -0800
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Wed Mar 20 13:20:53 2019 +0100

    tdf#122943 Don't add properties to style when Highlighting and Area
    
    ...tab pages are simply visited
    
    Change-Id: I490275bf7e27160d312bb5b6ad7001298549f7e8
    Reviewed-on: https://gerrit.libreoffice.org/69455
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index ad241f4ed136..fc45f9922c9b 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -238,6 +238,8 @@ private:
     XFillAttrSetItem    m_aXFillAttr;
     SfxItemSet&         m_rXFSet;
 
+    bool m_bBtnClicked = false;
+
 protected:
     std::unique_ptr<weld::Container> m_xFillTab;
     std::unique_ptr<weld::ToggleButton> m_xBtnNone;
@@ -252,6 +254,8 @@ protected:
     void SelectFillType( weld::ToggleButton& rButton, const SfxItemSet* _pSet 
= nullptr );
     SfxTabPage* GetFillTabPage() { return m_pFillTabPage; }
 
+    bool IsBtnClicked() { return m_bBtnClicked; }
+
 private:
     DECL_LINK(SelectFillTypeHdl_Impl, weld::ToggleButton&, void);
 
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index eff3e8fb28bc..44951b635e88 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -1460,15 +1460,18 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet )
     {
         case drawing::FillStyle_NONE:
         {
-            if ( SID_ATTR_CHAR_BACK_COLOR == nSlot )
+            if ( IsBtnClicked() )
             {
-                maSet.Put( SvxBackgroundColorItem( COL_TRANSPARENT, nWhich ) );
-                rCoreSet->Put( SvxBackgroundColorItem( COL_TRANSPARENT, nWhich 
) );
-            }
-            else
-            {
-                maSet.Put( SvxBrushItem( COL_TRANSPARENT, nWhich ) );
-                rCoreSet->Put( SvxBrushItem( COL_TRANSPARENT, nWhich ) );
+                if ( SID_ATTR_CHAR_BACK_COLOR == nSlot )
+                {
+                    maSet.Put( SvxBackgroundColorItem( COL_TRANSPARENT, nWhich 
) );
+                    rCoreSet->Put( SvxBackgroundColorItem( COL_TRANSPARENT, 
nWhich ) );
+                }
+                else
+                {
+                    maSet.Put( SvxBrushItem( COL_TRANSPARENT, nWhich ) );
+                    rCoreSet->Put( SvxBrushItem( COL_TRANSPARENT, nWhich ) );
+                }
             }
             break;
         }
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 4705f95cf44e..83ffcb3c8a7e 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -187,19 +187,19 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet 
)
         default:
         case drawing::FillStyle_NONE:
         {
-            SelectFillTypeHdl_Impl(*m_xBtnNone);
+            SelectFillType(*m_xBtnNone);
             break;
         }
         case drawing::FillStyle_SOLID:
         {
             m_rXFSet.Put( static_cast<const XFillColorItem&>( rSet.Get( 
GetWhich( XATTR_FILLCOLOR ) ) ) );
-            SelectFillTypeHdl_Impl(*m_xBtnColor);
+            SelectFillType(*m_xBtnColor);
             break;
         }
         case drawing::FillStyle_GRADIENT:
         {
             m_rXFSet.Put( static_cast<const XFillGradientItem&>( rSet.Get( 
GetWhich( XATTR_FILLGRADIENT ) ) ) );
-            SelectFillTypeHdl_Impl(*m_xBtnGradient);
+            SelectFillType(*m_xBtnGradient);
             break;
         }
         case drawing::FillStyle_HATCH:
@@ -207,7 +207,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
             m_rXFSet.Put( rSet.Get(XATTR_FILLHATCH) );
             m_rXFSet.Put( rSet.Get(XATTR_FILLBACKGROUND) );
             m_rXFSet.Put( rSet.Get(XATTR_FILLCOLOR) );
-            SelectFillTypeHdl_Impl(*m_xBtnHatch);
+            SelectFillType(*m_xBtnHatch);
             break;
         }
         case drawing::FillStyle_BITMAP:
@@ -216,9 +216,9 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
             // pass full item set here, bitmap fill has many attributes 
(tiling, size, offset etc.)
             m_rXFSet.Put( rSet );
             if(!aItem.isPattern())
-                SelectFillTypeHdl_Impl(*m_xBtnBitmap);
+                SelectFillType(*m_xBtnBitmap);
             else
-                SelectFillTypeHdl_Impl(*m_xBtnPattern);
+                SelectFillType(*m_xBtnPattern);
             break;
         }
     }
@@ -239,8 +239,11 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* 
_pSet )
         {
             // Fill: None doesn't have its own tabpage and thus
             // implementation of FillItemSet, so we supply it here
-            XFillStyleItem aStyleItem( drawing::FillStyle_NONE );
-            _pSet->Put( aStyleItem );
+            if ( m_bBtnClicked )
+            {
+                XFillStyleItem aStyleItem( drawing::FillStyle_NONE );
+                _pSet->Put( aStyleItem );
+            }
             break;
         }
         case SOLID:
@@ -308,6 +311,7 @@ void SvxAreaTabPage::Reset_Impl( const SfxItemSet* rAttrs )
 
 void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
 {
+    m_bBtnClicked = false;
     auto eFillType = maBox.GetCurrentButtonPos();
     switch(eFillType)
     {
@@ -371,6 +375,7 @@ VclPtr<SfxTabPage> lcl_CreateFillStyleTabPage(sal_uInt16 
nId, TabPageParent pPar
 IMPL_LINK(SvxAreaTabPage, SelectFillTypeHdl_Impl, weld::ToggleButton&, 
rButton, void)
 {
     SelectFillType(rButton);
+    m_bBtnClicked = true;
 }
 
 void SvxAreaTabPage::SelectFillType(weld::ToggleButton& rButton, const 
SfxItemSet* _pSet)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to