summaryrefslogtreecommitdiff
path: root/svl
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 /svl
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>
Diffstat (limited to 'svl')
-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
5 files changed, 20 insertions, 27 deletions
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);