summaryrefslogtreecommitdiff
path: root/comphelper/source/xml
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-06 09:23:33 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-09 08:34:40 +0000
commit6c80a8fe89fadf9a2c7260a09c037a09462f53d1 (patch)
treed36da9ee2a5fdc579d2a57ff6ba02deaddfa785a /comphelper/source/xml
parente1fc599eb764186e5d511ace9785463eebbc7028 (diff)
new loplugin: oncevar
Change-Id: If57390510dde4d166be3141b9f658a7453755d3f Reviewed-on: https://gerrit.libreoffice.org/19815 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'comphelper/source/xml')
-rw-r--r--comphelper/source/xml/ofopxmlhelper.cxx18
1 files changed, 6 insertions, 12 deletions
diff --git a/comphelper/source/xml/ofopxmlhelper.cxx b/comphelper/source/xml/ofopxmlhelper.cxx
index 23ced17483a2..161481229914 100644
--- a/comphelper/source/xml/ofopxmlhelper.cxx
+++ b/comphelper/source/xml/ofopxmlhelper.cxx
@@ -128,10 +128,6 @@ void WriteRelationsInfoSequence(
OUString aRelListElement( "Relationships" );
OUString aRelElement( "Relationship" );
- OUString aIDAttr( "Id" );
- OUString aTypeAttr( "Type" );
- OUString aTargetModeAttr( "TargetMode" );
- OUString aTargetAttr( "Target" );
OUString aCDATAString( "CDATA" );
OUString aWhiteSpace( " " );
@@ -152,10 +148,10 @@ void WriteRelationsInfoSequence(
uno::Reference< xml::sax::XAttributeList > xAttrList( pAttrList );
for( sal_Int32 nSecInd = 0; nSecInd < aSequence[nInd].getLength(); nSecInd++ )
{
- if ( aSequence[nInd][nSecInd].First.equals( aIDAttr )
- || aSequence[nInd][nSecInd].First.equals( aTypeAttr )
- || aSequence[nInd][nSecInd].First.equals( aTargetModeAttr )
- || aSequence[nInd][nSecInd].First.equals( aTargetAttr ) )
+ if ( aSequence[nInd][nSecInd].First == "Id"
+ || aSequence[nInd][nSecInd].First == "Type"
+ || aSequence[nInd][nSecInd].First == "TargetMode"
+ || aSequence[nInd][nSecInd].First == "Target" )
{
pAttrList->AddAttribute( aSequence[nInd][nSecInd].First, aCDATAString, aSequence[nInd][nSecInd].Second );
}
@@ -194,8 +190,6 @@ void WriteContentSequence(
OUString aTypesElement( "Types" );
OUString aDefaultElement( "Default" );
OUString aOverrideElement( "Override" );
- OUString aExtensionAttr( "Extension" );
- OUString aPartNameAttr( "PartName" );
OUString aContentTypeAttr( "ContentType" );
OUString aCDATAString( "CDATA" );
OUString aWhiteSpace( " " );
@@ -215,7 +209,7 @@ void WriteContentSequence(
{
AttributeList *pAttrList = new AttributeList;
uno::Reference< xml::sax::XAttributeList > xAttrList( pAttrList );
- pAttrList->AddAttribute( aExtensionAttr, aCDATAString, aDefaultsSequence[nInd].First );
+ pAttrList->AddAttribute( "Extension", aCDATAString, aDefaultsSequence[nInd].First );
pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, aDefaultsSequence[nInd].Second );
xWriter->startElement( aDefaultElement, xAttrList );
@@ -227,7 +221,7 @@ void WriteContentSequence(
{
AttributeList *pAttrList = new AttributeList;
uno::Reference< xml::sax::XAttributeList > xAttrList( pAttrList );
- pAttrList->AddAttribute( aPartNameAttr, aCDATAString, aOverridesSequence[nInd].First );
+ pAttrList->AddAttribute( "PartName", aCDATAString, aOverridesSequence[nInd].First );
pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, aOverridesSequence[nInd].Second );
xWriter->startElement( aOverrideElement, xAttrList );