diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-14 16:42:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-15 08:38:02 +0200 |
commit | f87fab6310bee5a8df2a95ebc962072bdeb5faff (patch) | |
tree | 1412a98e0105f811ccb2f399e87c3ed2fe4c0d23 /xmloff | |
parent | b52f309f2b9037ee53ab8ac2d66967c012ba82f1 (diff) |
loplugin:sequentialassign in writerfilter..xmlsecurity
Change-Id: I41028c704eca08b71746c3c87e38926b95449775
Reviewed-on: https://gerrit.libreoffice.org/70735
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/draw/XMLNumberStyles.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlexp.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/forms/layerimport.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/forms/propertyexport.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/script/XMLStarBasicExportHandler.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/style/TransGradientStyle.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/XMLFontAutoStylePool.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/XMLIndexMarkExport.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/XMLLineNumberingExport.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/text/XMLSectionExport.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextHeaderFooterContext.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/text/txtftne.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/txtvfldi.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/transform/EventOOoTContext.cxx | 8 |
17 files changed, 21 insertions, 51 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index fb22ca058d95..337864d809fb 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -2913,8 +2913,7 @@ void SchXMLExportHelper_Impl::exportRegressionCurve( bool bShowRSquared = false; bool bExportEquation = false; - OUString aService; - aService = xServiceName->getServiceName(); + OUString aService = xServiceName->getServiceName(); std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( xProperties ); @@ -3021,9 +3020,7 @@ void SchXMLExportHelper_Impl::exportErrorBar( const Reference<beans::XPropertySe try { - Any aAny; - - aAny = xSeriesProp->getPropertyValue( bYError ? OUString("ErrorBarY") : OUString("ErrorBarX") ); + Any aAny = xSeriesProp->getPropertyValue( bYError ? OUString("ErrorBarY") : OUString("ErrorBarX") ); aAny >>= xErrorBarProp; if ( xErrorBarProp.is() ) diff --git a/xmloff/source/draw/XMLNumberStyles.cxx b/xmloff/source/draw/XMLNumberStyles.cxx index 45a161a81421..79a5c600deb9 100644 --- a/xmloff/source/draw/XMLNumberStyles.cxx +++ b/xmloff/source/draw/XMLNumberStyles.cxx @@ -339,10 +339,8 @@ static void SdXMLExportDataStyleNumber( SdXMLExport& rExport, SdXMLDataStyleNumb static void SdXMLExportStyle( SdXMLExport& rExport, const SdXMLFixedDataStyle* pStyle, const SdXMLFixedDataStyle* pStyle2 = nullptr ) { - OUString sAttrValue; - // name - sAttrValue = OUString::createFromAscii( pStyle->mpName ); + OUString sAttrValue = OUString::createFromAscii( pStyle->mpName ); if( pStyle2 ) sAttrValue += OUString::createFromAscii( pStyle2->mpName ); diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 7075dc273eec..78312ff011c3 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -681,9 +681,7 @@ bool SdXMLExport::ImpPrepAutoLayoutInfo(const Reference<XDrawPage>& xPage, OUStr if(xPropSet.is()) { sal_uInt16 nType = sal_uInt16(); - Any aAny; - - aAny = xPropSet->getPropertyValue("Layout"); + Any aAny = xPropSet->getPropertyValue("Layout"); if(aAny >>= nType) { if(ImpXMLAutoLayoutInfo::IsCreateNecessary(nType)) diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx index 332da3c6708e..ce19c3eb657d 100644 --- a/xmloff/source/forms/layerimport.cxx +++ b/xmloff/source/forms/layerimport.cxx @@ -376,8 +376,7 @@ void OFormLayerXMLImport_Impl::startPage(const Reference< XDrawPage >& _rxDrawPa return; // add a new entry to our page map - ::std::pair< MapDrawPage2Map::iterator, bool > aPagePosition; - aPagePosition = m_aControlIds.emplace(_rxDrawPage, MapString2PropertySet()); + ::std::pair< MapDrawPage2Map::iterator, bool > aPagePosition = m_aControlIds.emplace(_rxDrawPage, MapString2PropertySet()); OSL_ENSURE(aPagePosition.second, "OFormLayerXMLImport_Impl::startPage: already imported this page!"); m_aCurrentPageIds = aPagePosition.first; } diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index 80d5a97f0752..708848670c1f 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -148,8 +148,7 @@ namespace xmloff bool bIsEmptyValue = TypeClass_VOID == aValue.getValueType().getTypeClass(); if ( bIsEmptyValue ) { - css::beans::Property aPropDesc; - aPropDesc = m_xPropertyInfo->getPropertyByName( rProperty ); + css::beans::Property aPropDesc = m_xPropertyInfo->getPropertyByName( rProperty ); aExportType = aPropDesc.Type; } token::XMLTokenEnum eValueType = implGetPropertyXMLType( aExportType ); diff --git a/xmloff/source/script/XMLStarBasicExportHandler.cxx b/xmloff/source/script/XMLStarBasicExportHandler.cxx index 398908e52454..50bc55e4fa5e 100644 --- a/xmloff/source/script/XMLStarBasicExportHandler.cxx +++ b/xmloff/source/script/XMLStarBasicExportHandler.cxx @@ -79,12 +79,9 @@ void XMLStarBasicExportHandler::Export( if( !sLocation.isEmpty() ) { - OUStringBuffer sTmp( sLocation.getLength() + sName.getLength() + 1 ); - sTmp = sLocation; - sTmp.append( ':' ); - sTmp.append( sName ); + OUString sTmp = sLocation + ":" + sName; rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_MACRO_NAME, - sTmp.makeStringAndClear()); + sTmp); } else { diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx index 9abd72e98725..fb24ef79610e 100644 --- a/xmloff/source/style/TransGradientStyle.cxx +++ b/xmloff/source/style/TransGradientStyle.cxx @@ -247,10 +247,8 @@ void XMLTransGradientStyleExport::exportXML( rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CY, aStrValue ); } - Color aColor; - // Transparency start - aColor = Color(aGradient.StartColor); + Color aColor = Color(aGradient.StartColor); sal_Int32 aStartValue = 100 - static_cast<sal_Int32>(((aColor.GetRed() + 1) * 100) / 255); ::sax::Converter::convertPercent( aOut, aStartValue ); aStrValue = aOut.makeStringAndClear(); diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index 054ce59a122c..e0d11241be4d 100644 --- a/xmloff/source/style/XMLFontAutoStylePool.cxx +++ b/xmloff/source/style/XMLFontAutoStylePool.cxx @@ -355,8 +355,7 @@ std::unordered_set<OUString> XMLFontAutoStylePool::getUsedFontList() GetExport().collectAutoStyles(); // Check auto-styles for fonts - std::vector<xmloff::AutoStyleEntry> aAutoStyleEntries; - aAutoStyleEntries = GetExport().GetAutoStylePool()->GetAutoStyleEntries(); + std::vector<xmloff::AutoStyleEntry> aAutoStyleEntries = GetExport().GetAutoStylePool()->GetAutoStyleEntries(); for (auto const & rAutoStyleEntry : aAutoStyleEntries) { for (auto const & rPair : rAutoStyleEntry.m_aXmlProperties) diff --git a/xmloff/source/text/XMLIndexMarkExport.cxx b/xmloff/source/text/XMLIndexMarkExport.cxx index c0846dd2a71d..c52235cf6baa 100644 --- a/xmloff/source/text/XMLIndexMarkExport.cxx +++ b/xmloff/source/text/XMLIndexMarkExport.cxx @@ -70,8 +70,7 @@ void XMLIndexMarkExport::ExportIndexMark( sal_Int8 nElementNo = -1; // get index mark - Any aAny; - aAny = rPropSet->getPropertyValue(gsDocumentIndexMark); + Any aAny = rPropSet->getPropertyValue(gsDocumentIndexMark); Reference<XPropertySet> xIndexMarkPropSet; aAny >>= xIndexMarkPropSet; diff --git a/xmloff/source/text/XMLLineNumberingExport.cxx b/xmloff/source/text/XMLLineNumberingExport.cxx index e59f5a2c7f2b..455fd18b3242 100644 --- a/xmloff/source/text/XMLLineNumberingExport.cxx +++ b/xmloff/source/text/XMLLineNumberingExport.cxx @@ -66,10 +66,8 @@ void XMLLineNumberingExport::Export() if (xLineNumbering.is()) { - Any aAny; - // char style - aAny = xLineNumbering->getPropertyValue("CharStyleName"); + Any aAny = xLineNumbering->getPropertyValue("CharStyleName"); OUString sTmp; aAny >>= sTmp; if (!sTmp.isEmpty()) diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index 8dfde974df9e..45b02e05c35d 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -356,10 +356,9 @@ void XMLSectionExport::ExportRegularSectionStart( // get XPropertySet for other values Reference<XPropertySet> xPropSet(rSection, UNO_QUERY); - Any aAny; // condition and display - aAny = xPropSet->getPropertyValue("Condition"); + Any aAny = xPropSet->getPropertyValue("Condition"); OUString sCond; aAny >>= sCond; enum XMLTokenEnum eDisplay = XML_TOKEN_INVALID; @@ -605,8 +604,7 @@ void XMLSectionExport::ExportAlphabeticalIndexStart( { // style name (if present) - Any aAny; - aAny = rPropertySet->getPropertyValue("MainEntryCharacterStyleName"); + Any aAny = rPropertySet->getPropertyValue("MainEntryCharacterStyleName"); OUString sStyleName; aAny >>= sStyleName; if (!sStyleName.isEmpty()) diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 994325d5b7d9..d317ee2808b5 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -1373,8 +1373,7 @@ XMLTextFrameContext::XMLTextFrameContext( { rtl::Reference < XMLTextImportHelper > xTxtImport = GetImport().GetTextImport(); - XMLPropStyleContext* pStyle( nullptr ); - pStyle = xTxtImport->FindAutoFrameStyle( aStyleName ); + XMLPropStyleContext* pStyle = xTxtImport->FindAutoFrameStyle( aStyleName ); if ( pStyle && pStyle->GetParentName().isEmpty() ) { m_HasAutomaticStyleWithoutParentStyle = true; diff --git a/xmloff/source/text/XMLTextHeaderFooterContext.cxx b/xmloff/source/text/XMLTextHeaderFooterContext.cxx index 717c0cf912c0..7db0783e5cf7 100644 --- a/xmloff/source/text/XMLTextHeaderFooterContext.cxx +++ b/xmloff/source/text/XMLTextHeaderFooterContext.cxx @@ -57,9 +57,7 @@ XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport, sa // NOTE: if this ever handles XML_DISPLAY attr then beware of fdo#72850 ! if( bLeft || bFirst ) { - Any aAny; - - aAny = xPropSet->getPropertyValue( sOn ); + Any aAny = xPropSet->getPropertyValue( sOn ); bool bOn = *o3tl::doAccess<bool>(aAny); if( bOn ) diff --git a/xmloff/source/text/txtftne.cxx b/xmloff/source/text/txtftne.cxx index 0c7b7682413b..155205e9f2bc 100644 --- a/xmloff/source/text/txtftne.cxx +++ b/xmloff/source/text/txtftne.cxx @@ -72,8 +72,7 @@ void XMLTextParagraphExport::exportTextFootnote( bool bAutoStyles, bool bIsProgress ) { // get footnote and associated text - Any aAny; - aAny = rPropSet->getPropertyValue(gsFootnote); + Any aAny = rPropSet->getPropertyValue(gsFootnote); Reference<XFootnote> xFootnote; aAny >>= xFootnote; Reference<XText> xText(xFootnote, UNO_QUERY); diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 9fb4b4360c24..907a799546bf 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -2075,8 +2075,7 @@ void XMLTextParagraphExport::exportParagraph( } Reference < XEnumerationAccess > xEA( rTextContent, UNO_QUERY ); - Reference < XEnumeration > xTextEnum; - xTextEnum = xEA->createEnumeration(); + Reference < XEnumeration > xTextEnum = xEA->createEnumeration(); const bool bHasPortions = xTextEnum.is(); Reference < XEnumeration> xContentEnum; diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index 949f74b4dcc7..c6d6ba0f6e73 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -382,8 +382,7 @@ void XMLSequenceFieldImportContext::PrepareField( // handle reference name if (bRefNameOK) { - Any aAny; - aAny = xPropertySet->getPropertyValue("SequenceValue"); + Any aAny = xPropertySet->getPropertyValue("SequenceValue"); sal_Int16 nValue = 0; aAny >>= nValue; GetImportHelper().InsertSequenceID(sRefName, GetName(), nValue); diff --git a/xmloff/source/transform/EventOOoTContext.cxx b/xmloff/source/transform/EventOOoTContext.cxx index ef00793a95d0..d9a2c49fc4d2 100644 --- a/xmloff/source/transform/EventOOoTContext.cxx +++ b/xmloff/source/transform/EventOOoTContext.cxx @@ -198,12 +198,8 @@ void XMLEventOOoTransformerContext::StartElement( { if( !IsXMLToken( aLocation, XML_APPLICATION ) ) aLocation = GetXMLToken( XML_DOCUMENT ); - OUStringBuffer sTmp( aLocation.getLength() + aMacroName.getLength() + 1 ); - sTmp = aLocation; - sTmp.append( ':' ); - sTmp.append( aMacroName ); - pMutableAttrList->SetValueByIndex( nMacroName, - sTmp.makeStringAndClear() ); + OUString sTmp = aLocation + ":" + aMacroName; + pMutableAttrList->SetValueByIndex( nMacroName, sTmp ); } if( m_bPersistent ) |