summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-14 16:40:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-15 08:37:34 +0200
commit897493fbd34a1bd10320767b48cbf04d422f89b3 (patch)
tree6d35dd000343e533cf6b3eef2f816533bea4b048
parentloplugin:sequentialassign in test..tools (diff)
downloadcore-897493fbd34a1bd10320767b48cbf04d422f89b3.tar.gz
core-897493fbd34a1bd10320767b48cbf04d422f89b3.zip
loplugin:sequentialassign in ucb..vbahelper
Change-Id: I0fff9ee06225d4ff2e9c0611b1b11f1d3b896be2 Reviewed-on: https://gerrit.libreoffice.org/70733 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--ucb/source/cacher/cachedcontentresultset.cxx3
-rw-r--r--ucb/source/cacher/cachedcontentresultsetstub.cxx3
-rw-r--r--ucb/source/cacher/cacheddynamicresultset.cxx3
-rw-r--r--ucb/source/cacher/cacheddynamicresultsetstub.cxx3
-rw-r--r--ucb/source/sorter/sortdynres.cxx3
-rw-r--r--ucb/source/ucp/gio/gio_content.cxx3
-rw-r--r--ucb/source/ucp/hierarchy/hierarchycontent.cxx3
-rw-r--r--ucb/source/ucp/package/pkgcontent.cxx4
-rw-r--r--ucb/source/ucp/tdoc/tdoc_content.cxx3
-rw-r--r--ucb/source/ucp/webdav-neon/DAVTypes.cxx12
-rw-r--r--ucb/source/ucp/webdav-neon/PropfindCache.cxx6
-rw-r--r--ucb/source/ucp/webdav-neon/webdavcontent.cxx3
-rw-r--r--unotools/source/config/compatibility.cxx3
-rw-r--r--unotools/source/config/optionsdlg.cxx3
-rw-r--r--unotools/source/ucbhelper/ucblockbytes.cxx3
-rw-r--r--uui/source/sslwarndlg.cxx5
-rw-r--r--vbahelper/source/msforms/vbatextbox.cxx9
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarhelper.cxx4
-rw-r--r--vbahelper/source/vbahelper/vbafontbase.cxx3
-rw-r--r--vbahelper/source/vbahelper/vbashape.cxx6
-rw-r--r--vbahelper/source/vbahelper/vbashapes.cxx3
21 files changed, 29 insertions, 59 deletions
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx
index c9592879397f..0765e2baed3b 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -2136,8 +2136,7 @@ Reference< XResultSet > SAL_CALL CachedContentResultSetFactory
const Reference< XResultSet > & xSource,
const Reference< XContentIdentifierMapping > & xMapping )
{
- Reference< XResultSet > xRet;
- xRet = new CachedContentResultSet( m_xContext, xSource, xMapping );
+ Reference< XResultSet > xRet = new CachedContentResultSet( m_xContext, xSource, xMapping );
return xRet;
}
diff --git a/ucb/source/cacher/cachedcontentresultsetstub.cxx b/ucb/source/cacher/cachedcontentresultsetstub.cxx
index a648beac5e76..c410c19dfa68 100644
--- a/ucb/source/cacher/cachedcontentresultsetstub.cxx
+++ b/ucb/source/cacher/cachedcontentresultsetstub.cxx
@@ -572,8 +572,7 @@ Reference< XResultSet > SAL_CALL CachedContentResultSetStubFactory
{
if( xSource.is() )
{
- Reference< XResultSet > xRet;
- xRet = new CachedContentResultSetStub( xSource );
+ Reference< XResultSet > xRet = new CachedContentResultSetStub( xSource );
return xRet;
}
return nullptr;
diff --git a/ucb/source/cacher/cacheddynamicresultset.cxx b/ucb/source/cacher/cacheddynamicresultset.cxx
index 9f7f5e438b70..ba1f72616071 100644
--- a/ucb/source/cacher/cacheddynamicresultset.cxx
+++ b/ucb/source/cacher/cacheddynamicresultset.cxx
@@ -227,8 +227,7 @@ Reference< XDynamicResultSet > SAL_CALL CachedDynamicResultSetFactory
const Reference< XDynamicResultSet > & SourceStub
, const Reference< XContentIdentifierMapping > & ContentIdentifierMapping )
{
- Reference< XDynamicResultSet > xRet;
- xRet = new CachedDynamicResultSet( SourceStub, ContentIdentifierMapping, m_xContext );
+ Reference< XDynamicResultSet > xRet = new CachedDynamicResultSet( SourceStub, ContentIdentifierMapping, m_xContext );
return xRet;
}
diff --git a/ucb/source/cacher/cacheddynamicresultsetstub.cxx b/ucb/source/cacher/cacheddynamicresultsetstub.cxx
index 679ddbc0823a..927a6ac4e08c 100644
--- a/ucb/source/cacher/cacheddynamicresultsetstub.cxx
+++ b/ucb/source/cacher/cacheddynamicresultsetstub.cxx
@@ -218,8 +218,7 @@ Reference< XDynamicResultSet > SAL_CALL CachedDynamicResultSetStubFactory
::createCachedDynamicResultSetStub(
const Reference< XDynamicResultSet > & Source )
{
- Reference< XDynamicResultSet > xRet;
- xRet = new CachedDynamicResultSetStub( Source, m_xContext );
+ Reference< XDynamicResultSet > xRet = new CachedDynamicResultSetStub( Source, m_xContext );
return xRet;
}
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx
index e5b34599ea0d..06cd751eaf24 100644
--- a/ucb/source/sorter/sortdynres.cxx
+++ b/ucb/source/sorter/sortdynres.cxx
@@ -473,8 +473,7 @@ SortedDynamicResultSetFactory::createSortedDynamicResultSet(
const Sequence< NumberedSortingInfo > & Info,
const Reference< XAnyCompareFactory > & CompareFactory )
{
- Reference< XDynamicResultSet > xRet;
- xRet = new SortedDynamicResultSet( Source, Info, CompareFactory, m_xContext );
+ Reference< XDynamicResultSet > xRet = new SortedDynamicResultSet( Source, Info, CompareFactory, m_xContext );
return xRet;
}
diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx
index 7f363f5e2921..b1b51551ef15 100644
--- a/ucb/source/ucp/gio/gio_content.cxx
+++ b/ucb/source/ucp/gio/gio_content.cxx
@@ -584,8 +584,7 @@ void Content::queryChildren( ContentRefList& rChildren )
// Is aURL a prefix of aChildURL?
if ( ( aChildURL.getLength() > nLen ) && aChildURL.startsWith( aURL ) )
{
- sal_Int32 nPos = nLen;
- nPos = aChildURL.indexOf( '/', nPos );
+ sal_Int32 nPos = aChildURL.indexOf( '/', nLen );
if ( ( nPos == -1 ) || ( nPos == ( aChildURL.getLength() - 1 ) ) )
{
diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
index ec47a14f1f1c..056527010065 100644
--- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
@@ -751,8 +751,7 @@ void HierarchyContent::queryChildren( HierarchyContentRefVector& rChildren )
if ( ( aChildURL.getLength() > nLen ) &&
( aChildURL.startsWith( aURL ) ) )
{
- sal_Int32 nPos = nLen;
- nPos = aChildURL.indexOf( '/', nPos );
+ sal_Int32 nPos = aChildURL.indexOf( '/', nLen );
if ( ( nPos == -1 ) ||
( nPos == ( aChildURL.getLength() - 1 ) ) )
diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx
index e428044625e8..2facec6e88a9 100644
--- a/ucb/source/ucp/package/pkgcontent.cxx
+++ b/ucb/source/ucp/package/pkgcontent.cxx
@@ -214,9 +214,7 @@ Content* Content::create(
getContentType( aURI.getScheme(), false ) ) )
return nullptr;
- uno::Reference< container::XHierarchicalNameAccess > xPackage;
-
- xPackage = pProvider->createPackage( aURI );
+ uno::Reference< container::XHierarchicalNameAccess > xPackage = pProvider->createPackage( aURI );
uno::Reference< ucb::XContentIdentifier > xId
= new ::ucbhelper::ContentIdentifier( aURI.getUri() );
diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx
index 688662e30a95..e74039e9a0d8 100644
--- a/ucb/source/ucp/tdoc/tdoc_content.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_content.cxx
@@ -738,8 +738,7 @@ void Content::queryChildren( ContentRefList& rChildren )
if ( ( aChildURL.getLength() > nLen ) &&
( aChildURL.startsWith( aURL ) ) )
{
- sal_Int32 nPos = nLen;
- nPos = aChildURL.indexOf( '/', nPos );
+ sal_Int32 nPos = aChildURL.indexOf( '/', nLen );
if ( ( nPos == -1 ) ||
( nPos == ( aChildURL.getLength() - 1 ) ) )
diff --git a/ucb/source/ucp/webdav-neon/DAVTypes.cxx b/ucb/source/ucp/webdav-neon/DAVTypes.cxx
index 2cd4ec27ef11..6cf4a01b304a 100644
--- a/ucb/source/ucp/webdav-neon/DAVTypes.cxx
+++ b/ucb/source/ucp/webdav-neon/DAVTypes.cxx
@@ -107,8 +107,7 @@ bool DAVOptionsCache::getDAVOptions( const OUString & rURL, DAVOptions & rDAVOpt
normalizeURLLastChar( aEncodedUrl );
// search the URL in the static map
- DAVOptionsMap::iterator it;
- it = m_aTheCache.find( aEncodedUrl );
+ DAVOptionsMap::iterator it = m_aTheCache.find( aEncodedUrl );
if ( it == m_aTheCache.end() )
return false;
else
@@ -134,8 +133,7 @@ void DAVOptionsCache::removeDAVOptions( const OUString & rURL )
OUString aEncodedUrl( ucb_impl::urihelper::encodeURI( NeonUri::unescape( rURL ) ) );
normalizeURLLastChar( aEncodedUrl );
- DAVOptionsMap::iterator it;
- it = m_aTheCache.find( aEncodedUrl );
+ DAVOptionsMap::iterator it = m_aTheCache.find( aEncodedUrl );
if ( it != m_aTheCache.end() )
{
m_aTheCache.erase( it );
@@ -156,8 +154,7 @@ void DAVOptionsCache::addDAVOptions( DAVOptions & rDAVOptions, const sal_uInt32
rDAVOptions.setRedirectedURL( aRedirURL );
// check if already cached
- DAVOptionsMap::iterator it;
- it = m_aTheCache.find( aEncodedUrl );
+ DAVOptionsMap::iterator it = m_aTheCache.find( aEncodedUrl );
if ( it != m_aTheCache.end() )
{ // already in cache, check LifeTime
if ( (*it).second.getRequestedTimeLife() == nLifeTime )
@@ -177,8 +174,7 @@ void DAVOptionsCache::setHeadAllowed( const OUString & rURL, const bool HeadAllo
OUString aEncodedUrl( ucb_impl::urihelper::encodeURI( NeonUri::unescape( rURL ) ) );
normalizeURLLastChar( aEncodedUrl );
- DAVOptionsMap::iterator it;
- it = m_aTheCache.find( aEncodedUrl );
+ DAVOptionsMap::iterator it = m_aTheCache.find( aEncodedUrl );
if ( it != m_aTheCache.end() )
{
// first check for stale
diff --git a/ucb/source/ucp/webdav-neon/PropfindCache.cxx b/ucb/source/ucp/webdav-neon/PropfindCache.cxx
index 546c6c8545f7..a54003661ec0 100644
--- a/ucb/source/ucp/webdav-neon/PropfindCache.cxx
+++ b/ucb/source/ucp/webdav-neon/PropfindCache.cxx
@@ -43,8 +43,7 @@ namespace webdav_ucp
{
// search the URL in the static map
osl::MutexGuard aGuard( m_aMutex );
- PropNameCache::const_iterator it;
- it = m_aTheCache.find( rURL );
+ PropNameCache::const_iterator it = m_aTheCache.find( rURL );
if ( it == m_aTheCache.end() )
return false;
else
@@ -67,8 +66,7 @@ namespace webdav_ucp
void PropertyNamesCache::removeCachedPropertyNames( const OUString& rURL )
{
osl::MutexGuard aGuard( m_aMutex );
- PropNameCache::const_iterator it;
- it = m_aTheCache.find( rURL );
+ PropNameCache::const_iterator it = m_aTheCache.find( rURL );
if ( it != m_aTheCache.end() )
{
m_aTheCache.erase( it );
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index 8ef0956b2eff..9c139fb4a30d 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -2403,8 +2403,7 @@ void Content::queryChildren( ContentRefList& rChildren )
if ( ( aChildURL.getLength() > nLen ) &&
( aChildURL.startsWith( aURL ) ) )
{
- sal_Int32 nPos = nLen;
- nPos = aChildURL.indexOf( '/', nPos );
+ sal_Int32 nPos = aChildURL.indexOf( '/', nLen );
if ( ( nPos == -1 ) ||
( nPos == ( aChildURL.getLength() - 1 ) ) )
diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx
index 469a944b9e8f..358decc82041 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -298,8 +298,7 @@ Sequence< OUString > SvtCompatibilityOptions_Impl::impl_GetPropertyNames( Sequen
// Copy entries to destination and expand every item with 2 supported sub properties.
for ( sal_Int32 nSourceStep = 0; nSourceStep < nSourceCount; ++nSourceStep )
{
- OUString sFixPath;
- sFixPath = SETNODE_ALLFILEFORMATS;
+ OUString sFixPath = SETNODE_ALLFILEFORMATS;
sFixPath += PATHDELIMITER;
sFixPath += rItems[ nSourceStep ];
sFixPath += PATHDELIMITER;
diff --git a/unotools/source/config/optionsdlg.cxx b/unotools/source/config/optionsdlg.cxx
index ec251ec8b3a0..93cfe5d1a0bc 100644
--- a/unotools/source/config/optionsdlg.cxx
+++ b/unotools/source/config/optionsdlg.cxx
@@ -137,8 +137,7 @@ void SvtOptionsDlgOptions_Impl::ReadNode( const OUString& _rNode, NodeType _eTyp
if ( _eType != NT_Option )
lResult[1] = sNode + sSet;
- Sequence< Any > aValues;
- aValues = GetProperties( lResult );
+ Sequence< Any > aValues = GetProperties( lResult );
bool bHide = false;
if ( aValues[0] >>= bHide )
m_aOptionNodeList.emplace( sNode, bHide );
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx
index 61e02c87072e..40b42ad1538b 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -682,9 +682,8 @@ static bool UCBOpenContentSync(
sal_uInt32 nTimeout(5000); // initially 5000 milliSec
while(!bResultAchieved) {
- Moderator::Result res;
// try to get the result for with timeout
- res = pMod->getResult(nTimeout);
+ Moderator::Result res = pMod->getResult(nTimeout);
switch(res.type) {
case Moderator::ResultType::STREAM:
diff --git a/uui/source/sslwarndlg.cxx b/uui/source/sslwarndlg.cxx
index a1c340cc0afe..a6c1e1a39b38 100644
--- a/uui/source/sslwarndlg.cxx
+++ b/uui/source/sslwarndlg.cxx
@@ -28,9 +28,8 @@ using namespace css;
IMPL_LINK_NOARG(SSLWarnDialog, ViewCertHdl, weld::Button&, void)
{
- uno::Reference< css::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
-
- xDocumentDigitalSignatures = css::security::DocumentDigitalSignatures::createDefault( m_xContext );
+ uno::Reference< css::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures
+ = css::security::DocumentDigitalSignatures::createDefault( m_xContext );
xDocumentDigitalSignatures->setParentWindow(m_xDialog->GetXWindow());
xDocumentDigitalSignatures->showCertificate(m_rXCert);
}
diff --git a/vbahelper/source/msforms/vbatextbox.cxx b/vbahelper/source/msforms/vbatextbox.cxx
index 3f0eba580934..4c2e7a89b73d 100644
--- a/vbahelper/source/msforms/vbatextbox.cxx
+++ b/vbahelper/source/msforms/vbatextbox.cxx
@@ -50,8 +50,7 @@ ScVbaTextBox::setValue( const uno::Any& _value )
OUString SAL_CALL
ScVbaTextBox::getText()
{
- uno::Any aValue;
- aValue = m_xProps->getPropertyValue( "Text" );
+ uno::Any aValue = m_xProps->getPropertyValue( "Text" );
OUString sString;
aValue >>= sString;
return sString;
@@ -75,8 +74,7 @@ ScVbaTextBox::setText( const OUString& _text )
sal_Int32 SAL_CALL
ScVbaTextBox::getMaxLength()
{
- uno::Any aValue;
- aValue = m_xProps->getPropertyValue( "MaxTextLen" );
+ uno::Any aValue = m_xProps->getPropertyValue( "MaxTextLen" );
sal_Int16 nMaxLength = 0;
aValue >>= nMaxLength;
return static_cast<sal_Int32>(nMaxLength);
@@ -93,8 +91,7 @@ ScVbaTextBox::setMaxLength( sal_Int32 _maxlength )
sal_Bool SAL_CALL
ScVbaTextBox::getMultiline()
{
- uno::Any aValue;
- aValue = m_xProps->getPropertyValue( "MultiLine" );
+ uno::Any aValue = m_xProps->getPropertyValue( "MultiLine" );
bool bRet = false;
aValue >>= bRet;
return bRet;
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index 1406376ed307..0ffd29eb2e1c 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -180,10 +180,8 @@ bool VbaCommandBarHelper::hasToolbar( const OUString& sResourceUrl, const OUStri
// return the resource url if found
OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const OUString& sName )
{
- OUString sResourceUrl;
-
// check if it is an buildin toolbar
- sResourceUrl = MSO2OOCommandbarHelper::getMSO2OOCommandbarHelper()->findBuildinToolbar( sName );
+ OUString sResourceUrl = MSO2OOCommandbarHelper::getMSO2OOCommandbarHelper()->findBuildinToolbar( sName );
if( !sResourceUrl.isEmpty() )
return sResourceUrl;
diff --git a/vbahelper/source/vbahelper/vbafontbase.cxx b/vbahelper/source/vbahelper/vbafontbase.cxx
index 408801e947d0..95359aa78637 100644
--- a/vbahelper/source/vbahelper/vbafontbase.cxx
+++ b/vbahelper/source/vbahelper/vbafontbase.cxx
@@ -259,8 +259,7 @@ VbaFontBase::getName()
uno::Any
VbaFontBase::getColor()
{
- uno::Any aAny;
- aAny = OORGBToXLRGB( mxFont->getPropertyValue( VBAFONTBASE_PROPNAME( "CharColor", "TextColor" ) ) );
+ uno::Any aAny = OORGBToXLRGB( mxFont->getPropertyValue( VBAFONTBASE_PROPNAME( "CharColor", "TextColor" ) ) );
return aAny;
}
diff --git a/vbahelper/source/vbahelper/vbashape.cxx b/vbahelper/source/vbahelper/vbashape.cxx
index 8f45589740b7..709957bfcb27 100644
--- a/vbahelper/source/vbahelper/vbashape.cxx
+++ b/vbahelper/source/vbahelper/vbashape.cxx
@@ -283,8 +283,7 @@ ScVbaShape::setLeft( double _left )
}
catch( uno::Exception& )
{
- sal_Int32 nLeft = 0;
- nLeft = Millimeter::getInHundredthsOfOneMillimeter( _left );
+ sal_Int32 nLeft = Millimeter::getInHundredthsOfOneMillimeter( _left );
m_xPropertySet->setPropertyValue( "HoriOrientPosition" , uno::makeAny( nLeft ) );
}
}
@@ -315,8 +314,7 @@ ScVbaShape::setTop( double _top )
}
catch( uno::Exception& )
{
- sal_Int32 nTop = 0;
- nTop = Millimeter::getInHundredthsOfOneMillimeter( _top );
+ sal_Int32 nTop = Millimeter::getInHundredthsOfOneMillimeter( _top );
m_xPropertySet->setPropertyValue( "VertOrientPosition" , uno::makeAny( nTop ) );
}
}
diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx
index 74fb90504bcf..873f01a2ea03 100644
--- a/vbahelper/source/vbahelper/vbashapes.cxx
+++ b/vbahelper/source/vbahelper/vbashapes.cxx
@@ -139,8 +139,7 @@ ScVbaShapes::getShapesByArrayIndices( const uno::Any& Index )
throw uno::RuntimeException();
const uno::Reference< script::XTypeConverter >& xConverter = getTypeConverter(mxContext);
- uno::Any aConverted;
- aConverted = xConverter->convertTo( Index, cppu::UnoType<uno::Sequence< uno::Any >>::get() );
+ uno::Any aConverted = xConverter->convertTo( Index, cppu::UnoType<uno::Sequence< uno::Any >>::get() );
uno::Sequence< uno::Any > sIndices;
aConverted >>= sIndices;