include/svl/filerec.hxx          |   19 +++++++------------
 include/svl/itempool.hxx         |    1 -
 include/svl/itemprop.hxx         |    4 ++--
 include/svl/poolcach.hxx         |    2 +-
 sc/source/core/data/attarray.cxx |    2 +-
 sc/source/core/data/column.cxx   |    2 +-
 svl/source/filerec/filerec.cxx   |    5 ++---
 svl/source/items/itemprop.cxx    |    3 +--
 svl/source/items/itemset.cxx     |    2 +-
 svl/source/items/poolcach.cxx    |    8 +++-----
 svl/source/items/poolio.cxx      |   29 +++++++++++++----------------
 11 files changed, 32 insertions(+), 45 deletions(-)

New commits:
commit 07da25064f75cdf7163669f9bf860a9ee2f8b33c
Author: Noel Grandin <n...@peralex.com>
Date:   Thu Mar 17 09:45:22 2016 +0200

    loplugin:constantparam in svl
    
    Change-Id: If23e43beb401047825641817e09d7fdeb904f9d9
    Reviewed-on: https://gerrit.libreoffice.org/23317
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noelgran...@gmail.com>

diff --git a/include/svl/filerec.hxx b/include/svl/filerec.hxx
index 107dd61..6581610 100644
--- a/include/svl/filerec.hxx
+++ b/include/svl/filerec.hxx
@@ -236,11 +236,11 @@ protected:
         , _nPreTag(0)
     {
     }
-    void                 Construct_Impl( SvStream *pStream, sal_uInt8 nTag )
+    void                 Construct_Impl( SvStream *pStream )
                         {
                             _pStream = pStream;
                             _bSkipped = false;
-                            _nPreTag = nTag;
+                            _nPreTag = SFX_REC_PRETAG_EXT;
                         }
     inline bool         SetHeader_Impl( sal_uInt32 nHeader );
 
@@ -319,8 +319,7 @@ protected:
     }
     void                Construct_Impl( SvStream *pStream )
                         {
-                            SfxMiniRecordReader::Construct_Impl(
-                                    pStream, SFX_REC_PRETAG_EXT );
+                            SfxMiniRecordReader::Construct_Impl( pStream );
                         }
     bool                FindHeader_Impl( sal_uInt16 nTypes, sal_uInt16 nTag );
 };
@@ -444,8 +443,7 @@ protected:
 
 public:
                         SfxMultiVarRecordWriter( SvStream *pStream,
-                                                 sal_uInt16 nRecordTag,
-                                                 sal_uInt8 nRecordVer );
+                                                 sal_uInt16 nRecordTag );
     virtual             ~SfxMultiVarRecordWriter();
 
     void                NewContent();
@@ -484,8 +482,7 @@ class SVL_DLLPUBLIC SfxMultiMixRecordWriter: public 
SfxMultiVarRecordWriter
 {
 public:
     inline              SfxMultiMixRecordWriter( SvStream *pStream,
-                                                 sal_uInt16 nRecordTag,
-                                                 sal_uInt8 nRecordVer );
+                                                 sal_uInt16 nRecordTag );
 
     void                NewContent( sal_uInt16 nTag, sal_uInt8 nVersion );
 };
@@ -627,12 +624,10 @@ inline SfxMultiFixRecordWriter::~SfxMultiFixRecordWriter()
  *
  * @param pStream    target stream in which the record will be created
  * @param nRecordTag tag for the total record
- * @param nRecordVer version for the total record
  */
 inline SfxMultiMixRecordWriter::SfxMultiMixRecordWriter( SvStream* pStream,
-                                                         sal_uInt16 nRecordTag,
-                                                         sal_uInt8 nRecordVer )
-: SfxMultiVarRecordWriter( SFX_REC_TYPE_MIXTAGS, pStream, nRecordTag, 
nRecordVer )
+                                                         sal_uInt16 nRecordTag 
)
+: SfxMultiVarRecordWriter( SFX_REC_TYPE_MIXTAGS, pStream, nRecordTag, 0 )
 {
 }
 
diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx
index 2ca544d..f3ef335 100644
--- a/include/svl/itempool.hxx
+++ b/include/svl/itempool.hxx
@@ -151,7 +151,6 @@ public:
     const SfxPoolItem&              GetDefaultItem( sal_uInt16 nWhich ) const;
 
     const SfxPoolItem*              LoadItem( SvStream &rStream,
-                                              bool bDirect = false,
                                               const SfxItemPool *pRefPool = 
nullptr );
     bool                            StoreItem( SvStream &rStream,
                                                const SfxPoolItem &rItem,
diff --git a/include/svl/itemprop.hxx b/include/svl/itemprop.hxx
index 1c8923f..f9f332b 100644
--- a/include/svl/itemprop.hxx
+++ b/include/svl/itemprop.hxx
@@ -57,11 +57,11 @@ struct SfxItemPropertySimpleEntry
         }
 
     SfxItemPropertySimpleEntry(sal_uInt16 _nWID, css::uno::Type const & _rType,
-                               long _nFlags, sal_uInt8 _nMemberId)
+                               long _nFlags)
         : nWID(      _nWID )
         , aType(     _rType )
         , nFlags(    _nFlags )
