summaryrefslogtreecommitdiff
path: root/xmloff/source/transform
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-30 15:24:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-30 21:04:40 +0200
commit83d8331581ab43cf35325ca674cf62d4ba5dc5ad (patch)
tree052e506efe8c6dbf2eb59935768aca7f781bfa92 /xmloff/source/transform
parentc90da566ed1026a70217ac8a52a90e5df5c3026e (diff)
loplugin:stringloop in svgio..xmlsecurity
Change-Id: I1b2fe5674c8350690efc3d3219b9273cc61d5b0c Reviewed-on: https://gerrit.libreoffice.org/58332 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/transform')
-rw-r--r--xmloff/source/transform/StyleOASISTContext.cxx12
-rw-r--r--xmloff/source/transform/StyleOOoTContext.cxx12
2 files changed, 12 insertions, 12 deletions
diff --git a/xmloff/source/transform/StyleOASISTContext.cxx b/xmloff/source/transform/StyleOASISTContext.cxx
index fafd8e9ace7e..091fb2eea0cc 100644
--- a/xmloff/source/transform/StyleOASISTContext.cxx
+++ b/xmloff/source/transform/StyleOASISTContext.cxx
@@ -471,30 +471,30 @@ void XMLPropertiesTContext_Impl::StartElement(
{
// keep original for writer graphic objects
// Adapts attribute values (#i49139#)
- OUString aNewAttrValue;
+ OUStringBuffer aNewAttrValue;
SvXMLTokenEnumerator aTokenEnum( rAttrValue );
OUString aToken;
while( aTokenEnum.getNextToken( aToken ) )
{
if ( !aNewAttrValue.isEmpty() )
{
- aNewAttrValue += " ";
+ aNewAttrValue.append(" ");
}
if ( IsXMLToken( aToken, XML_HORIZONTAL_ON_EVEN ) )
{
- aNewAttrValue += GetXMLToken( XML_HORIZONTAL_ON_LEFT_PAGES );
+ aNewAttrValue.append(GetXMLToken( XML_HORIZONTAL_ON_LEFT_PAGES ));
}
else if ( IsXMLToken( aToken, XML_HORIZONTAL_ON_ODD ) )
{
- aNewAttrValue += GetXMLToken( XML_HORIZONTAL_ON_RIGHT_PAGES );
+ aNewAttrValue.append(GetXMLToken( XML_HORIZONTAL_ON_RIGHT_PAGES ));
}
else
{
- aNewAttrValue += aToken;
+ aNewAttrValue.append(aToken);
}
}
- pAttrList->AddAttribute( rAttrName, aNewAttrValue );
+ pAttrList->AddAttribute( rAttrName, aNewAttrValue.makeStringAndClear() );
// create old draw:mirror for drawing graphic objects
const OUString& aAttrValue( GetXMLToken( IsXMLToken( rAttrValue, XML_HORIZONTAL ) ? XML_TRUE : XML_FALSE ) );
diff --git a/xmloff/source/transform/StyleOOoTContext.cxx b/xmloff/source/transform/StyleOOoTContext.cxx
index 6b1cceede346..ad530502d71f 100644
--- a/xmloff/source/transform/StyleOOoTContext.cxx
+++ b/xmloff/source/transform/StyleOOoTContext.cxx
@@ -382,7 +382,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement(
produces styles with both attributes. (#i49139#)
*/
bool bExistStyleMirror( false );
- OUString aStyleMirrorAttrValue;
+ OUStringBuffer aStyleMirrorAttrValue;
bool bExistDrawMirror( false );
OUString aDrawMirrorAttrValue;
XMLTypedPropertiesOOoTContext_Impl* pMirrorContext( nullptr );
@@ -876,20 +876,20 @@ void XMLPropertiesOOoTContext_Impl::StartElement(
{
if ( !aStyleMirrorAttrValue.isEmpty() )
{
- aStyleMirrorAttrValue += " ";
+ aStyleMirrorAttrValue.append(" ");
}
if ( IsXMLToken( aToken, XML_HORIZONTAL_ON_LEFT_PAGES ) )
{
- aStyleMirrorAttrValue += GetXMLToken( XML_HORIZONTAL_ON_EVEN );
+ aStyleMirrorAttrValue.append(GetXMLToken( XML_HORIZONTAL_ON_EVEN ));
}
else if ( IsXMLToken( aToken, XML_HORIZONTAL_ON_RIGHT_PAGES ) )
{
- aStyleMirrorAttrValue += GetXMLToken( XML_HORIZONTAL_ON_ODD );
+ aStyleMirrorAttrValue.append(GetXMLToken( XML_HORIZONTAL_ON_ODD ));
}
else
{
- aStyleMirrorAttrValue += aToken;
+ aStyleMirrorAttrValue.append(aToken);
}
}
bExistStyleMirror = true;
@@ -937,7 +937,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement(
pMirrorContext->AddAttribute(
GetTransformer().GetNamespaceMap().GetQNameByKey(
XML_NAMESPACE_STYLE, GetXMLToken( XML_MIRROR ) ),
- aStyleMirrorAttrValue);
+ aStyleMirrorAttrValue.makeStringAndClear());
}
else if ( bExistDrawMirror )
{