[Libreoffice-commits] core.git: cui/source

Katarina Behrens Katarina.Behrens at cib.de
Sat May 20 10:04:53 UTC 2017


 cui/source/inc/cuitabarea.hxx     |    2 --
 cui/source/tabpages/tppattern.cxx |   16 ++++------------
 2 files changed, 4 insertions(+), 14 deletions(-)

New commits:
commit 7662b11cad6105d56fb9acc9c431c89d3b68dc89
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Tue May 16 18:30:29 2017 +0200

    tdf#107822: Apply custom pattern even if not saved as preset
    
    do the same ff1f83dd08b7b0169301ffe0a53499a27af613b9 does for
    gradients and hatches also here.
    Additionally remove bool member variable, no eye deer what its
    purpose was anyway, it was written multiple times but never read
    
    Change-Id: Iebb811906e92827969da028ee66d90ac477b0bdf
    Reviewed-on: https://gerrit.libreoffice.org/37690
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    Tested-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 2e692005f7b5..e45186823170 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -625,8 +625,6 @@ private:
     ChangeType*         m_pnColorListState;
     sal_Int32*          m_pPos;
 
-    bool                m_bPtrnChanged;
-
     XFillStyleItem      m_aXFStyleItem;
     XFillBitmapItem     m_aXPatternItem;
     XFillAttrSetItem    m_aXFillAttr;
diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx
index df6a58249fec..71aea3caf0f7 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -93,7 +93,6 @@ SvxPatternTabPage::SvxPatternTabPage(  vcl::Window* pParent, const SfxItemSet& r
     m_pnPatternListState  ( nullptr ),
     m_pnColorListState    ( nullptr ),
     m_pPos                ( nullptr ),
-    m_bPtrnChanged        ( false ),
 
     m_aXFStyleItem        ( drawing::FillStyle_BITMAP ),
     m_aXPatternItem       ( OUString(), Graphic() ),
@@ -214,7 +213,7 @@ DeactivateRC SvxPatternTabPage::DeactivatePage( SfxItemSet* _pSet)
 bool SvxPatternTabPage::FillItemSet( SfxItemSet* _rOutAttrs )
 {
     _rOutAttrs->Put(XFillStyleItem(drawing::FillStyle_BITMAP));
-    size_t nPos = m_pPatternLB->GetSelectItemPos();
+    size_t nPos = m_pPatternLB->IsNoSelection() ? VALUESET_ITEM_NOTFOUND : m_pPatternLB->GetSelectItemPos();
     if(VALUESET_ITEM_NOTFOUND != nPos)
     {
         const XBitmapEntry* pXBitmapEntry = m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) );
@@ -341,8 +340,6 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, ValueSet*, void)
         }
 
         m_pCtlPixel->Invalidate();
-
-        m_bPtrnChanged = false;
     }
 }
 
@@ -464,8 +461,6 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickModifyHdl_Impl, Button*, void)
         m_pPatternLB->SelectItem( nId );
 
         *m_pnPatternListState |= ChangeType::MODIFIED;
-
-        m_bPtrnChanged = false;
     }
 }
 
@@ -504,8 +499,6 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void)
                 m_pPatternLB->SelectItem( nId );
 
                 *m_pnPatternListState |= ChangeType::MODIFIED;
-
-                m_bPtrnChanged = false;
             }
             else
             {
@@ -555,6 +548,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void)
 IMPL_LINK_NOARG(SvxPatternTabPage, ChangeColorHdl_Impl, SvxColorListBox&, void)
 {
     ChangeColor_Impl();
+    m_pPatternLB->SetNoSelection();
 }
 
 void SvxPatternTabPage::ChangeColor_Impl()
@@ -570,8 +564,6 @@ void SvxPatternTabPage::ChangeColor_Impl()
     m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_pBitmapCtl->GetBitmapEx())));
     m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
     m_pCtlPreview->Invalidate();
-
-    m_bPtrnChanged = true;
 }
 
 
@@ -585,9 +577,9 @@ void SvxPatternTabPage::PointChanged( vcl::Window* pWindow, RectPoint )
         m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_pBitmapCtl->GetBitmapEx())));
         m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
         m_pCtlPreview->Invalidate();
-
-        m_bPtrnChanged = true;
     }
+
+    m_pPatternLB->SetNoSelection();
 }
 
 sal_Int32 SvxPatternTabPage::SearchPatternList(const OUString& rPatternName)


More information about the Libreoffice-commits mailing list