-        , nMemberId( _nMemberId )
+        , nMemberId( 0 )
         {
         }
 
diff --git a/include/svl/poolcach.hxx b/include/svl/poolcach.hxx
index df2fce7..6c55fae 100644
--- a/include/svl/poolcach.hxx
+++ b/include/svl/poolcach.hxx
@@ -50,7 +50,7 @@ public:
                                               const SfxItemSet *pPutSet );
                             ~SfxItemPoolCache();
 
-    const SfxSetItem&       ApplyTo( const SfxSetItem& rSetItem, bool bNew = 
false );
+    const SfxSetItem&       ApplyTo( const SfxSetItem& rSetItem );
 };
 
 
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 816069a..ca61b39 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -798,7 +798,7 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW 
nEndRow, SfxItemPoolCac
         do
         {
             const ScPatternAttr* pOldPattern = pData[nPos].pPattern;
-            const ScPatternAttr* pNewPattern = static_cast<const 
ScPatternAttr*>( &pCache->ApplyTo( *pOldPattern, true ) );
+            const ScPatternAttr* pNewPattern = static_cast<const 
ScPatternAttr*>( &pCache->ApplyTo( *pOldPattern ) );
             ScDocumentPool::CheckRef( *pOldPattern );
             ScDocumentPool::CheckRef( *pNewPattern );
             if (pNewPattern != pOldPattern)
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 95d9c34..ce2ab47 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -494,7 +494,7 @@ void ScColumn::ApplyPattern( SCROW nRow, const 
ScPatternAttr& rPatAttr )
 
     //  true = keep old content
 
-    const ScPatternAttr* pNewPattern = static_cast<const ScPatternAttr*>( 
&aCache.ApplyTo( *pPattern, true ) );
+    const ScPatternAttr* pNewPattern = static_cast<const ScPatternAttr*>( 
&aCache.ApplyTo( *pPattern ) );
     ScDocumentPool::CheckRef( *pPattern );
     ScDocumentPool::CheckRef( *pNewPattern );
 
diff --git a/svl/source/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx
index 9379b6a..e1f9db7 100644
--- a/svl/source/filerec/filerec.cxx
+++ b/svl/source/filerec/filerec.cxx
@@ -362,10 +362,9 @@ SfxMultiVarRecordWriter::SfxMultiVarRecordWriter(sal_uInt8 
 nRecordType,
  * for initializing the <SvULong> members.
  */
 SfxMultiVarRecordWriter::SfxMultiVarRecordWriter(SvStream*  pStream,
-                                                 sal_uInt16 nRecordTag,
-                                                 sal_uInt8  nRecordVer)
+                                                 sal_uInt16 nRecordTag)
 :   SfxMultiFixRecordWriter( SFX_REC_TYPE_VARSIZE,
-                             pStream, nRecordTag, nRecordVer ),
+                             pStream, nRecordTag, 0 ),
     _nContentVer( 0 )
 {
 }
diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx
index 753602c..2fe99b5 100644
--- a/svl/source/items/itemprop.cxx
+++ b/svl/source/items/itemprop.cxx
@@ -142,8 +142,7 @@ void SfxItemPropertyMap::mergeProperties( const 
uno::Sequence< beans::Property >
         SfxItemPropertySimpleEntry aTemp(
             sal::static_int_cast< sal_Int16 >( pPropArray[nElement].Handle ), 
//nWID
             pPropArray[nElement].Type, //aType
-            pPropArray[nElement].Attributes, //nFlags
-            0 ); //nMemberId
+            pPropArray[nElement].Attributes); //nFlags
         (*m_pImpl)[pPropArray[nElement].Name] = aTemp;
     }
 }
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 2772226..d55f9c5 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -1339,7 +1339,7 @@ void SfxItemSet::Load
     {
         // Load Surrogate/Item and resolve Surrogate
         const SfxPoolItem *pItem =
-                m_pPool->LoadItem( rStream, false/*bDirect*/, pRefPool );
+                m_pPool->LoadItem( rStream, pRefPool );
 
         // Did we load an Item or resolve a Surrogate?
         if ( pItem )
diff --git a/svl/source/items/poolcach.cxx b/svl/source/items/poolcach.cxx
index 90104da..994884b 100644
--- a/svl/source/items/poolcach.cxx
+++ b/svl/source/items/poolcach.cxx
@@ -59,7 +59,7 @@ SfxItemPoolCache::~SfxItemPoolCache()
 }
 
 
