From 910d3a4f04946207ee88f5a1433946069fb882ed Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 12 Nov 2024 21:04:42 +0200 Subject: [PATCH] loplugin:reftotemp in xmloff Change-Id: I121307865a576b8d0bced6098fae37051bd531b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176503 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmloff/qa/unit/tokenmap-test.cxx | 12 +- xmloff/source/core/DomBuilderContext.cxx | 8 +- xmloff/source/core/xmlimp.cxx | 52 ++--- xmloff/source/draw/animationimport.cxx | 6 +- xmloff/source/draw/eventimp.cxx | 4 +- xmloff/source/text/txtflde.cxx | 2 +- xmloff/source/text/txtparae.cxx | 6 +- .../source/transform/ChartOASISTContext.cxx | 20 +- xmloff/source/transform/ChartOOoTContext.cxx | 28 +-- .../transform/ChartPlotAreaOASISTContext.cxx | 12 +- .../transform/ChartPlotAreaOOoTContext.cxx | 20 +- .../source/transform/ControlOASISTContext.cxx | 24 +- .../source/transform/CreateElemTContext.cxx | 8 +- xmloff/source/transform/DlgOASISTContext.cxx | 12 +- xmloff/source/transform/DocumentTContext.cxx | 10 +- .../source/transform/EventOASISTContext.cxx | 41 ++-- xmloff/source/transform/EventOOoTContext.cxx | 18 +- .../transform/FormPropOASISTContext.cxx | 12 +- .../source/transform/FormPropOOoTContext.cxx | 12 +- .../source/transform/FrameOASISTContext.cxx | 10 +- xmloff/source/transform/FrameOOoTContext.cxx | 8 +- xmloff/source/transform/MergeElemTContext.cxx | 4 +- xmloff/source/transform/NotesTContext.cxx | 16 +- xmloff/source/transform/OOo2Oasis.cxx | 48 ++-- xmloff/source/transform/Oasis2OOo.cxx | 46 ++-- .../source/transform/StyleOASISTContext.cxx | 210 +++++++++--------- xmloff/source/transform/TransformerBase.cxx | 190 ++++++++-------- 27 files changed, 419 insertions(+), 420 deletions(-) diff --git a/xmloff/qa/unit/tokenmap-test.cxx b/xmloff/qa/unit/tokenmap-test.cxx index a3ef3f5da9eb..fd2b7cc08de9 100644 --- a/xmloff/qa/unit/tokenmap-test.cxx +++ b/xmloff/qa/unit/tokenmap-test.cxx @@ -56,12 +56,12 @@ void TokenmapTest::test_listEquality() for ( sal_Int32 nToken = 0; nToken < XML_TOKEN_COUNT; ++nToken ) { Sequence rUtf8Name = token::TokenMap::getUtf8TokenName(nToken); - const OUString& rName = OUString( reinterpret_cast< const char* >( + const OUString aName( reinterpret_cast< const char* >( rUtf8Name.getConstArray() ), rUtf8Name.getLength(), RTL_TEXTENCODING_UTF8 ); - if ( rName.endsWith("_DUMMY") ) + if ( aName.endsWith("_DUMMY") ) continue; const OUString& rTokenName = GetXMLToken( static_cast(nToken) ); - CPPUNIT_ASSERT_EQUAL(rName, rTokenName); + CPPUNIT_ASSERT_EQUAL(aName, rTokenName); } for ( sal_Int32 nToken = xmloff::token::XMLTokenEnum::XML_TOKEN_START + 1; @@ -69,10 +69,10 @@ void TokenmapTest::test_listEquality() { const OUString& rTokenName = GetXMLToken( static_cast(nToken) ); Sequence rUtf8Name = token::TokenMap::getUtf8TokenName(nToken); - const OUString& rName = OUString( reinterpret_cast< const char* >( + const OUString aName( reinterpret_cast< const char* >( rUtf8Name.getConstArray() ), rUtf8Name.getLength(), RTL_TEXTENCODING_UTF8 ); - if ( !rName.endsWith("_DUMMY") ) - CPPUNIT_ASSERT_EQUAL(rTokenName, rName); + if ( !aName.endsWith("_DUMMY") ) + CPPUNIT_ASSERT_EQUAL(rTokenName, aName); } } diff --git a/xmloff/source/core/DomBuilderContext.cxx b/xmloff/source/core/DomBuilderContext.cxx index 83090f9bbc36..d847026cdb6b 100644 --- a/xmloff/source/core/DomBuilderContext.cxx +++ b/xmloff/source/core/DomBuilderContext.cxx @@ -155,7 +155,7 @@ void DomBuilderContext::HandleAttributes( sal_Int32 nAttrToken = aIter.getToken(); // get name & value for attribute sal_uInt16 nNamespace = (nAttrToken >> NMSP_SHIFT) - 1; - const OUString& rPrefix = SvXMLImport::getNamespacePrefixFromToken(nAttrToken, &GetImport().GetNamespaceMap()); + const OUString aPrefix = SvXMLImport::getNamespacePrefixFromToken(nAttrToken, &GetImport().GetNamespaceMap()); const OUString& rLocalName = SvXMLImport::getNameFromToken( nAttrToken ); OUString aValue = aIter.toString(); @@ -182,7 +182,7 @@ void DomBuilderContext::HandleAttributes( { // a real and proper namespace: create namespaced attribute OUString namespaceURI = SvXMLImport::getNamespaceURIFromToken(aIter.getToken()); - OUString qualifiedName = rPrefix.isEmpty() ? rLocalName : rPrefix + SvXMLImport::aNamespaceSeparator + rLocalName; + OUString qualifiedName = aPrefix.isEmpty() ? rLocalName : aPrefix + SvXMLImport::aNamespaceSeparator + rLocalName; xElement->setAttributeNS( namespaceURI, qualifiedName, aValue ); } break; @@ -252,7 +252,7 @@ static Reference lcl_createElement( SvXMLImport& rImport, Reference xElement; sal_uInt16 nNamespace = (nElement >> NMSP_SHIFT) - 1; - const OUString& rPrefix = SvXMLImport::getNamespacePrefixFromToken(nElement, &rImport.GetNamespaceMap()); + const OUString aPrefix = SvXMLImport::getNamespacePrefixFromToken(nElement, &rImport.GetNamespaceMap()); const OUString& rLocalName = SvXMLImport::getNameFromToken( nElement ); switch( nNamespace ) { @@ -276,7 +276,7 @@ static Reference lcl_createElement( SvXMLImport& rImport, // this is a bug, since this will fail for multiple prefixes used for // the same namespace. OUString namespaceURI = SvXMLImport::getNamespaceURIFromToken(nElement); - OUString qualifiedName = rPrefix.isEmpty() ? rLocalName : rPrefix + SvXMLImport::aNamespaceSeparator + rLocalName; + OUString qualifiedName = aPrefix.isEmpty() ? rLocalName : aPrefix + SvXMLImport::aNamespaceSeparator + rLocalName; xElement = xDocument->createElementNS(namespaceURI, qualifiedName); break; } diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 6d8b88192308..54ef1abfebba 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -704,8 +704,8 @@ std::optional SvXMLImport::processNSAttributes( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); - if (pImport && rAttrName == "office:version" && !pImport->mpImpl->mxODFVersion) + const OUString aAttrName = xAttrList->getNameByIndex( i ); + if (pImport && aAttrName == "office:version" && !pImport->mpImpl->mxODFVersion) { pImport->mpImpl->mxODFVersion = xAttrList->getValueByIndex( i ); @@ -719,33 +719,33 @@ std::optional SvXMLImport::processNSAttributes( packages::zip::ZipIOException(u"Inconsistent ODF versions in content.xml and manifest.xml!"_ustr ) ) ); } } - else if( ( rAttrName.getLength() >= 5 ) && - ( rAttrName.startsWith( GetXMLToken(XML_XMLNS) ) ) && - ( rAttrName.getLength() == 5 || ':' == rAttrName[5] ) ) + else if( ( aAttrName.getLength() >= 5 ) && + ( aAttrName.startsWith( GetXMLToken(XML_XMLNS) ) ) && + ( aAttrName.getLength() == 5 || ':' == aAttrName[5] ) ) { if( !pRewindMap ) { pRewindMap = std::move(rpNamespaceMap); rpNamespaceMap.emplace(*pRewindMap); } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); - OUString aPrefix( ( rAttrName.getLength() == 5 ) + OUString aPrefix( ( aAttrName.getLength() == 5 ) ? OUString() - : rAttrName.copy( 6 ) ); + : aAttrName.copy( 6 ) ); // Add namespace, but only if it is known. - sal_uInt16 nKey = rpNamespaceMap->AddIfKnown( aPrefix, rAttrValue ); + sal_uInt16 nKey = rpNamespaceMap->AddIfKnown( aPrefix, aAttrValue ); // If namespace is unknown, try to match a name with similar // TC Id and version if( XML_NAMESPACE_UNKNOWN == nKey ) { - OUString aTestName( rAttrValue ); + OUString aTestName( aAttrValue ); if( SvXMLNamespaceMap::NormalizeURI( aTestName ) ) nKey = rpNamespaceMap->AddIfKnown( aPrefix, aTestName ); } // If that namespace is not known, too, add it as unknown if( XML_NAMESPACE_UNKNOWN == nKey ) - rpNamespaceMap->Add( aPrefix, rAttrValue ); + rpNamespaceMap->Add( aPrefix, aAttrValue ); } } @@ -1313,8 +1313,8 @@ uno::Reference SvXMLImport::loadGraphicByURL(OUString const & } else { - OUString const& rAbsoluteURL = GetAbsoluteReference(rURL); - GraphicExternalLink aExternalLink(rAbsoluteURL); + OUString const aAbsoluteURL = GetAbsoluteReference(rURL); + GraphicExternalLink aExternalLink(aAbsoluteURL); Graphic aGraphic(aExternalLink); xGraphic = aGraphic.GetXGraphic(); } @@ -2227,11 +2227,11 @@ void SAL_CALL SvXMLLegacyToFastDocHandler::startElement( const OUString& rName, sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); - if (rAttrName == "xmlns") + const OUString aAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); + if (aAttrName == "xmlns") { - sal_uInt16 nNamespaceKey = mrImport->mxNamespaceMap->GetKeyByName(rAttrValue); + sal_uInt16 nNamespaceKey = mrImport->mxNamespaceMap->GetKeyByName(aAttrValue); if (nNamespaceKey != XML_NAMESPACE_UNKNOWN) { nDefaultNamespace = nNamespaceKey; @@ -2239,19 +2239,19 @@ void SAL_CALL SvXMLLegacyToFastDocHandler::startElement( const OUString& rName, } assert(false && "unknown namespace"); } - else if (rAttrName.indexOf(":") == -1 && nDefaultNamespace != XML_NAMESPACE_UNKNOWN) + else if (aAttrName.indexOf(":") == -1 && nDefaultNamespace != XML_NAMESPACE_UNKNOWN) { - auto const nToken = SvXMLImport::getTokenFromName(rAttrName); + auto const nToken = SvXMLImport::getTokenFromName(aAttrName); if (nToken == xmloff::XML_TOKEN_INVALID) { mxFastAttributes->addUnknown(mrImport->mxNamespaceMap->GetNameByKey(nDefaultNamespace), - OUStringToOString(rAttrName, RTL_TEXTENCODING_UTF8), - OUStringToOString(rAttrValue, RTL_TEXTENCODING_UTF8)); + OUStringToOString(aAttrName, RTL_TEXTENCODING_UTF8), + OUStringToOString(aAttrValue, RTL_TEXTENCODING_UTF8)); } else { sal_Int32 const nAttr = NAMESPACE_TOKEN(nDefaultNamespace) | nToken; - mxFastAttributes->add(nAttr, OUStringToOString(rAttrValue, RTL_TEXTENCODING_UTF8)); + mxFastAttributes->add(nAttr, OUStringToOString(aAttrValue, RTL_TEXTENCODING_UTF8)); } continue; } @@ -2260,20 +2260,20 @@ void SAL_CALL SvXMLLegacyToFastDocHandler::startElement( const OUString& rName, OUString aNamespace; // don't add unknown namespaces to the map sal_uInt16 const nAttrPrefix = mrImport->mxNamespaceMap->GetKeyByQName( - rAttrName, nullptr, &aLocalAttrName, &aNamespace, SvXMLNamespaceMap::QNameMode::AttrValue); + aAttrName, nullptr, &aLocalAttrName, &aNamespace, SvXMLNamespaceMap::QNameMode::AttrValue); if( XML_NAMESPACE_XMLNS == nAttrPrefix ) continue; // ignore auto const nToken = SvXMLImport::getTokenFromName(aLocalAttrName); if (XML_NAMESPACE_UNKNOWN == nAttrPrefix || nToken == xmloff::XML_TOKEN_INVALID) { mxFastAttributes->addUnknown(aNamespace, - OUStringToOString(rAttrName, RTL_TEXTENCODING_UTF8), - OUStringToOString(rAttrValue, RTL_TEXTENCODING_UTF8)); + OUStringToOString(aAttrName, RTL_TEXTENCODING_UTF8), + OUStringToOString(aAttrValue, RTL_TEXTENCODING_UTF8)); } else { sal_Int32 const nAttr = NAMESPACE_TOKEN(nAttrPrefix) | nToken; - mxFastAttributes->add(nAttr, OUStringToOString(rAttrValue, RTL_TEXTENCODING_UTF8)); + mxFastAttributes->add(nAttr, OUStringToOString(aAttrValue, RTL_TEXTENCODING_UTF8)); } } mrImport->startFastElement( mnElement, mxFastAttributes ); diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index 35358e6b6143..c8c75add1c9c 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -481,12 +481,12 @@ AnimationNodeContext::AnimationNodeContext( { if( (aIter.getToken() & TOKEN_MASK) == XML_PRESET_ID) { - const OUString& rValue = aIter.toString(); - if ( rValue == "ooo-entrance-random" ) + const OUString aValue = aIter.toString(); + if ( aValue == "ooo-entrance-random" ) { nPresetClass = EffectPresetClass::ENTRANCE; } - else if ( rValue == "ooo-exit-random" ) + else if ( aValue == "ooo-exit-random" ) { nPresetClass = EffectPresetClass::EXIT; } diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx index 9e90de023c6d..429a28627a57 100644 --- a/xmloff/source/draw/eventimp.cxx +++ b/xmloff/source/draw/eventimp.cxx @@ -194,9 +194,9 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, } else { - const OUString &rTmp = + const OUString aTmp = rImp.GetAbsoluteReference(aIter.toString()); - INetURLObject::translateToInternal( rTmp, maData.msBookmark, + INetURLObject::translateToInternal( aTmp, maData.msBookmark, INetURLObject::DecodeMechanism::Unambiguous ); } } diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 67f5a9ce2412..1d932dc300bc 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -1401,7 +1401,7 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DATABASE_DISPLAY: { // get database, table and column name from field master - const Reference & xMaster = GetMasterPropertySet(rTextField); + const Reference xMaster = GetMasterPropertySet(rTextField); ProcessString(XML_TABLE_NAME, GetStringProperty(gsPropertyDataTableName, xMaster)); ProcessCommandType(GetIntProperty(gsPropertyDataCommandType, xMaster)); diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 87f3de90b4ff..1df1e2dc0d78 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -2329,10 +2329,10 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( if (!bAutoStyles) { Reference xBookmark(xPropSet->getPropertyValue(gsBookmark), UNO_QUERY); - const OUString& rName = xBookmark->getName(); - if (!rName.isEmpty()) + const OUString aName = xBookmark->getName(); + if (!aName.isEmpty()) { - GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_NAME, rName); + GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_NAME, aName); } SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_OFFICE, XML_ANNOTATION_END, false, false ); } diff --git a/xmloff/source/transform/ChartOASISTContext.cxx b/xmloff/source/transform/ChartOASISTContext.cxx index 314de40318d2..481b6c9722d8 100644 --- a/xmloff/source/transform/ChartOASISTContext.cxx +++ b/xmloff/source/transform/ChartOASISTContext.cxx @@ -54,10 +54,10 @@ void XMLChartOASISTransformerContext::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); XMLTransformerActions::const_iterator aIter = @@ -70,22 +70,22 @@ void XMLChartOASISTransformerContext::StartElement( new XMLMutableAttributeList( xAttrList ); xAttrList = pMutableAttrList; } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); switch( (*aIter).second.m_nActionType ) { case XML_ATACTION_IN2INCH: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); if( XMLTransformerBase::ReplaceSingleInWithInch( - aAttrValue ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + aAttrValue2 ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_DECODE_STYLE_NAME_REF: { - OUString aAttrValue( rAttrValue ); - if( XMLTransformerBase::DecodeStyleName(aAttrValue) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( XMLTransformerBase::DecodeStyleName(aAttrValue2) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX: @@ -95,7 +95,7 @@ void XMLChartOASISTransformerContext::StartElement( OUString aChartClass; sal_uInt16 nValuePrefix = GetTransformer().GetNamespaceMap().GetKeyByAttrName( - rAttrValue, + aAttrValue, &aChartClass ); if( XML_NAMESPACE_CHART == nValuePrefix ) { diff --git a/xmloff/source/transform/ChartOOoTContext.cxx b/xmloff/source/transform/ChartOOoTContext.cxx index 781cb3764c8e..4cfe56db8945 100644 --- a/xmloff/source/transform/ChartOOoTContext.cxx +++ b/xmloff/source/transform/ChartOOoTContext.cxx @@ -55,10 +55,10 @@ void XMLChartOOoTransformerContext::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); XMLTransformerActions::const_iterator aIter = @@ -71,45 +71,45 @@ void XMLChartOOoTransformerContext::StartElement( new XMLMutableAttributeList( xAttrList ); xAttrList = pMutableAttrList; } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); switch( (*aIter).second.m_nActionType ) { case XML_ATACTION_INCH2IN: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); if( XMLTransformerBase::ReplaceSingleInchWithIn( - aAttrValue ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + aAttrValue2 ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_ENCODE_STYLE_NAME_REF: { - OUString aAttrValue( rAttrValue ); - if( GetTransformer().EncodeStyleName(aAttrValue) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( GetTransformer().EncodeStyleName(aAttrValue2) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_ADD_NAMESPACE_PREFIX: OSL_ENSURE( ::xmloff::token::IsXMLToken( aLocalName, XML_CLASS ), "unexpected class token" ); - if( ::xmloff::token::IsXMLToken( rAttrValue, XML_ADD_IN ) ) + if( ::xmloff::token::IsXMLToken( aAttrValue, XML_ADD_IN ) ) { nClassName = i; } else { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); sal_uInt16 nValPrefix = static_cast((*aIter).second.m_nParam1); - GetTransformer().AddNamespacePrefix( aAttrValue, + GetTransformer().AddNamespacePrefix( aAttrValue2, nValPrefix ); - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_REMOVE: OSL_ENSURE( ::xmloff::token::IsXMLToken( aLocalName, XML_ADD_IN_NAME ), "unexpected class token" ); - aAddInName = rAttrValue; + aAddInName = aAttrValue; pMutableAttrList->RemoveAttributeByIndex( i ); --i; --nAttrCount; diff --git a/xmloff/source/transform/ChartPlotAreaOASISTContext.cxx b/xmloff/source/transform/ChartPlotAreaOASISTContext.cxx index b8603f62fd59..3fd378f45286 100644 --- a/xmloff/source/transform/ChartPlotAreaOASISTContext.cxx +++ b/xmloff/source/transform/ChartPlotAreaOASISTContext.cxx @@ -99,10 +99,10 @@ void XMLAxisOASISContext::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName ); + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); if( nPrefix == XML_NAMESPACE_CHART && IsXMLToken( aLocalName, XML_DIMENSION ) ) @@ -113,20 +113,20 @@ void XMLAxisOASISContext::StartElement( xAttrList = pMutableAttrList; } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); XMLTokenEnum eToken = XML_TOKEN_INVALID; - if( IsXMLToken( rAttrValue, XML_X )) + if( IsXMLToken( aAttrValue, XML_X )) { eToken = XML_DOMAIN; // has to be XML_CATEGORY for axes with a categories // sub-element. The attribute is changed later (when it is // known that there is a categories sub-element) in this case. } - else if( IsXMLToken( rAttrValue, XML_Y )) + else if( IsXMLToken( aAttrValue, XML_Y )) { eToken = XML_VALUE; } - else if( IsXMLToken( rAttrValue, XML_Z )) + else if( IsXMLToken( aAttrValue, XML_Z )) { eToken = XML_SERIES; } diff --git a/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx b/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx index f2781a25aa62..35afdb8151af 100644 --- a/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx +++ b/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx @@ -61,10 +61,10 @@ void XMLAxisOOoContext::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName ); + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); if( nPrefix == XML_NAMESPACE_CHART && IsXMLToken( aLocalName, XML_CLASS ) ) @@ -75,20 +75,20 @@ void XMLAxisOOoContext::StartElement( xAttrList = pMutableAttrList; } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); XMLTokenEnum eToken = XML_TOKEN_INVALID; - if( IsXMLToken( rAttrValue, XML_DOMAIN ) || - IsXMLToken( rAttrValue, XML_CATEGORY )) + if( IsXMLToken( aAttrValue, XML_DOMAIN ) || + IsXMLToken( aAttrValue, XML_CATEGORY )) { eToken = XML_X; - if( IsXMLToken( rAttrValue, XML_CATEGORY ) ) + if( IsXMLToken( aAttrValue, XML_CATEGORY ) ) m_bIsCategoryAxis = true; } - else if( IsXMLToken( rAttrValue, XML_VALUE )) + else if( IsXMLToken( aAttrValue, XML_VALUE )) { eToken = XML_Y; } - else if( IsXMLToken( rAttrValue, XML_SERIES )) + else if( IsXMLToken( aAttrValue, XML_SERIES )) { eToken = XML_Z; } @@ -152,10 +152,10 @@ rtl::Reference XMLChartPlotAreaOOoTContext::CreateChildCo for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString & rAttrName = xNewAttrList->getNameByIndex( i ); + const OUString aAttrName = xNewAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nNewPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); if( nNewPrefix == XML_NAMESPACE_CHART && pAxisContext->IsCategoryAxis() && diff --git a/xmloff/source/transform/ControlOASISTContext.cxx b/xmloff/source/transform/ControlOASISTContext.cxx index 5dd2067c7af7..ce648a52d52d 100644 --- a/xmloff/source/transform/ControlOASISTContext.cxx +++ b/xmloff/source/transform/ControlOASISTContext.cxx @@ -62,10 +62,10 @@ void XMLControlOASISTransformerContext::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); XMLTransformerActions::const_iterator aIter = @@ -78,14 +78,14 @@ void XMLControlOASISTransformerContext::StartElement( new XMLMutableAttributeList( rAttrList ); xAttrList = pMutableAttrList; } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); switch( (*aIter).second.m_nActionType ) { case XML_ATACTION_MOVE_TO_ELEM: if( m_bCreateControl ) { - pControlMutableAttrList->AddAttribute( rAttrName, - rAttrValue ); + pControlMutableAttrList->AddAttribute( aAttrName, + aAttrValue ); pMutableAttrList->RemoveAttributeByIndex( i ); --i; --nAttrCount; @@ -93,10 +93,10 @@ void XMLControlOASISTransformerContext::StartElement( break; case XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); sal_uInt16 nValPrefix = static_cast( (*aIter).second.m_nParam2 ); - GetTransformer().RemoveNamespacePrefix( aAttrValue, + GetTransformer().RemoveNamespacePrefix( aAttrValue2, nValPrefix ); OUString aNewAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey( @@ -106,7 +106,7 @@ void XMLControlOASISTransformerContext::StartElement( if( m_bCreateControl ) { pControlMutableAttrList->AddAttribute( aNewAttrQName, - aAttrValue ); + aAttrValue2 ); pMutableAttrList->RemoveAttributeByIndex( i ); --i; --nAttrCount; @@ -115,16 +115,16 @@ void XMLControlOASISTransformerContext::StartElement( { pMutableAttrList->RenameAttributeByIndex( i, aNewAttrQName ); - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } } break; case XML_ATACTION_URI_OASIS: { - OUString aAttrValue( rAttrValue ); - if( GetTransformer().ConvertURIToOOo( aAttrValue, + OUString aAttrValue2( aAttrValue ); + if( GetTransformer().ConvertURIToOOo( aAttrValue2, static_cast< bool >((*aIter).second.m_nParam1)) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; default: diff --git a/xmloff/source/transform/CreateElemTContext.cxx b/xmloff/source/transform/CreateElemTContext.cxx index 218852972799..2885f2c99df0 100644 --- a/xmloff/source/transform/CreateElemTContext.cxx +++ b/xmloff/source/transform/CreateElemTContext.cxx @@ -59,11 +59,11 @@ void XMLCreateElemTransformerContext::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; ++i ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); @@ -89,7 +89,7 @@ void XMLCreateElemTransformerContext::StartElement( rtl::Reference pContext( new XMLPersTextContentTContext( GetTransformer(), aElemQName )); - pContext->Characters( rAttrValue ); + pContext->Characters( aAttrValue ); aChildContexts.push_back(pContext); pMutableAttrList->RemoveAttributeByIndex( i ); --i; diff --git a/xmloff/source/transform/DlgOASISTContext.cxx b/xmloff/source/transform/DlgOASISTContext.cxx index 24b8a868ed49..6f9a42ee70a7 100644 --- a/xmloff/source/transform/DlgOASISTContext.cxx +++ b/xmloff/source/transform/DlgOASISTContext.cxx @@ -53,10 +53,10 @@ void XMLDlgOASISTransformerContext::StartElement( for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); @@ -71,14 +71,14 @@ void XMLDlgOASISTransformerContext::StartElement( new XMLMutableAttributeList( xAttrList ); xAttrList = pMutableAttrList; } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); switch( (*aIter).second.m_nActionType ) { case XML_ATACTION_DLG_BORDER: { - if ( rAttrValue != GetXMLToken( XML_NONE ) && - rAttrValue != GetXMLToken( XML_SIMPLE ) && - rAttrValue != GetXMLToken( XML_3D ) ) + if ( aAttrValue != GetXMLToken( XML_NONE ) && + aAttrValue != GetXMLToken( XML_SIMPLE ) && + aAttrValue != GetXMLToken( XML_3D ) ) { pMutableAttrList->SetValueByIndex( i, GetXMLToken( XML_NONE ) ); diff --git a/xmloff/source/transform/DocumentTContext.cxx b/xmloff/source/transform/DocumentTContext.cxx index 9864a8ea32bf..7c2cb6e6f22d 100644 --- a/xmloff/source/transform/DocumentTContext.cxx +++ b/xmloff/source/transform/DocumentTContext.cxx @@ -53,15 +53,15 @@ void XMLDocumentTransformerContext::StartElement( const Reference< XAttributeLis sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); if( XML_NAMESPACE_OFFICE == nPrefix && IsXMLToken( aLocalName, XML_MIMETYPE ) ) { - const OUString& rValue = xAttrList->getValueByIndex( i ); + const OUString aValue = xAttrList->getValueByIndex( i ); static constexpr std::string_view aTmp[] { "application/vnd.oasis.openoffice.", @@ -71,9 +71,9 @@ void XMLDocumentTransformerContext::StartElement( const Reference< XAttributeLis }; for (const auto & rPrefix : aTmp) { - if( rValue.matchAsciiL( rPrefix.data(), rPrefix.size() ) ) + if( aValue.matchAsciiL( rPrefix.data(), rPrefix.size() ) ) { - aClass = rValue.copy( rPrefix.size() ); + aClass = aValue.copy( rPrefix.size() ); break; } } diff --git a/xmloff/source/transform/EventOASISTContext.cxx b/xmloff/source/transform/EventOASISTContext.cxx index 7982d2b3bc63..5a1111f93909 100644 --- a/xmloff/source/transform/EventOASISTContext.cxx +++ b/xmloff/source/transform/EventOASISTContext.cxx @@ -178,10 +178,10 @@ void XMLEventOASISTransformerContext::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); XMLTransformerActions::const_iterator aIter = @@ -194,7 +194,7 @@ void XMLEventOASISTransformerContext::StartElement( new XMLMutableAttributeList( xAttrList ); xAttrList = pMutableAttrList; } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); switch( (*aIter).second.m_nActionType ) { case XML_ATACTION_HREF: @@ -202,7 +202,7 @@ void XMLEventOASISTransformerContext::StartElement( OUString aName, aLocation; bool bNeedsTransform = - ParseURL( rAttrValue, &aName, &aLocation ); + ParseURL( aAttrValue, &aName, &aLocation ); if ( bNeedsTransform ) { @@ -243,25 +243,25 @@ void XMLEventOASISTransformerContext::StartElement( pObjContext->HasNamespace(XML_NAMESPACE_FORM ); pMutableAttrList->SetValueByIndex( i, - GetTransformer().GetEventName( rAttrValue, + GetTransformer().GetEventName( aAttrValue, bForm ) ); } break; case XML_ATACTION_REMOVE_NAMESPACE_PREFIX: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); sal_uInt16 nValPrefix = static_cast((*aIter).second.m_nParam1); if( GetTransformer().RemoveNamespacePrefix( - aAttrValue, nValPrefix ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + aAttrValue2, nValPrefix ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_MACRO_NAME: { OUString aName, aLocation; bool bNeedsTransform = - ParseURL( rAttrValue, &aName, &aLocation ); + ParseURL( aAttrValue, &aName, &aLocation ); if ( bNeedsTransform ) { @@ -286,24 +286,23 @@ void XMLEventOASISTransformerContext::StartElement( { const OUString& rApp = GetXMLToken( XML_APPLICATION ); const OUString& rDoc = GetXMLToken( XML_DOCUMENT ); - OUString aAttrValue; - if( rAttrValue.getLength() > rApp.getLength()+1 && - o3tl::equalsIgnoreAsciiCase(rAttrValue.subView(0,rApp.getLength()), rApp) && - ':' == rAttrValue[rApp.getLength()] ) + OUString aAttrValue2; + if( aAttrValue.getLength() > rApp.getLength()+1 && + o3tl::equalsIgnoreAsciiCase(aAttrValue.subView(0,rApp.getLength()), rApp) && + ':' == aAttrValue[rApp.getLength()] ) { aLocation = rApp; - aAttrValue = rAttrValue.copy( rApp.getLength()+1 ); + aAttrValue2 = aAttrValue.copy( rApp.getLength()+1 ); } - else if( rAttrValue.getLength() > rDoc.getLength()+1 && - o3tl::equalsIgnoreAsciiCase(rAttrValue.subView(0,rDoc.getLength()), rDoc) && - ':' == rAttrValue[rDoc.getLength()] ) + else if( aAttrValue.getLength() > rDoc.getLength()+1 && + o3tl::equalsIgnoreAsciiCase(aAttrValue.subView(0,rDoc.getLength()), rDoc) && + ':' == aAttrValue[rDoc.getLength()] ) { aLocation= rDoc; - aAttrValue = rAttrValue.copy( rDoc.getLength()+1 ); + aAttrValue2 = aAttrValue.copy( rDoc.getLength()+1 ); } - if( !aAttrValue.isEmpty() ) - pMutableAttrList->SetValueByIndex( i, - aAttrValue ); + if( !aAttrValue2.isEmpty() ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); if( !aLocation.isEmpty() ) { OUString aAttrQName( GetTransformer().GetNamespaceMap(). diff --git a/xmloff/source/transform/EventOOoTContext.cxx b/xmloff/source/transform/EventOOoTContext.cxx index 210f046d4d9e..fa6bf676c9f0 100644 --- a/xmloff/source/transform/EventOOoTContext.cxx +++ b/xmloff/source/transform/EventOOoTContext.cxx @@ -138,10 +138,10 @@ void XMLEventOOoTransformerContext::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); XMLTransformerActions::const_iterator aIter = @@ -154,7 +154,7 @@ void XMLEventOOoTransformerContext::StartElement( new XMLMutableAttributeList( xAttrList ); xAttrList = pMutableAttrList; } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); switch( (*aIter).second.m_nActionType ) { case XML_ATACTION_HREF: @@ -162,26 +162,26 @@ void XMLEventOOoTransformerContext::StartElement( break; case XML_ATACTION_EVENT_NAME: pMutableAttrList->SetValueByIndex( i, - GetTransformer().GetEventName( rAttrValue ) ); + GetTransformer().GetEventName( aAttrValue ) ); break; case XML_ATACTION_ADD_NAMESPACE_PREFIX: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); sal_uInt16 nValPrefix = static_cast((*aIter).second.m_nParam1); - GetTransformer().AddNamespacePrefix( aAttrValue, + GetTransformer().AddNamespacePrefix( aAttrValue2, nValPrefix ); - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_MACRO_LOCATION: - aLocation = rAttrValue; + aLocation = aAttrValue; pMutableAttrList->RemoveAttributeByIndex( i ); --i; --nAttrCount; break; case XML_ATACTION_MACRO_NAME: - aMacroName = rAttrValue; + aMacroName = aAttrValue; nMacroName = i; break; case XML_ATACTION_COPY: diff --git a/xmloff/source/transform/FormPropOASISTContext.cxx b/xmloff/source/transform/FormPropOASISTContext.cxx index 228d960cccca..042b57ae07e5 100644 --- a/xmloff/source/transform/FormPropOASISTContext.cxx +++ b/xmloff/source/transform/FormPropOASISTContext.cxx @@ -114,27 +114,27 @@ void XMLFormPropOASISTransformerContext::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); XMLTransformerActions::const_iterator aIter = pActions->find( aKey ); if( aIter != pActions->end() ) { - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); switch( (*aIter).second.m_nActionType ) { case XML_ATACTION_RENAME: if( IsXMLToken( aLocalName, XML_VALUE_TYPE ) ) { - if( IsXMLToken( rAttrValue, XML_FLOAT ) ) + if( IsXMLToken( aAttrValue, XML_FLOAT ) ) { nValueTypeAttr = i; } - else if( IsXMLToken( rAttrValue, XML_VOID ) ) + else if( IsXMLToken( aAttrValue, XML_VOID ) ) { pMutableAttrList->SetValueByIndex( i, GetXMLToken( XML_SHORT ) ); @@ -152,7 +152,7 @@ void XMLFormPropOASISTransformerContext::StartElement( break; case XML_ATACTION_REMOVE: if( !IsXMLToken( aLocalName, XML_CURRENCY ) ) - aValue = rAttrValue; + aValue = aAttrValue; pMutableAttrList->RemoveAttributeByIndex( i ); --i; --nAttrCount; diff --git a/xmloff/source/transform/FormPropOOoTContext.cxx b/xmloff/source/transform/FormPropOOoTContext.cxx index 5a2ea3ba983a..f77ce2884a99 100644 --- a/xmloff/source/transform/FormPropOOoTContext.cxx +++ b/xmloff/source/transform/FormPropOOoTContext.cxx @@ -68,10 +68,10 @@ void XMLFormPropValueTContext_Impl::StartElement( sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = rAttrList->getNameByIndex( i ); + const OUString aAttrName = rAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); if( XML_NAMESPACE_FORM == nPrefix && IsXMLToken( aLocalName, XML_PROPERTY_IS_VOID ) && @@ -157,23 +157,23 @@ void XMLFormPropOOoTransformerContext::StartElement( sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = rAttrList->getNameByIndex( i ); + const OUString aAttrName = rAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); XMLTransformerActions::const_iterator aIter = pActions->find( aKey ); if( aIter != pActions->end() ) { - const OUString& rAttrValue = rAttrList->getValueByIndex( i ); + const OUString aAttrValue = rAttrList->getValueByIndex( i ); switch( (*aIter).second.m_nActionType ) { case XML_ATACTION_RENAME: if( IsXMLToken( aLocalName, XML_PROPERTY_TYPE ) ) { - aValueType = rAttrValue; + aValueType = aAttrValue; m_nValueTypeAttr = i; } { diff --git a/xmloff/source/transform/FrameOASISTContext.cxx b/xmloff/source/transform/FrameOASISTContext.cxx index e2c2295c8cef..bb81190161c1 100644 --- a/xmloff/source/transform/FrameOASISTContext.cxx +++ b/xmloff/source/transform/FrameOASISTContext.cxx @@ -87,16 +87,16 @@ void XMLFrameOASISTransformerContext::StartElement( sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = rAttrList->getNameByIndex( i ); + const OUString aAttrName = rAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName ); + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); if( (nPrefix == XML_NAMESPACE_PRESENTATION) && IsXMLToken( aLocalName, XML_CLASS ) ) { - const OUString& rAttrValue = rAttrList->getValueByIndex( i ); - if( IsXMLToken( rAttrValue, XML_HEADER ) || IsXMLToken( rAttrValue, XML_FOOTER ) || - IsXMLToken( rAttrValue, XML_PAGE_NUMBER ) || IsXMLToken( rAttrValue, XML_DATE_TIME ) ) + const OUString aAttrValue = rAttrList->getValueByIndex( i ); + if( IsXMLToken( aAttrValue, XML_HEADER ) || IsXMLToken( aAttrValue, XML_FOOTER ) || + IsXMLToken( aAttrValue, XML_PAGE_NUMBER ) || IsXMLToken( aAttrValue, XML_DATE_TIME ) ) { m_bIgnoreElement = true; break; diff --git a/xmloff/source/transform/FrameOOoTContext.cxx b/xmloff/source/transform/FrameOOoTContext.cxx index a8cbd5a8fbfa..5054f94f1d1c 100644 --- a/xmloff/source/transform/FrameOOoTContext.cxx +++ b/xmloff/source/transform/FrameOOoTContext.cxx @@ -64,21 +64,21 @@ void XMLFrameOOoTransformerContext::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); XMLTransformerActions::const_iterator aIter = pActions->find( aKey ); if( aIter != pActions->end() ) { - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); switch( (*aIter).second.m_nActionType ) { case XML_ATACTION_MOVE_TO_ELEM: - pFrameMutableAttrList->AddAttribute( rAttrName, rAttrValue ); + pFrameMutableAttrList->AddAttribute( aAttrName, aAttrValue ); pMutableAttrList->RemoveAttributeByIndex( i ); --i; --nAttrCount; diff --git a/xmloff/source/transform/MergeElemTContext.cxx b/xmloff/source/transform/MergeElemTContext.cxx index 8f32ac922531..1f990a6a993a 100644 --- a/xmloff/source/transform/MergeElemTContext.cxx +++ b/xmloff/source/transform/MergeElemTContext.cxx @@ -131,10 +131,10 @@ void XMLMergeElemTransformerContext::StartElement( sal_Int16 nAttrCount = m_xAttrList.is() ? m_xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = m_xAttrList->getNameByIndex( i ); + const OUString aAttrName = m_xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); bool bRemove = true; if( XML_NAMESPACE_OFFICE == nPrefix) diff --git a/xmloff/source/transform/NotesTContext.cxx b/xmloff/source/transform/NotesTContext.cxx index b3adcdb007ba..8208f3dd50c6 100644 --- a/xmloff/source/transform/NotesTContext.cxx +++ b/xmloff/source/transform/NotesTContext.cxx @@ -64,17 +64,17 @@ void XMLNotesTransformerContext::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); XMLTransformerActions::const_iterator aIter = pActions->find( aKey ); if( aIter != pActions->end() ) { - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); if( !pMutableAttrList ) { @@ -86,10 +86,10 @@ void XMLNotesTransformerContext::StartElement( { case XML_ATACTION_STYLE_FAMILY: { - if( IsXMLToken( rAttrValue, XML_FOOTNOTE ) ) + if( IsXMLToken( aAttrValue, XML_FOOTNOTE ) ) { } - else if( IsXMLToken( rAttrValue, XML_ENDNOTE ) ) + else if( IsXMLToken( aAttrValue, XML_ENDNOTE ) ) { m_bEndNote = true; } @@ -101,9 +101,9 @@ void XMLNotesTransformerContext::StartElement( case XML_ATACTION_DECODE_STYLE_NAME: case XML_ATACTION_DECODE_STYLE_NAME_REF: { - OUString aAttrValue( rAttrValue ); - if( XMLTransformerBase::DecodeStyleName(aAttrValue) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( XMLTransformerBase::DecodeStyleName(aAttrValue2) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; } diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx index cbec872376cd..a10203b1eb33 100644 --- a/xmloff/source/transform/OOo2Oasis.cxx +++ b/xmloff/source/transform/OOo2Oasis.cxx @@ -925,20 +925,20 @@ void XMLDocumentTransformerContext_Impl::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); if( XML_NAMESPACE_OFFICE == nPrefix && IsXMLToken( aLocalName, XML_CLASS ) ) { - const OUString& rValue = xAttrList->getValueByIndex( i ); - GetTransformer().SetClass( rValue ); + const OUString aValue = xAttrList->getValueByIndex( i ); + GetTransformer().SetClass( aValue ); pMutableAttrList = new XMLMutableAttributeList( xAttrList ); xAttrList = pMutableAttrList; - OUString sMime = "application/vnd.oasis.opendocument." + rValue; + OUString sMime = "application/vnd.oasis.opendocument." + aValue; pMutableAttrList->SetValueByIndex( i, sMime ); OUString aNewAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_OFFICE, ::xmloff::token::GetXMLToken( XML_MIMETYPE ) ) ); pMutableAttrList->RenameAttributeByIndex(i, aNewAttrQName ); @@ -946,18 +946,18 @@ void XMLDocumentTransformerContext_Impl::StartElement( } else if( XML_NAMESPACE_XMLNS == nPrefix ) { - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); - if( IsXMLToken( rAttrValue, XML_N_OOO ) ) + const OUString aAttrValue = xAttrList->getValueByIndex( i ); + if( IsXMLToken( aAttrValue, XML_N_OOO ) ) bOOo = true; - else if( IsXMLToken( rAttrValue, XML_N_OOOW ) ) + else if( IsXMLToken( aAttrValue, XML_N_OOOW ) ) bOOoW = true; - else if( IsXMLToken( rAttrValue, XML_N_OOOC ) ) + else if( IsXMLToken( aAttrValue, XML_N_OOOC ) ) bOOoC = true; - else if( IsXMLToken( rAttrValue, XML_N_DOM ) ) + else if( IsXMLToken( aAttrValue, XML_N_DOM ) ) bDOM = true; - else if( IsXMLToken( rAttrValue, XML_N_DC ) ) + else if( IsXMLToken( aAttrValue, XML_N_DC ) ) bDC = true; - else if( IsXMLToken( rAttrValue, XML_N_SVG ) ) + else if( IsXMLToken( aAttrValue, XML_N_SVG ) ) bSVG = true; } } @@ -1106,10 +1106,10 @@ void XMLTabStopOOoTContext_Impl::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); XMLTransformerActions::const_iterator aIter = @@ -1122,7 +1122,7 @@ void XMLTabStopOOoTContext_Impl::StartElement( new XMLMutableAttributeList( xAttrList ); xAttrList = pMutableAttrList; } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); switch( (*aIter).second.m_nActionType ) { case XML_ATACTION_RENAME: @@ -1136,8 +1136,8 @@ void XMLTabStopOOoTContext_Impl::StartElement( aNewAttrQName ); } if( IsXMLToken( aLocalName, XML_LEADER_CHAR ) && - !rAttrValue.isEmpty() && - rAttrValue[0] != ' ' ) + !aAttrValue.isEmpty() && + aAttrValue[0] != ' ' ) { OUString aNewAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey( @@ -1149,10 +1149,10 @@ void XMLTabStopOOoTContext_Impl::StartElement( break; case XML_ATACTION_INCH2IN: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); if( XMLTransformerBase::ReplaceSingleInchWithIn( - aAttrValue ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + aAttrValue2 ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; default: @@ -1200,10 +1200,10 @@ void XMLTrackedChangesOOoTContext_Impl::StartElement( sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = rAttrList->getNameByIndex( i ); + const OUString aAttrName = rAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); if( m_nPrefix == nPrefix && IsXMLToken( aLocalName, m_eToken ) ) { @@ -1272,10 +1272,10 @@ void XMLTableOOoTransformerContext_Impl::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); if( XML_NAMESPACE_TABLE == nPrefix && IsXMLToken( aLocalName, XML_PRINT_RANGES ) ) diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx index 6d4e9e556c88..ff478e9669f7 100644 --- a/xmloff/source/transform/Oasis2OOo.cxx +++ b/xmloff/source/transform/Oasis2OOo.cxx @@ -1103,17 +1103,17 @@ void XMLTableTransformerContext_Impl::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); if( XML_NAMESPACE_TABLE == nPrefix ) { if ( IsXMLToken( aLocalName, XML_IS_SUB_TABLE ) ) { - const OUString& rValue = xAttrList->getValueByIndex( i ); - if( IsXMLToken( rValue, XML_TRUE ) ) + const OUString aValue = xAttrList->getValueByIndex( i ); + if( IsXMLToken( aValue, XML_TRUE ) ) { m_aElemQName = GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, @@ -1131,8 +1131,8 @@ void XMLTableTransformerContext_Impl::StartElement( // Convert attribute table:style-name for (#i40011#, #i40015#) else if ( IsXMLToken( aLocalName, XML_STYLE_NAME ) ) { - const OUString& rValue = xAttrList->getValueByIndex( i ); - OUString aAttrValue( rValue ); + const OUString aValue = xAttrList->getValueByIndex( i ); + OUString aAttrValue( aValue ); if( XMLTransformerBase::DecodeStyleName(aAttrValue) ) { if ( !pMutableAttrList ) @@ -1255,10 +1255,10 @@ void XMLTabStopOASISTContext_Impl::StartElement( sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); XMLTransformerActions::const_iterator aIter = @@ -1271,15 +1271,15 @@ void XMLTabStopOASISTContext_Impl::StartElement( new XMLMutableAttributeList( xAttrList ); xAttrList = pMutableAttrList; } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); switch( (*aIter).second.m_nActionType ) { case XML_ATACTION_REMOVE: if( IsXMLToken( aLocalName, XML_LEADER_STYLE ) ) { - if( IsXMLToken( rAttrValue, XML_NONE ) ) + if( IsXMLToken( aAttrValue, XML_NONE ) ) cStyleLeaderChar = ' '; - else if( IsXMLToken( rAttrValue, XML_DOTTED ) ) + else if( IsXMLToken( aAttrValue, XML_DOTTED ) ) cStyleLeaderChar = '.'; else cStyleLeaderChar = 0; @@ -1300,20 +1300,20 @@ void XMLTabStopOASISTContext_Impl::StartElement( } if( IsXMLToken( aLocalName, XML_LEADER_TEXT ) ) { - if( rAttrValue.getLength() > 1 ) + if( aAttrValue.getLength() > 1 ) { - OUString aAttrValue( rAttrValue.copy( 0, 1 ) ); - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue.copy( 0, 1 ) ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); nLeaderText = i; } } break; case XML_ATACTION_IN2INCH: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); if( XMLTransformerBase::ReplaceSingleInWithInch( - aAttrValue ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + aAttrValue2 ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; default: @@ -1381,21 +1381,21 @@ void XMLConfigItemTContext_Impl::StartElement( sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = rAttrList->getNameByIndex( i ); + const OUString aAttrName = rAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); if( XML_NAMESPACE_CONFIG == nPrefix ) { if ( IsXMLToken( aLocalName, XML_NAME ) ) { - const OUString& rValue = rAttrList->getValueByIndex( i ); - if( rValue == "RedlineProtectionKey" ) + const OUString aValue = rAttrList->getValueByIndex( i ); + if( aValue == "RedlineProtectionKey" ) m_bIsRedlineProtectionKey = true; - else if( rValue == "CursorPositionX" ) + else if( aValue == "CursorPositionX" ) m_bIsCursorX = true; - else if( rValue == "CursorPositionY" ) + else if( aValue == "CursorPositionY" ) m_bIsCursorY = true; break; diff --git a/xmloff/source/transform/StyleOASISTContext.cxx b/xmloff/source/transform/StyleOASISTContext.cxx index 75e99d205d39..fe4274d9389c 100644 --- a/xmloff/source/transform/StyleOASISTContext.cxx +++ b/xmloff/source/transform/StyleOASISTContext.cxx @@ -134,11 +134,11 @@ void XMLPropertiesTContext_Impl::StartElement( sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = rAttrList->getNameByIndex( i ); - const OUString& rAttrValue = rAttrList->getValueByIndex( i ); + const OUString aAttrName = rAttrList->getNameByIndex( i ); + const OUString aAttrValue = rAttrList->getValueByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); @@ -151,7 +151,7 @@ void XMLPropertiesTContext_Impl::StartElement( case XML_ATACTION_REMOVE: break; case XML_ATACTION_COPY: - pAttrList->AddAttribute( rAttrName, rAttrValue ); + pAttrList->AddAttribute( aAttrName, aAttrValue ); break; case XML_ATACTION_RENAME: { @@ -160,30 +160,30 @@ void XMLPropertiesTContext_Impl::StartElement( (*aIter).second.GetQNamePrefixFromParam1(), ::xmloff::token::GetXMLToken( (*aIter).second.GetQNameTokenFromParam1()) ) ); - pAttrList->AddAttribute( aNewAttrQName, rAttrValue ); + pAttrList->AddAttribute( aNewAttrQName, aAttrValue ); } break; case XML_ATACTION_IN2INCH: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); XMLTransformerBase::ReplaceSingleInWithInch( - aAttrValue ); - pAttrList->AddAttribute( rAttrName, aAttrValue ); + aAttrValue2 ); + pAttrList->AddAttribute( aAttrName, aAttrValue2 ); } break; case XML_ATACTION_INS2INCHS: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); XMLTransformerBase::ReplaceInWithInch( - aAttrValue ); - pAttrList->AddAttribute( rAttrName, aAttrValue ); + aAttrValue2 ); + pAttrList->AddAttribute( aAttrName, aAttrValue2 ); } break; case XML_ATACTION_DECODE_STYLE_NAME_REF: { - OUString aAttrValue( rAttrValue ); - XMLTransformerBase::DecodeStyleName(aAttrValue); - pAttrList->AddAttribute( rAttrName, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + XMLTransformerBase::DecodeStyleName(aAttrValue2); + pAttrList->AddAttribute( aAttrName, aAttrValue2 ); } break; case XML_ATACTION_RENAME_DECODE_STYLE_NAME_REF: @@ -193,16 +193,16 @@ void XMLPropertiesTContext_Impl::StartElement( (*aIter).second.GetQNamePrefixFromParam1(), ::xmloff::token::GetXMLToken( (*aIter).second.GetQNameTokenFromParam1()) ) ); - OUString aAttrValue( rAttrValue ); - XMLTransformerBase::DecodeStyleName(aAttrValue); - pAttrList->AddAttribute( aNewAttrQName, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + XMLTransformerBase::DecodeStyleName(aAttrValue2); + pAttrList->AddAttribute( aNewAttrQName, aAttrValue2 ); } break; case XML_ATACTION_NEG_PERCENT: { - OUString aAttrValue( rAttrValue ); - XMLTransformerBase::NegPercent(aAttrValue); - pAttrList->AddAttribute( rAttrName, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + XMLTransformerBase::NegPercent(aAttrValue2); + pAttrList->AddAttribute( aAttrName, aAttrValue2 ); } break; case XML_ATACTION_RENAME_NEG_PERCENT: @@ -212,15 +212,15 @@ void XMLPropertiesTContext_Impl::StartElement( (*aIter).second.GetQNamePrefixFromParam1(), ::xmloff::token::GetXMLToken( (*aIter).second.GetQNameTokenFromParam1()) ) ); - OUString aAttrValue( rAttrValue ); - XMLTransformerBase::NegPercent(aAttrValue); - pAttrList->AddAttribute( aNewAttrQName, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + XMLTransformerBase::NegPercent(aAttrValue2); + pAttrList->AddAttribute( aNewAttrQName, aAttrValue2 ); } break; case XML_OPTACTION_LINE_MODE: { bool bWordMode = - IsXMLToken( rAttrValue, XML_SKIP_WHITE_SPACE ); + IsXMLToken( aAttrValue, XML_SKIP_WHITE_SPACE ); OUString aAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_FO, @@ -231,9 +231,9 @@ void XMLPropertiesTContext_Impl::StartElement( { if( bWordMode ) { - const OUString& rOldValue = + const OUString aOldValue = pAttrList->getValueByIndex( nIndex ); - if( !IsXMLToken( rOldValue, XML_TRUE ) ) + if( !IsXMLToken( aOldValue, XML_TRUE ) ) { pAttrList->SetValueByIndex( nIndex, GetXMLToken( XML_TRUE ) ); @@ -242,55 +242,55 @@ void XMLPropertiesTContext_Impl::StartElement( } else { - const OUString& aAttrValue( GetXMLToken( bWordMode + const OUString& aAttrValue2( GetXMLToken( bWordMode ? XML_FALSE : XML_TRUE ) ); - pAttrList->AddAttribute( aAttrQName, aAttrValue ); + pAttrList->AddAttribute( aAttrQName, aAttrValue2 ); } } break; case XML_OPTACTION_KEEP_WITH_NEXT: { - const OUString& aAttrValue( GetXMLToken( - IsXMLToken( rAttrValue, XML_ALWAYS ) + const OUString& aAttrValue2( GetXMLToken( + IsXMLToken( aAttrValue, XML_ALWAYS ) ? XML_TRUE : XML_FALSE) ); - pAttrList->AddAttribute( rAttrName, aAttrValue ); + pAttrList->AddAttribute( aAttrName, aAttrValue2 ); } break; case XML_OPTACTION_UNDERLINE_WIDTH: - if( IsXMLToken( rAttrValue, XML_BOLD ) ) + if( IsXMLToken( aAttrValue, XML_BOLD ) ) bBoldUnderline = true; break; case XML_OPTACTION_UNDERLINE_TYPE: - if( IsXMLToken( rAttrValue, XML_DOUBLE ) ) + if( IsXMLToken( aAttrValue, XML_DOUBLE ) ) bDoubleUnderline = true; break; case XML_OPTACTION_UNDERLINE_STYLE: - eUnderline = GetTransformer().GetToken( rAttrValue ); + eUnderline = GetTransformer().GetToken( aAttrValue ); break; case XML_OPTACTION_LINETHROUGH_WIDTH: - if( IsXMLToken( rAttrValue, XML_BOLD ) ) + if( IsXMLToken( aAttrValue, XML_BOLD ) ) bBoldLineThrough = true; break; case XML_OPTACTION_LINETHROUGH_TYPE: - if( IsXMLToken( rAttrValue, XML_DOUBLE ) ) + if( IsXMLToken( aAttrValue, XML_DOUBLE ) ) bDoubleLineThrough = true; break; case XML_OPTACTION_LINETHROUGH_STYLE: - eLineThrough = GetTransformer().GetToken( rAttrValue ); + eLineThrough = GetTransformer().GetToken( aAttrValue ); break; case XML_OPTACTION_LINETHROUGH_TEXT: - if( !rAttrValue.isEmpty() ) - cLineThroughChar = rAttrValue[0]; + if( !aAttrValue.isEmpty() ) + cLineThroughChar = aAttrValue[0]; break; case XML_OPTACTION_INTERPOLATION: { // 0: none (default) sal_Int32 nSplineType = 0; - if( IsXMLToken( rAttrValue, XML_CUBIC_SPLINE )) + if( IsXMLToken( aAttrValue, XML_CUBIC_SPLINE )) nSplineType = 1; - else if( IsXMLToken( rAttrValue, XML_B_SPLINE )) + else if( IsXMLToken( aAttrValue, XML_B_SPLINE )) nSplineType = 2; pAttrList->AddAttribute( @@ -301,11 +301,11 @@ void XMLPropertiesTContext_Impl::StartElement( } break; case XML_OPTACTION_INTERVAL_MAJOR: - pAttrList->AddAttribute( rAttrName, rAttrValue ); - ::sax::Converter::convertDouble(fIntervalMajor, rAttrValue); + pAttrList->AddAttribute( aAttrName, aAttrValue ); + ::sax::Converter::convertDouble(fIntervalMajor, aAttrValue); break; case XML_OPTACTION_INTERVAL_MINOR_DIVISOR: - ::sax::Converter::convertNumber(nIntervalMinorDivisor, rAttrValue); + ::sax::Converter::convertNumber(nIntervalMinorDivisor, aAttrValue); bIntervalMinorFound = true; break; case XML_OPTACTION_SYMBOL_TYPE: @@ -313,11 +313,11 @@ void XMLPropertiesTContext_Impl::StartElement( // if symbol_type is "named-symbol" the "symbol" // property is set in the action XML_OPTACTION_SYMBOL_NAME sal_Int32 nSymbolType = 0; - if( IsXMLToken( rAttrValue, XML_NONE )) + if( IsXMLToken( aAttrValue, XML_NONE )) nSymbolType = -3; - else if( IsXMLToken( rAttrValue, XML_AUTOMATIC )) + else if( IsXMLToken( aAttrValue, XML_AUTOMATIC )) nSymbolType = -2; - else if( IsXMLToken( rAttrValue, XML_IMAGE )) + else if( IsXMLToken( aAttrValue, XML_IMAGE )) nSymbolType = -1; if( nSymbolType < 0 ) @@ -333,35 +333,35 @@ void XMLPropertiesTContext_Impl::StartElement( // assume "symbol-type" == "named-symbol" sal_Int32 nSymbolType = -3; // NONE // "square" just has an awkward token-name - if( IsXMLToken( rAttrValue, XML_GRADIENTSTYLE_SQUARE )) + if( IsXMLToken( aAttrValue, XML_GRADIENTSTYLE_SQUARE )) nSymbolType = 0; - else if( IsXMLToken( rAttrValue, XML_DIAMOND )) + else if( IsXMLToken( aAttrValue, XML_DIAMOND )) nSymbolType = 1; - else if( IsXMLToken( rAttrValue, XML_ARROW_DOWN )) + else if( IsXMLToken( aAttrValue, XML_ARROW_DOWN )) nSymbolType = 2; - else if( IsXMLToken( rAttrValue, XML_ARROW_UP )) + else if( IsXMLToken( aAttrValue, XML_ARROW_UP )) nSymbolType = 3; - else if( IsXMLToken( rAttrValue, XML_ARROW_RIGHT )) + else if( IsXMLToken( aAttrValue, XML_ARROW_RIGHT )) nSymbolType = 4; - else if( IsXMLToken( rAttrValue, XML_ARROW_LEFT )) + else if( IsXMLToken( aAttrValue, XML_ARROW_LEFT )) nSymbolType = 5; - else if( IsXMLToken( rAttrValue, XML_BOW_TIE )) + else if( IsXMLToken( aAttrValue, XML_BOW_TIE )) nSymbolType = 6; - else if( IsXMLToken( rAttrValue, XML_HOURGLASS )) + else if( IsXMLToken( aAttrValue, XML_HOURGLASS )) nSymbolType = 7; - else if( IsXMLToken( rAttrValue, XML_CIRCLE )) + else if( IsXMLToken( aAttrValue, XML_CIRCLE )) nSymbolType = 8; - else if( IsXMLToken( rAttrValue, XML_STAR )) + else if( IsXMLToken( aAttrValue, XML_STAR )) nSymbolType = 9; - else if( IsXMLToken( rAttrValue, XML_X )) + else if( IsXMLToken( aAttrValue, XML_X )) nSymbolType = 10; - else if( IsXMLToken( rAttrValue, XML_PLUS )) + else if( IsXMLToken( aAttrValue, XML_PLUS )) nSymbolType = 11; - else if( IsXMLToken( rAttrValue, XML_ASTERISK )) + else if( IsXMLToken( aAttrValue, XML_ASTERISK )) nSymbolType = 12; - else if( IsXMLToken( rAttrValue, XML_HORIZONTAL_BAR )) + else if( IsXMLToken( aAttrValue, XML_HORIZONTAL_BAR )) nSymbolType = 13; - else if( IsXMLToken( rAttrValue, XML_VERTICAL_BAR )) + else if( IsXMLToken( aAttrValue, XML_VERTICAL_BAR )) nSymbolType = 14; if( nSymbolType >= 0 ) @@ -374,13 +374,13 @@ void XMLPropertiesTContext_Impl::StartElement( break; // #i25616# case XML_OPTACTION_OPACITY: - aOpacityValueRemember = rAttrValue; + aOpacityValueRemember = aAttrValue; XMLTransformerBase::NegPercent(aOpacityValueRemember); break; // #i25616# case XML_OPTACTION_IMAGE_OPACITY: - aImageOpacityValueRemember = rAttrValue; + aImageOpacityValueRemember = aAttrValue; XMLTransformerBase::NegPercent(aImageOpacityValueRemember); break; @@ -389,7 +389,7 @@ void XMLPropertiesTContext_Impl::StartElement( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_STYLE,GetXMLToken(XML_BREAK_INSIDE)), GetXMLToken( - IsXMLToken( rAttrValue, XML_ALWAYS ) + IsXMLToken( aAttrValue, XML_ALWAYS ) ? XML_COLUMNSPLIT_AVOID : XML_AUTO ) ); break; @@ -402,7 +402,7 @@ void XMLPropertiesTContext_Impl::StartElement( XML_NAMESPACE_STYLE, ::xmloff::token::GetXMLToken( XML_TEXT_ALIGN ) ) ); - pAttrList->AddAttribute( aNewAttrQName, rAttrValue ); + pAttrList->AddAttribute( aNewAttrQName, aAttrValue ); } else { @@ -411,44 +411,44 @@ void XMLPropertiesTContext_Impl::StartElement( XML_NAMESPACE_FO, ::xmloff::token::GetXMLToken( XML_TEXT_ALIGN ) ) ); - pAttrList->AddAttribute( aNewAttrQName, rAttrValue ); + pAttrList->AddAttribute( aNewAttrQName, aAttrValue ); } break; case XML_ATACTION_CAPTION_ESCAPE_OASIS: { - OUString aAttrValue( rAttrValue ); - if( aAttrValue.indexOf( '%' ) != -1 ) + OUString aAttrValue2( aAttrValue ); + if( aAttrValue2.indexOf( '%' ) != -1 ) { sal_Int32 nValue = 0; - ::sax::Converter::convertPercent(nValue, rAttrValue); + ::sax::Converter::convertPercent(nValue, aAttrValue); if( nValue ) { nValue *= 100; OUStringBuffer aOut; ::sax::Converter::convertPercent(aOut, nValue); - aAttrValue = aOut.makeStringAndClear(); + aAttrValue2 = aOut.makeStringAndClear(); } } else { - XMLTransformerBase::ReplaceSingleInWithInch( aAttrValue ); + XMLTransformerBase::ReplaceSingleInWithInch( aAttrValue2 ); } - pAttrList->AddAttribute( rAttrName, aAttrValue ); + pAttrList->AddAttribute( aAttrName, aAttrValue2 ); } break; case XML_ATACTION_DECODE_PROTECT: { - pAttrList->AddAttribute( rAttrName, rAttrValue ); + pAttrList->AddAttribute( aAttrName, aAttrValue ); - if( rAttrValue.indexOf( GetXMLToken( XML_SIZE ) ) != -1 ) + if( aAttrValue.indexOf( GetXMLToken( XML_SIZE ) ) != -1 ) pAttrList->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken( XML_SIZE_PROTECT )), GetXMLToken( XML_TRUE ) ); - if( rAttrValue.indexOf( GetXMLToken( XML_POSITION ) ) != -1 ) + if( aAttrValue.indexOf( GetXMLToken( XML_POSITION ) ) != -1 ) pAttrList->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken( XML_MOVE_PROTECT )), GetXMLToken( XML_TRUE ) ); @@ -460,7 +460,7 @@ void XMLPropertiesTContext_Impl::StartElement( // keep original for writer graphic objects // Adapts attribute values (#i49139#) OUStringBuffer aNewAttrValue; - SvXMLTokenEnumerator aTokenEnum( rAttrValue ); + SvXMLTokenEnumerator aTokenEnum( aAttrValue ); std::u16string_view aToken; while( aTokenEnum.getNextToken( aToken ) ) { @@ -482,39 +482,39 @@ void XMLPropertiesTContext_Impl::StartElement( aNewAttrValue.append(aToken); } } - pAttrList->AddAttribute( rAttrName, aNewAttrValue.makeStringAndClear() ); + pAttrList->AddAttribute( aAttrName, aNewAttrValue.makeStringAndClear() ); // create old draw:mirror for drawing graphic objects - const OUString& aAttrValue( GetXMLToken( IsXMLToken( rAttrValue, XML_HORIZONTAL ) ? XML_TRUE : XML_FALSE ) ); + const OUString& aAttrValue2( GetXMLToken( IsXMLToken( aAttrValue, XML_HORIZONTAL ) ? XML_TRUE : XML_FALSE ) ); pAttrList->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, - GetXMLToken( XML_MIRROR )), aAttrValue ); + GetXMLToken( XML_MIRROR )), aAttrValue2 ); } break; case XML_ATACTION_GAMMA_OASIS: // converts percentage value to double { sal_Int32 nValue; - ::sax::Converter::convertPercent( nValue, rAttrValue ); + ::sax::Converter::convertPercent( nValue, aAttrValue ); const double fValue = static_cast(nValue) / 100.0; - pAttrList->AddAttribute( rAttrName, OUString::number( fValue ) ); + pAttrList->AddAttribute( aAttrName, OUString::number( fValue ) ); } break; case XML_ATACTION_OPACITY_FIX: { sal_Int32 nValue; - if( rAttrValue.indexOf( '%' ) != -1 ) + if( aAttrValue.indexOf( '%' ) != -1 ) { - ::sax::Converter::convertPercent(nValue, rAttrValue); + ::sax::Converter::convertPercent(nValue, aAttrValue); } else { - nValue = sal_Int32( rAttrValue.toDouble() * 100.0 ); + nValue = sal_Int32( aAttrValue.toDouble() * 100.0 ); } nValue = 100 - nValue; OUStringBuffer aOut; ::sax::Converter::convertPercent(aOut, nValue); - pAttrList->AddAttribute( rAttrName, aOut.makeStringAndClear() ); + pAttrList->AddAttribute( aAttrName, aOut.makeStringAndClear() ); } break; default: @@ -524,7 +524,7 @@ void XMLPropertiesTContext_Impl::StartElement( } else { - pAttrList->AddAttribute( rAttrName, rAttrValue ); + pAttrList->AddAttribute( aAttrName, aAttrValue ); } } if( XML_TOKEN_END != eUnderline ) @@ -782,10 +782,10 @@ void XMLStyleOASISTContext::StartElement( for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); + const OUString aAttrName = xAttrList->getNameByIndex( i ); OUString aLocalName; sal_uInt16 nPrefix = - GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName, + GetTransformer().GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); XMLTransformerActions::const_iterator aIter = @@ -798,18 +798,18 @@ void XMLStyleOASISTContext::StartElement( new XMLMutableAttributeList( xAttrList ); xAttrList = pMutableAttrList; } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); switch( (*aIter).second.m_nActionType ) { case XML_ATACTION_STYLE_FAMILY: - if( IsXMLToken( rAttrValue, XML_GRAPHIC ) ) + if( IsXMLToken( aAttrValue, XML_GRAPHIC ) ) { pMutableAttrList->SetValueByIndex( i, GetXMLToken(XML_GRAPHICS) ); } else { - if( IsXMLToken( rAttrValue, XML_PARAGRAPH ) ) + if( IsXMLToken( aAttrValue, XML_PARAGRAPH ) ) nFamilyAttr = i; } @@ -821,36 +821,36 @@ void XMLStyleOASISTContext::StartElement( --nAttrCount; break; case XML_ATACTION_DECODE_STYLE_NAME: - m_bControlStyle = rAttrValue.startsWith( "ctrl" ); + m_bControlStyle = aAttrValue.startsWith( "ctrl" ); [[fallthrough]]; case XML_ATACTION_DECODE_STYLE_NAME_REF: { - OUString aAttrValue( rAttrValue ); - if( XMLTransformerBase::DecodeStyleName(aAttrValue) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( XMLTransformerBase::DecodeStyleName(aAttrValue2) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_IN2INCH: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); if( XMLTransformerBase::ReplaceSingleInWithInch( - aAttrValue ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + aAttrValue2 ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_NEG_PERCENT: { - OUString aAttrValue( rAttrValue ); - if( XMLTransformerBase::NegPercent(aAttrValue) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( XMLTransformerBase::NegPercent(aAttrValue2) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_URI_OASIS: { - OUString aAttrValue( rAttrValue ); - if( GetTransformer().ConvertURIToOOo( aAttrValue, + OUString aAttrValue2( aAttrValue ); + if( GetTransformer().ConvertURIToOOo( aAttrValue2, static_cast< bool >((*aIter).second.m_nParam1))) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; default: diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx index 819eb9d89831..7c2d0807a3c2 100644 --- a/xmloff/source/transform/TransformerBase.cxx +++ b/xmloff/source/transform/TransformerBase.cxx @@ -213,34 +213,34 @@ void SAL_CALL XMLTransformerBase::startElement( const OUString& rName, sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); - if( ( rAttrName.getLength() >= 5 ) && - ( rAttrName.startsWith( GetXMLToken(XML_XMLNS) ) ) && - ( rAttrName.getLength() == 5 || ':' == rAttrName[5] ) ) + const OUString aAttrName = xAttrList->getNameByIndex( i ); + if( ( aAttrName.getLength() >= 5 ) && + ( aAttrName.startsWith( GetXMLToken(XML_XMLNS) ) ) && + ( aAttrName.getLength() == 5 || ':' == aAttrName[5] ) ) { if( !pRewindMap ) { pRewindMap = std::move(m_pNamespaceMap); m_pNamespaceMap.reset( new SvXMLNamespaceMap( *pRewindMap ) ); } - const OUString& rAttrValue = xAttrList->getValueByIndex( i ); + const OUString aAttrValue = xAttrList->getValueByIndex( i ); - OUString aPrefix( ( rAttrName.getLength() == 5 ) + OUString aPrefix( ( aAttrName.getLength() == 5 ) ? OUString() - : rAttrName.copy( 6 ) ); + : aAttrName.copy( 6 ) ); // Add namespace, but only if it is known. - sal_uInt16 nKey = m_pNamespaceMap->AddIfKnown( aPrefix, rAttrValue ); + sal_uInt16 nKey = m_pNamespaceMap->AddIfKnown( aPrefix, aAttrValue ); // If namespace is unknown, try to match a name with similar // TC Id and version if( XML_NAMESPACE_UNKNOWN == nKey ) { - OUString aTestName( rAttrValue ); + OUString aTestName( aAttrValue ); if( SvXMLNamespaceMap::NormalizeOasisURN( aTestName ) ) nKey = m_pNamespaceMap->AddIfKnown( aPrefix, aTestName ); } // If that namespace is not known, too, add it as unknown if( XML_NAMESPACE_UNKNOWN == nKey ) - nKey = m_pNamespaceMap->Add( aPrefix, rAttrValue ); + nKey = m_pNamespaceMap->Add( aPrefix, aAttrValue ); const OUString& rRepName = m_vReplaceNamespaceMap.GetNameByKey( nKey ); if( !rRepName.isEmpty() ) @@ -474,10 +474,10 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; ++i ) { - const OUString& rAttrName = rAttrList->getNameByIndex( i ); - const OUString& rAttrValue = rAttrList->getValueByIndex( i ); + const OUString aAttrName = rAttrList->getNameByIndex( i ); + const OUString aAttrValue = rAttrList->getValueByIndex( i ); OUString aLocalName; - sal_uInt16 nPrefix = GetNamespaceMap().GetKeyByAttrName( rAttrName, + sal_uInt16 nPrefix = GetNamespaceMap().GetKeyByAttrName( aAttrName, &aLocalName ); XMLTransformerActions::key_type aKey( nPrefix, aLocalName ); @@ -512,16 +512,16 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( [[fallthrough]]; case XML_ATACTION_IN2INCH: { - OUString aAttrValue( rAttrValue ); - if( ReplaceSingleInWithInch( aAttrValue ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( ReplaceSingleInWithInch( aAttrValue2 ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_INS2INCHS: { - OUString aAttrValue( rAttrValue ); - if( ReplaceInWithInch( aAttrValue ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( ReplaceInWithInch( aAttrValue2 ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_RENAME_INCH2IN: @@ -529,31 +529,31 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( [[fallthrough]]; case XML_ATACTION_INCH2IN: { - OUString aAttrValue( rAttrValue ); - if( ReplaceSingleInchWithIn( aAttrValue ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( ReplaceSingleInchWithIn( aAttrValue2 ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_INCHS2INS: { - OUString aAttrValue( rAttrValue ); - if( ReplaceInchWithIn( aAttrValue ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( ReplaceInchWithIn( aAttrValue2 ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_TWIPS2IN: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); - XMLTransformerBase::ReplaceSingleInchWithIn( aAttrValue ); + XMLTransformerBase::ReplaceSingleInchWithIn( aAttrValue2 ); if( isWriter() ) { - sal_Int16 const nDestUnit = lcl_getUnit(aAttrValue); + sal_Int16 const nDestUnit = lcl_getUnit(aAttrValue2); // convert twips value to inch sal_Int32 nMeasure; if (::sax::Converter::convertMeasure(nMeasure, - aAttrValue)) + aAttrValue2)) { nMeasure = static_cast(convertTwipToMm100(nMeasure)); @@ -561,11 +561,11 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( ::sax::Converter::convertMeasure(aBuffer, nMeasure, util::MeasureUnit::MM_100TH, nDestUnit ); - aAttrValue = aBuffer.makeStringAndClear(); + aAttrValue2 = aBuffer.makeStringAndClear(); } } - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_RENAME_DECODE_STYLE_NAME_REF: @@ -574,24 +574,24 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( case XML_ATACTION_DECODE_STYLE_NAME: case XML_ATACTION_DECODE_STYLE_NAME_REF: { - OUString aAttrValue( rAttrValue ); - if( DecodeStyleName(aAttrValue) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( DecodeStyleName(aAttrValue2) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_ENCODE_STYLE_NAME: { - OUString aAttrValue( rAttrValue ); - if( EncodeStyleName(aAttrValue) ) + OUString aAttrValue2( aAttrValue ); + if( EncodeStyleName(aAttrValue2) ) { - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); OUString aNewAttrQName( GetNamespaceMap().GetQNameByKey( nPrefix, ::xmloff::token::GetXMLToken( XML_DISPLAY_NAME ) ) ); pMutableAttrList->AddAttribute( aNewAttrQName, - rAttrValue ); + aAttrValue ); } } break; @@ -600,9 +600,9 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( [[fallthrough]]; case XML_ATACTION_ENCODE_STYLE_NAME_REF: { - OUString aAttrValue( rAttrValue ); - if( EncodeStyleName(aAttrValue) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( EncodeStyleName(aAttrValue2) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_RENAME_NEG_PERCENT: @@ -610,9 +610,9 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( [[fallthrough]]; case XML_ATACTION_NEG_PERCENT: { - OUString aAttrValue( rAttrValue ); - if( NegPercent( aAttrValue ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( NegPercent( aAttrValue2 ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_RENAME_ADD_NAMESPACE_PREFIX: @@ -620,26 +620,26 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( [[fallthrough]]; case XML_ATACTION_ADD_NAMESPACE_PREFIX: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); sal_uInt16 nValPrefix = static_cast( bRename ? (*aIter).second.m_nParam2 : (*aIter).second.m_nParam1); - AddNamespacePrefix( aAttrValue, nValPrefix ); - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + AddNamespacePrefix( aAttrValue2, nValPrefix ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_ADD_APP_NAMESPACE_PREFIX: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); sal_uInt16 nValPrefix = static_cast((*aIter).second.m_nParam1); if( IsXMLToken( GetClass(), XML_SPREADSHEET ) ) nValPrefix = XML_NAMESPACE_OOOC; else if( IsXMLToken( GetClass(), XML_TEXT ) ) nValPrefix = XML_NAMESPACE_OOOW; - AddNamespacePrefix( aAttrValue, nValPrefix ); - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + AddNamespacePrefix( aAttrValue2, nValPrefix ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX: @@ -647,77 +647,77 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( [[fallthrough]]; case XML_ATACTION_REMOVE_NAMESPACE_PREFIX: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); sal_uInt16 nValPrefix = static_cast( bRename ? (*aIter).second.m_nParam2 : (*aIter).second.m_nParam1); - if( RemoveNamespacePrefix( aAttrValue, nValPrefix ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + if( RemoveNamespacePrefix( aAttrValue2, nValPrefix ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX: { - OUString aAttrValue( rAttrValue ); - if( RemoveNamespacePrefix( aAttrValue ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( RemoveNamespacePrefix( aAttrValue2 ) ) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_URI_OOO: { - OUString aAttrValue( rAttrValue ); - if( ConvertURIToOASIS( aAttrValue, + OUString aAttrValue2( aAttrValue ); + if( ConvertURIToOASIS( aAttrValue2, static_cast< bool >((*aIter).second.m_nParam1))) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_URI_OASIS: { - OUString aAttrValue( rAttrValue ); - if( ConvertURIToOOo( aAttrValue, + OUString aAttrValue2( aAttrValue ); + if( ConvertURIToOOo( aAttrValue2, static_cast< bool >((*aIter).second.m_nParam1))) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_RENAME_ATTRIBUTE: { - OUString aAttrValue( rAttrValue ); + OUString aAttrValue2( aAttrValue ); RenameAttributeValue( - aAttrValue, + aAttrValue2, (*aIter).second.m_nParam1, (*aIter).second.m_nParam2, (*aIter).second.m_nParam3 ); - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_RNG2ISO_DATETIME: { - OUString aAttrValue( rAttrValue ); - if( ConvertRNGDateTimeToISO( aAttrValue )) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( ConvertRNGDateTimeToISO( aAttrValue2 )) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_RENAME_RNG2ISO_DATETIME: { - OUString aAttrValue( rAttrValue ); - if( ConvertRNGDateTimeToISO( aAttrValue )) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + if( ConvertRNGDateTimeToISO( aAttrValue2 )) + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); bRename = true; } break; case XML_ATACTION_IN2TWIPS: { - OUString aAttrValue( rAttrValue ); - XMLTransformerBase::ReplaceSingleInWithInch( aAttrValue ); + OUString aAttrValue2( aAttrValue ); + XMLTransformerBase::ReplaceSingleInWithInch( aAttrValue2 ); if( isWriter() ) { - sal_Int16 const nDestUnit = lcl_getUnit(aAttrValue); + sal_Int16 const nDestUnit = lcl_getUnit(aAttrValue2); // convert inch value to twips and export as faked inch sal_Int32 nMeasure; if (::sax::Converter::convertMeasure(nMeasure, - aAttrValue)) + aAttrValue2)) { nMeasure = o3tl::toTwips(nMeasure, o3tl::Length::mm100); @@ -725,23 +725,23 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( ::sax::Converter::convertMeasure( aBuffer, nMeasure, util::MeasureUnit::MM_100TH, nDestUnit ); - aAttrValue = aBuffer.makeStringAndClear(); + aAttrValue2 = aBuffer.makeStringAndClear(); } } - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_SVG_WIDTH_HEIGHT_OOO: { - OUString aAttrValue( rAttrValue ); - ReplaceSingleInchWithIn( aAttrValue ); + OUString aAttrValue2( aAttrValue ); + ReplaceSingleInchWithIn( aAttrValue2 ); - sal_Int16 const nDestUnit = lcl_getUnit( aAttrValue ); + sal_Int16 const nDestUnit = lcl_getUnit( aAttrValue2 ); sal_Int32 nMeasure; if (::sax::Converter::convertMeasure(nMeasure, - aAttrValue)) + aAttrValue2)) { if( nMeasure > 0 ) @@ -753,22 +753,22 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( OUStringBuffer aBuffer; ::sax::Converter::convertMeasure(aBuffer, nMeasure, util::MeasureUnit::MM_100TH, nDestUnit); - aAttrValue = aBuffer.makeStringAndClear(); + aAttrValue2 = aBuffer.makeStringAndClear(); } - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS: { - OUString aAttrValue( rAttrValue ); - ReplaceSingleInWithInch( aAttrValue ); + OUString aAttrValue2( aAttrValue ); + ReplaceSingleInWithInch( aAttrValue2 ); - sal_Int16 const nDestUnit = lcl_getUnit( aAttrValue ); + sal_Int16 const nDestUnit = lcl_getUnit( aAttrValue2 ); sal_Int32 nMeasure; if (::sax::Converter::convertMeasure(nMeasure, - aAttrValue)) + aAttrValue2)) { if( nMeasure > 0 ) @@ -780,21 +780,21 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( OUStringBuffer aBuffer; ::sax::Converter::convertMeasure(aBuffer, nMeasure, util::MeasureUnit::MM_100TH, nDestUnit ); - aAttrValue = aBuffer.makeStringAndClear(); + aAttrValue2 = aBuffer.makeStringAndClear(); } - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } break; case XML_ATACTION_DECODE_ID: { - const sal_Int32 nLen = rAttrValue.getLength(); + const sal_Int32 nLen = aAttrValue.getLength(); OUStringBuffer aBuffer; sal_Int32 pos; for( pos = 0; pos < nLen; pos++ ) { - sal_Unicode c = rAttrValue[pos]; + sal_Unicode c = aAttrValue[pos]; if( (c >= '0') && (c <= '9') ) aBuffer.append( c ); else @@ -823,16 +823,16 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( // read the value. Thus, it's interpreted as 0% if ( !bIsDocumentStyle ) { - OUString aAttrValue( rAttrValue ); - NegPercent(aAttrValue); - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + OUString aAttrValue2( aAttrValue ); + NegPercent(aAttrValue2); + pMutableAttrList->SetValueByIndex( i, aAttrValue2 ); } bRename = true; } break; case XML_ATACTION_SHAPEID: { - OUString sNewValue = "shape" + rAttrValue; + OUString sNewValue = "shape" + aAttrValue; pMutableAttrList->SetValueByIndex( i, sNewValue ); break; }