[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - cui/source

Katarina Behrens Katarina.Behrens at cib.de
Mon May 22 08:33:02 UTC 2017


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

New commits:
commit 2861230f3752ad557c10ad2858e040e22b3801ad
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>
    (cherry picked from commit 7662b11cad6105d56fb9acc9c431c89d3b68dc89)
    Reviewed-on: https://gerrit.libreoffice.org/37851
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 6e45726d80e5..98a7336e1709 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -627,8 +627,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 c8ecde2457ba..4203b8cd0452 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() ),
@@ -216,7 +215,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) );
@@ -343,8 +342,6 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, ValueSet*, void)
         }
 
         m_pCtlPixel->Invalidate();
-
-        m_bPtrnChanged = false;
     }
 }
 
@@ -466,8 +463,6 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickModifyHdl_Impl, Button*, void)
         m_pPatternLB->SelectItem( nId );
 
         *m_pnPatternListState |= ChangeType::MODIFIED;
-
-        m_bPtrnChanged = false;
     }
 }
 
@@ -506,8 +501,6 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void)
                 m_pPatternLB->SelectItem( nId );
 
                 *m_pnPatternListState |= ChangeType::MODIFIED;
-
-                m_bPtrnChanged = false;
             }
             else
             {
@@ -557,6 +550,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()
@@ -572,8 +566,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;
 }
 
 
@@ -587,9 +579,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