summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-20 09:26:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-20 11:54:20 +0200
commit8ed77fae3e5e9e5f7409e03d5e4586f428a65c86 (patch)
treee4dea7abf2deced1aeb88eb8b570a75271cb9150 /comphelper
parent4d7054947d87174decf12ad204c09532f33599f8 (diff)
loplugin:oncevar in codemaker..connectivity
Change-Id: Ia479d9d3d459a699dfc5c1148d01c35e8bc973bd Reviewed-on: https://gerrit.libreoffice.org/39000 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/container/embeddedobjectcontainer.cxx3
-rw-r--r--comphelper/source/property/ChainablePropertySet.cxx4
-rw-r--r--comphelper/source/property/MasterPropertySet.cxx4
-rw-r--r--comphelper/source/property/opropertybag.cxx2
-rw-r--r--comphelper/source/streaming/oslfile2streamwrap.cxx3
5 files changed, 5 insertions, 11 deletions
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index 89068adafc19..2a045edf863c 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -214,12 +214,11 @@ void EmbeddedObjectContainer::CloseEmbeddedObjects()
OUString EmbeddedObjectContainer::CreateUniqueObjectName()
{
- OUString aPersistName("Object ");
OUString aStr;
sal_Int32 i=1;
do
{
- aStr = aPersistName + OUString::number( i++ );
+ aStr = "Object " + OUString::number( i++ );
}
while( HasEmbeddedObject( aStr ) );
// TODO/LATER: should we consider deleted objects?
diff --git a/comphelper/source/property/ChainablePropertySet.cxx b/comphelper/source/property/ChainablePropertySet.cxx
index c847b393030b..258b6dad0495 100644
--- a/comphelper/source/property/ChainablePropertySet.cxx
+++ b/comphelper/source/property/ChainablePropertySet.cxx
@@ -194,9 +194,7 @@ PropertyState SAL_CALL ChainablePropertySet::getPropertyState( const OUString& P
if( aIter == mxInfo->maMap.end())
throw UnknownPropertyException( PropertyName, static_cast< XPropertySet* >( this ) );
- PropertyState aState(PropertyState_AMBIGUOUS_VALUE);
-
- return aState;
+ return PropertyState_AMBIGUOUS_VALUE;
}
Sequence< PropertyState > SAL_CALL ChainablePropertySet::getPropertyStates( const Sequence< OUString >& rPropertyNames )
diff --git a/comphelper/source/property/MasterPropertySet.cxx b/comphelper/source/property/MasterPropertySet.cxx
index f4df2305e6c6..3f83b12b2be4 100644
--- a/comphelper/source/property/MasterPropertySet.cxx
+++ b/comphelper/source/property/MasterPropertySet.cxx
@@ -322,8 +322,6 @@ PropertyState SAL_CALL MasterPropertySet::getPropertyState( const OUString& Prop
if( aIter == mxInfo->maMap.end())
throw UnknownPropertyException( PropertyName, static_cast< XPropertySet* >( this ) );
- PropertyState aState(PropertyState_AMBIGUOUS_VALUE);
-
// 0 means it's one of ours !
if ( (*aIter).second->mnMapId != 0 )
{
@@ -335,7 +333,7 @@ PropertyState SAL_CALL MasterPropertySet::getPropertyState( const OUString& Prop
xMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpMutex) );
}
- return aState;
+ return PropertyState_AMBIGUOUS_VALUE;
}
Sequence< PropertyState > SAL_CALL MasterPropertySet::getPropertyStates( const Sequence< OUString >& rPropertyNames )
diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx
index 4fbdb8bfe96e..e36507a599ed 100644
--- a/comphelper/source/property/opropertybag.cxx
+++ b/comphelper/source/property/opropertybag.cxx
@@ -478,7 +478,7 @@ namespace comphelper
if ( m_bAutoAddProperties )
{
// add the property
- sal_Int16 nAttributes = PropertyAttribute::BOUND | PropertyAttribute::REMOVABLE | PropertyAttribute::MAYBEDEFAULT;
+ sal_Int16 const nAttributes = PropertyAttribute::BOUND | PropertyAttribute::REMOVABLE | PropertyAttribute::MAYBEDEFAULT;
addProperty( *pName, nAttributes, pProperty->Value );
continue;
}
diff --git a/comphelper/source/streaming/oslfile2streamwrap.cxx b/comphelper/source/streaming/oslfile2streamwrap.cxx
index 888e0134f799..8a97e038e89e 100644
--- a/comphelper/source/streaming/oslfile2streamwrap.cxx
+++ b/comphelper/source/streaming/oslfile2streamwrap.cxx
@@ -107,8 +107,7 @@ sal_Int32 SAL_CALL OSLInputStreamWrapper::available()
if (eError != FileBase::E_None)
throw css::io::NotConnectedException(OUString(), static_cast<css::uno::XWeak*>(this));
- sal_uInt64 nDummy = 0;
- eError = m_pFile->setPos(osl_Pos_End, nDummy);
+ eError = m_pFile->setPos(osl_Pos_End, 0);
if (eError != FileBase::E_None)
throw css::io::NotConnectedException(OUString(),static_cast<css::uno::XWeak*>(this));