-const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, bool 
bNew )
+const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem )
 {
     DBG_ASSERT( pPool == rOrigItem.GetItemSet().GetPool(), "invalid Pool" );
     DBG_ASSERT( IsDefaultItem( &rOrigItem ) || IsPooledItem( &rOrigItem ),
@@ -75,8 +75,7 @@ const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem 
&rOrigItem, bool b
             if ( rMapEntry.pPoolItem != &rOrigItem )
             {
                 rMapEntry.pPoolItem->AddRef(2); // One for the cache
-                if ( bNew )
-                    pPool->Put( rOrigItem );    //FIXME: AddRef?
+                pPool->Put( rOrigItem );    //FIXME: AddRef?
             }
             return *rMapEntry.pPoolItem;
         }
@@ -98,8 +97,7 @@ const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem 
&rOrigItem, bool b
 
     // Adapt refcount; one each for the cache
     pNewPoolItem->AddRef( pNewPoolItem != &rOrigItem ? 2 : 1 );
-    if ( bNew )
-        pPool->Put( rOrigItem );    //FIXME: AddRef?
+    pPool->Put( rOrigItem );    //FIXME: AddRef?
 
     // Add the transformation to the cache
     SfxItemModifyImpl aModify;
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index 9e1b969..bad0a85 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -154,7 +154,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
 
     // VersionMaps
     {
-        SfxMultiVarRecordWriter aVerRec( &rStream, 
SFX_ITEMPOOL_REC_VERSIONMAP, 0 );
+        SfxMultiVarRecordWriter aVerRec( &rStream, SFX_ITEMPOOL_REC_VERSIONMAP 
);
         for ( size_t nVerNo = 0; nVerNo < pImp->aVersions.size(); ++nVerNo )
         {
             aVerRec.NewContent();
@@ -176,7 +176,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
 
     // Pooled Items
     {
-        SfxMultiMixRecordWriter aWhichIdsRec( &rStream, 
SFX_ITEMPOOL_REC_WHICHIDS, 0 );
+        SfxMultiMixRecordWriter aWhichIdsRec( &rStream, 
SFX_ITEMPOOL_REC_WHICHIDS );
 
         // First write the atomic Items and then write the Sets (important 
when loading)
         for (int ft = 0 ; ft < 2 && !rStream.GetError(); ft++)
@@ -209,7 +209,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
                     rStream.WriteUInt32( nCount );
 
                     // Write Items
-                    SfxMultiMixRecordWriter aItemsRec( &rStream, 
SFX_ITEMPOOL_REC_ITEMS, 0 );
+                    SfxMultiMixRecordWriter aItemsRec( &rStream, 
SFX_ITEMPOOL_REC_ITEMS );
                     for ( size_t j = 0; j < nCount; ++j )
                     {
                         // Get Item
@@ -254,7 +254,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
     // Save the set Defaults (PoolDefaults)
     if ( !rStream.GetError() )
     {
-        SfxMultiMixRecordWriter aDefsRec( &rStream, SFX_ITEMPOOL_REC_DEFAULTS, 
0 );
+        SfxMultiMixRecordWriter aDefsRec( &rStream, SFX_ITEMPOOL_REC_DEFAULTS 
);
         sal_uInt16 nCount = GetSize_Impl();
         for ( sal_uInt16 n = 0; n < nCount; ++n )
         {
@@ -1187,7 +1187,7 @@ bool SfxItemPool::StoreItem( SvStream &rStream, const 
SfxPoolItem &rItem,
 /**
  * If pRefPool==-1 => do not put!
  */
-const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect,
+const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream,
                                           const SfxItemPool *pRefPool )
 {
     sal_uInt16 nWhich(0), nSlot(0); // nSurrogate;
@@ -1228,19 +1228,16 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream 
&rStream, bool bDirect,
 
     // Are we loading via surrogate?
     const SfxPoolItem *pItem = nullptr;
-    if ( !bDirect )
-    {
-        // WhichId known in this version?
-        if ( nWhich )
-            // Load surrogate and react if none present
-            pItem = LoadSurrogate( rStream, nWhich, nSlot, pRefPool );
-        else
-            // Else skip it
-            rStream.SeekRel( sizeof(sal_uInt16) );
-    }
+    // WhichId known in this version?
+    if ( nWhich )
+        // Load surrogate and react if none present
+        pItem = LoadSurrogate( rStream, nWhich, nSlot, pRefPool );
+    else
+        // Else skip it
+        rStream.SeekRel( sizeof(sal_uInt16) );
 
     // Is loaded directly (not via surrogate)?
-    if ( bDirect || ( nWhich && !pItem ) )
+    if ( nWhich && !pItem )
     {
         // bDirekt or not IsPoolable() => Load Item directly
         sal_uInt16 nVersion(0);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to