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

Katarina Behrens Katarina.Behrens at cib.de
Wed Apr 19 20:36:02 UTC 2017


 cui/source/tabpages/tparea.cxx   |    2 --
 cui/source/tabpages/tpgradnt.cxx |    9 +++------
 cui/source/tabpages/tphatch.cxx  |    9 +++------
 3 files changed, 6 insertions(+), 14 deletions(-)

New commits:
commit ec1a44969e5252afa24417011be7a0995e6282eb
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Wed Apr 19 15:13:06 2017 +0200

    This doesn't have to be member variable, it is used just once
    
    and then forgotten again
    
    Change-Id: Id94639415bd1679b67d5d3094dee8b8f8f3d3167
    Reviewed-on: https://gerrit.libreoffice.org/36690
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index f8b392ae92fb..10e50cfd932b 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -416,7 +416,6 @@ void SvxAreaTabPage::CreatePage( sal_Int32 nId, SfxTabPage* pTab )
     {
         static_cast<SvxGradientTabPage*>(pTab)->SetColorList( m_pColorList );
         static_cast<SvxGradientTabPage*>(pTab)->SetGradientList( m_pGradientList );
-        static_cast<SvxGradientTabPage*>(pTab)->SetPos( &m_nPos );
         static_cast<SvxGradientTabPage*>(pTab)->SetGrdChgd( m_pnGradientListState );
         static_cast<SvxGradientTabPage*>(pTab)->SetColorChgd( m_pnColorListState );
         static_cast<SvxGradientTabPage*>(pTab)->Construct();
@@ -428,7 +427,6 @@ void SvxAreaTabPage::CreatePage( sal_Int32 nId, SfxTabPage* pTab )
     {
         static_cast<SvxHatchTabPage*>(pTab)->SetColorList( m_pColorList );
         static_cast<SvxHatchTabPage*>(pTab)->SetHatchingList( m_pHatchingList );
-        static_cast<SvxHatchTabPage*>(pTab)->SetPos(&m_nPos);
         static_cast<SvxHatchTabPage*>(pTab)->SetHtchChgd( m_pnHatchingListState );
         static_cast<SvxHatchTabPage*>(pTab)->SetColorChgd( m_pnColorListState );
         static_cast<SvxHatchTabPage*>(pTab)->Construct();
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index c1cc8ada0c8f..2f6350d97bc2 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -58,7 +58,6 @@ SvxGradientTabPage::SvxGradientTabPage
 
     m_pnGradientListState ( nullptr ),
     m_pnColorListState    ( nullptr ),
-    m_pPos                ( nullptr ),
 
     m_aXFStyleItem        ( drawing::FillStyle_GRADIENT ),
     m_aXGradientItem      ( OUString(), XGradient( COL_BLACK, COL_WHITE ) ),
@@ -201,16 +200,14 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& rSet )
         else
             aString += aURL.getBase();
 
-        *m_pPos = SearchGradientList( ( &static_cast<const XFillGradientItem&>( rSet.Get(XATTR_FILLGRADIENT) ) )->GetName() );
-        if ( *m_pPos != LISTBOX_ENTRY_NOTFOUND )
+        sal_Int32 nPos = SearchGradientList( ( &static_cast<const XFillGradientItem&>( rSet.Get(XATTR_FILLGRADIENT) ) )->GetName() );
+        if ( nPos != LISTBOX_ENTRY_NOTFOUND )
         {
-            sal_uInt16 nId = m_pGradientLB->GetItemId( static_cast<size_t>( *m_pPos ) );
+            sal_uInt16 nId = m_pGradientLB->GetItemId( static_cast<size_t>( nPos ) );
             m_pGradientLB->SelectItem( nId );
         }
         // colors could have been deleted
         ChangeGradientHdl_Impl();
-
-        *m_pPos = LISTBOX_ENTRY_NOTFOUND;
     }
 }
 
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index a6e61d264537..ae39e0e6a01c 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -58,7 +58,6 @@ SvxHatchTabPage::SvxHatchTabPage
     m_rOutAttrs           ( rInAttrs ),
     m_pnHatchingListState ( nullptr ),
     m_pnColorListState    ( nullptr ),
-    m_pPos                ( nullptr ),
 
     m_aXFStyleItem        ( drawing::FillStyle_HATCH ),
     m_aXHatchItem         ( OUString(), XHatch() ),
@@ -188,16 +187,14 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
         else
             aString += aURL.getBase();
 
-        *m_pPos = SearchHatchList( ( &static_cast<const XFillHatchItem&>( rSet.Get(XATTR_FILLHATCH)) )->GetName() );
-        if( *m_pPos != LISTBOX_ENTRY_NOTFOUND )
+        sal_Int32 nPos = SearchHatchList( ( &static_cast<const XFillHatchItem&>( rSet.Get(XATTR_FILLHATCH)) )->GetName() );
+        if( nPos != LISTBOX_ENTRY_NOTFOUND )
         {
-            sal_uInt16 nId = m_pHatchLB->GetItemId( static_cast<size_t>( *m_pPos ) );
+            sal_uInt16 nId = m_pHatchLB->GetItemId( static_cast<size_t>( nPos ) );
             m_pHatchLB->SelectItem( nId );
         }
         // colors could have been deleted
         ChangeHatchHdl_Impl();
-
-        *m_pPos = LISTBOX_ENTRY_NOTFOUND;
     }
 
     XFillBackgroundItem aBckItem( static_cast<const XFillBackgroundItem&>(rSet.Get(XATTR_FILLBACKGROUND)));


More information about the Libreoffice-commits mailing list