From 04112bce506c60254cb1cb8536f942c8adb5c7d6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 13 Apr 2019 08:22:37 +0200 Subject: loplugin:sequentialassign in filter..fpicker Change-Id: I4ba0e1e982897bd570612f6cda8ba1e6a9fa5dbd Reviewed-on: https://gerrit.libreoffice.org/70700 Tested-by: Jenkins Reviewed-by: Noel Grandin --- filter/source/config/cache/filtercache.cxx | 9 +++------ filter/source/graphicfilter/idxf/dxf2mtf.cxx | 3 +-- filter/source/msfilter/msdffimp.cxx | 3 +-- filter/source/msfilter/svdfppt.cxx | 3 +-- filter/source/svg/svgexport.cxx | 3 +-- filter/source/t602/t602filter.cxx | 4 +--- filter/source/xsltdialog/xmlfiltertabpagexslt.cxx | 3 +-- forms/source/component/EventThread.cxx | 4 +--- forms/source/component/Filter.cxx | 3 +-- forms/source/xforms/resourcehelper.cxx | 3 +-- fpicker/source/office/iodlg.cxx | 6 ++---- 11 files changed, 14 insertions(+), 30 deletions(-) diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx index f717f109a26f..29c717491588 100644 --- a/filter/source/config/cache/filtercache.cxx +++ b/filter/source/config/cache/filtercache.cxx @@ -549,8 +549,7 @@ void FilterCache::addStatePropsToItem( EItemType eType, void FilterCache::removeStatePropsFromItem(CacheItem& rItem) { - CacheItem::iterator pIt; - pIt = rItem.find(PROPNAME_FINALIZED); + CacheItem::iterator pIt = rItem.find(PROPNAME_FINALIZED); if (pIt != rItem.end()) rItem.erase(pIt); pIt = rItem.find(PROPNAME_MANDATORY); @@ -1575,8 +1574,7 @@ CacheItem FilterCache::impl_loadItem(const css::uno::Reference< css::container:: { css::uno::Reference< css::beans::XMultiPropertySet > xPropSet( xItem, css::uno::UNO_QUERY_THROW); - css::uno::Sequence< css::uno::Any > aValues; - aValues = xPropSet->getPropertyValues(rNames); + css::uno::Sequence< css::uno::Any > aValues = xPropSet->getPropertyValues(rNames); for (sal_Int32 i = 0; i < aValues.getLength(); i++) aItem[rNames[i]] = aValues[i]; @@ -1600,8 +1598,7 @@ CacheItem FilterCache::impl_loadItem(const css::uno::Reference< css::container:: { css::uno::Reference< css::beans::XMultiPropertySet > xPropSet( xItem, css::uno::UNO_QUERY_THROW); - css::uno::Sequence< css::uno::Any > aValues; - aValues = xPropSet->getPropertyValues(rNames); + css::uno::Sequence< css::uno::Any > aValues = xPropSet->getPropertyValues(rNames); for (sal_Int32 i = 0; i < rNames.getLength(); i++) { diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx index d7e6b61fd7a8..74895eb4251f 100644 --- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx +++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx @@ -224,8 +224,7 @@ void DXF2GDIMetaFile::DrawLineEntity(const DXFLineEntity & rE, const DXFTransfor rTransform.Transform(rE.aP0,aP0); rTransform.Transform(rE.aP1,aP1); - DXFLineInfo aDXFLineInfo; - aDXFLineInfo=GetEntityDXFLineInfo(rE); + DXFLineInfo aDXFLineInfo=GetEntityDXFLineInfo(rE); LineInfo aLineInfo; aLineInfo = rTransform.Transform(aDXFLineInfo); diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 7ee80504a317..971655d18b5e 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -198,8 +198,7 @@ void Impl_OlePres::Write( SvStream & rStm ) if( MapUnit::Map100thMM != nMU ) { Size aPrefS( pMtf->GetPrefSize() ); - Size aS( aPrefS ); - aS = OutputDevice::LogicToLogic(aS, MapMode(nMU), MapMode(MapUnit::Map100thMM)); + Size aS = OutputDevice::LogicToLogic(aPrefS, MapMode(nMU), MapMode(MapUnit::Map100thMM)); pMtf->Scale( Fraction( aS.Width(), aPrefS.Width() ), Fraction( aS.Height(), aPrefS.Height() ) ); diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 7b4e365cfd69..770138117f05 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -2441,8 +2441,7 @@ bool SdrPowerPointImport::SeekToCurrentPage( DffRecordHeader* pRecHd ) const sal_uLong nPersist = (*pList)[ nCurrentPageNum ].aPersistAtom.nPsrReference; if ( nPersist > 0 && nPersist < nPersistPtrCnt ) { - sal_uLong nFPos = 0; - nFPos = pPersistPtr[ nPersist ]; + sal_uLong nFPos = pPersistPtr[ nPersist ]; if ( nFPos < nStreamLen ) { rStCtrl.Seek( nFPos ); diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index d5cb95f732ef..46e8ce4cd1d4 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -1296,8 +1296,7 @@ void SVGFilter::implExportAnimations() mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "Animations" ); SvXMLElementExport aDefsElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true ); - rtl::Reference< xmloff::AnimationsExporter > xAnimationsExporter; - xAnimationsExporter = new xmloff::AnimationsExporter( *mpSVGExport, xProps ); + rtl::Reference< xmloff::AnimationsExporter > xAnimationsExporter = new xmloff::AnimationsExporter( *mpSVGExport, xProps ); xAnimationsExporter->prepare( xRootNode ); xAnimationsExporter->exportAnimations( xRootNode ); } diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx index b6aeebe59ba0..0534361dd9ad 100644 --- a/filter/source/t602/t602filter.cxx +++ b/filter/source/t602/t602filter.cxx @@ -169,9 +169,7 @@ OUString T602ImportFilter::detect( Sequence& Descriptor) css::uno::Sequence< sal_Int8 > aData; const size_t numBytes = 4; - size_t numBytesRead = 0; - - numBytesRead = mxInputStream->readSomeBytes (aData, numBytes); + size_t numBytesRead = mxInputStream->readSomeBytes (aData, numBytes); if ((numBytesRead != numBytes) || (aData[0] != '@') || (aData[1] != 'C') || (aData[2] != 'T') || (aData[3] != ' ')) diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx index 8bd97ca2823b..ca879c93a4fa 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx +++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx @@ -102,8 +102,7 @@ void XMLFilterTabPageXSLT::SetURL( URLBox& rURLBox, const OUString& rURL ) } else if( !rURL.isEmpty() ) { - OUString aURL( rURL ); - aURL = URIHelper::SmartRel2Abs( INetURLObject(sInstPath), aURL, Link(), false ); + OUString aURL = URIHelper::SmartRel2Abs( INetURLObject(sInstPath), rURL, Link(), false ); osl::FileBase::getSystemPathFromFileURL( aURL, aPath ); rURLBox.SetBaseURL( aURL ); diff --git a/forms/source/component/EventThread.cxx b/forms/source/component/EventThread.cxx index 84b9b4798b83..357888111991 100644 --- a/forms/source/component/EventThread.cxx +++ b/forms/source/component/EventThread.cxx @@ -57,9 +57,7 @@ OComponentEventThread::~OComponentEventThread() Any SAL_CALL OComponentEventThread::queryInterface(const Type& _rType) { - Any aReturn; - - aReturn = OWeakObject::queryInterface(_rType); + Any aReturn = OWeakObject::queryInterface(_rType); if (!aReturn.hasValue()) aReturn = ::cppu::queryInterface(_rType, diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index fb56cbdd3c8a..ccaa7f209687 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -519,8 +519,7 @@ namespace frm if ( m_aText != aText ) { // check the text with the SQL-Parser - OUString aNewText(aText); - aNewText = aNewText.trim(); + OUString aNewText = aText.trim(); if ( !aNewText.isEmpty() ) { ::dbtools::OPredicateInputController aPredicateInput( m_xContext, m_xConnection, getParseContext() ); diff --git a/forms/source/xforms/resourcehelper.cxx b/forms/source/xforms/resourcehelper.cxx index 0e3cbdf00b66..371b707f8c85 100644 --- a/forms/source/xforms/resourcehelper.cxx +++ b/forms/source/xforms/resourcehelper.cxx @@ -54,8 +54,7 @@ OUString getResource(const char* pResourceId, OUString sResource = frm::ResourceManager::loadString(pResourceId); OSL_ENSURE( !sResource.isEmpty(), "resource not found?" ); - OUString sString( sResource ); - sString = sString.replaceAll( "$1", rInfo1 ); + OUString sString = sResource.replaceAll( "$1", rInfo1 ); sString = sString.replaceAll( "$2", rInfo2 ); sString = sString.replaceAll( "$3", rInfo3 ); return sString; diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 7f561b56059f..8382977e9a37 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -2235,13 +2235,11 @@ bool SvtFileDialog::IsolateFilterFromPath_Impl( OUString& rPath, OUString& rFilt } // cut off filter - rFilter = aReversePath; - rFilter = rFilter.copy( 0, nPathTokenPos ); + rFilter = aReversePath.copy( 0, nPathTokenPos ); rFilter = comphelper::string::reverseString(rFilter); // determine folder - rPath = aReversePath; - rPath = rPath.copy( nPathTokenPos ); + rPath = aReversePath.copy( nPathTokenPos ); rPath = comphelper::string::reverseString(rPath); } else -- cgit