summaryrefslogtreecommitdiff
path: root/xmloff/source/forms
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-28 11:31:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-28 17:23:49 +0200
commitf74281a026a1b231292c928acd2c6f1aa0ba1552 (patch)
treec26750944ab6023b914446be06754a214ea5314b /xmloff/source/forms
parent0c64757b574f8dcffe76087db34310786029e625 (diff)
loplugin:stringloop in xmloff
Change-Id: I33a24e08b7359a75c41b88c21ee31c22b8c62d05 Reviewed-on: https://gerrit.libreoffice.org/58215 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/forms')
-rw-r--r--xmloff/source/forms/elementimport.cxx4
-rw-r--r--xmloff/source/forms/eventexport.cxx7
-rw-r--r--xmloff/source/forms/layerimport.cxx4
-rw-r--r--xmloff/source/forms/propertyexport.cxx12
4 files changed, 11 insertions, 16 deletions
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 4850289e346f..2d63175aa17e 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -454,14 +454,12 @@ namespace xmloff
return OUString(sUnnamedName);
Sequence< OUString > aNames = m_xParentContainer->getElementNames();
- OUString sReturn;
const OUString* pNames = nullptr;
const OUString* pNamesEnd = aNames.getConstArray() + aNames.getLength();
for (sal_Int32 i=0; i<32768; ++i) // the limit is nearly arbitrary ...
{
// assemble the new name (suggestion)
- sReturn = sUnnamedName;
- sReturn += OUString::number(i);
+ OUString sReturn = sUnnamedName + OUString::number(i);
// check the existence (this is the bad performance part ....)
for (pNames = aNames.getConstArray(); pNames<pNamesEnd; ++pNames)
{
diff --git a/xmloff/source/forms/eventexport.cxx b/xmloff/source/forms/eventexport.cxx
index 24c6d6cd3bda..9d27751a6c6a 100644
--- a/xmloff/source/forms/eventexport.cxx
+++ b/xmloff/source/forms/eventexport.cxx
@@ -38,14 +38,13 @@ namespace xmloff
// translate the events
const ScriptEventDescriptor* pEvents = _rEvents.getConstArray();
- OUString sName;
OUString sLibrary, sLocalMacroName;
for (sal_Int32 i=0; i<nEvents; ++i, ++pEvents)
{
// the name of the event is build from listener interface and listener method name
- sName = pEvents->ListenerType;
- sName += EVENT_NAME_SEPARATOR;
- sName += pEvents->EventMethod;
+ OUString sName = pEvents->ListenerType
+ + EVENT_NAME_SEPARATOR
+ + pEvents->EventMethod;
Sequence< PropertyValue >& rMappedEvent = m_aMappedEvents[sName];
diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx
index c4b5ecec73aa..d08060356e6d 100644
--- a/xmloff/source/forms/layerimport.cxx
+++ b/xmloff/source/forms/layerimport.cxx
@@ -390,7 +390,6 @@ void OFormLayerXMLImport_Impl::endPage()
try
{
static const sal_Unicode s_nSeparator = ',';
- OUString sReferring;
OUString sCurrentReferring;
OUString sSeparator(&s_nSeparator, 1);
Reference< XPropertySet > xCurrentReferring;
@@ -405,8 +404,7 @@ void OFormLayerXMLImport_Impl::endPage()
// in a list of n ids there are only n-1 separators ... have to catch this last id
// -> normalize the list
- sReferring = aReferences->second;
- sReferring += sSeparator;
+ OUString sReferring = aReferences->second + sSeparator;
nPrevSep = -1;
while (-1 != (nSeparator = sReferring.indexOf(s_nSeparator, nPrevSep + 1)))
diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx
index 2fad2f4c98d4..c2f168917c04 100644
--- a/xmloff/source/forms/propertyexport.cxx
+++ b/xmloff/source/forms/propertyexport.cxx
@@ -484,7 +484,7 @@ namespace xmloff
Sequence< OUString > aItems;
m_xProps->getPropertyValue( _rPropertyName ) >>= aItems;
- OUString sFinalList;
+ OUStringBuffer sFinalList;
// unfortunately the OUString can't append single sal_Unicode characters ...
const OUString sQuote(&_aQuoteCharacter, 1);
@@ -504,17 +504,17 @@ namespace xmloff
"OPropertyExport::exportStringSequenceAttribute: there is an item which contains the quote character!");
if (bQuote)
- sFinalList += sQuote;
- sFinalList += *pItems;
+ sFinalList.append(sQuote);
+ sFinalList.append(*pItems);
if (bQuote)
- sFinalList += sQuote;
+ sFinalList.append(sQuote);
if (pItems != pLastElement)
- sFinalList += sSeparator;
+ sFinalList.append(sSeparator);
}
if (!sFinalList.isEmpty())
- AddAttribute(_nAttributeNamespaceKey, _pAttributeName, sFinalList);
+ AddAttribute(_nAttributeNamespaceKey, _pAttributeName, sFinalList.makeStringAndClear());
exportedProperty( _rPropertyName );
}