summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-17 09:45:22 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-03-17 09:18:40 +0000
commit07da25064f75cdf7163669f9bf860a9ee2f8b33c (patch)
tree85f4427a9e2832b4522f53b8c62a4a837b6759d9
parent16fc620a2206292ed27d2298bc2fa60fc3e718a8 (diff)
loplugin:constantparam in svl
Change-Id: If23e43beb401047825641817e09d7fdeb904f9d9 Reviewed-on: https://gerrit.libreoffice.org/23317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--include/svl/filerec.hxx19
-rw-r--r--include/svl/itempool.hxx1
-rw-r--r--include/svl/itemprop.hxx4
-rw-r--r--include/svl/poolcach.hxx2
-rw-r--r--sc/source/core/data/attarray.cxx2
-rw-r--r--sc/source/core/data/column.cxx2
-rw-r--r--svl/source/filerec/filerec.cxx5
-rw-r--r--svl/source/items/itemprop.cxx3
-rw-r--r--svl/source/items/itemset.cxx2
-rw-r--r--svl/source/items/poolcach.cxx8
-rw-r--r--svl/source/items/poolio.cxx29
11 files changed, 32 insertions, 45 deletions
diff --git a/include/svl/filerec.hxx b/include/svl/filerec.hxx
index 107dd61ceb1f..6581610fa472 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 2ca544d45808..f3ef335d3aa2 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 1c8923f4cee1..f9f332b816d5 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 df2fce746fe5..6c55fae31b2c 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 816069a5ed74..ca61b3972d88 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 95d9c342a0f2..ce2ab47493b5 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 9379b6afa1be..e1f9db79dbb7 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 753602cd4090..2fe99b544210 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 2772226bf20c..d55f9c504753 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 90104daef35b..994884baedf5 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 9e1b969036d9..bad0a854ba5c 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);