summaryrefslogtreecommitdiff
path: root/xmlsecurity
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 /xmlsecurity
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 'xmlsecurity')
-rw-r--r--xmlsecurity/source/framework/buffernode.cxx19
-rw-r--r--xmlsecurity/source/framework/saxeventkeeperimpl.cxx25
2 files changed, 23 insertions, 21 deletions
diff --git a/xmlsecurity/source/framework/buffernode.cxx b/xmlsecurity/source/framework/buffernode.cxx
index 8a171ffa18f8..fb58e7b6232a 100644
--- a/xmlsecurity/source/framework/buffernode.cxx
+++ b/xmlsecurity/source/framework/buffernode.cxx
@@ -23,6 +23,7 @@
#include "buffernode.hxx"
#include <com/sun/star/xml/crypto/sax/ConstOfSecurityId.hpp>
#include <osl/diagnose.h>
+#include <rtl/ustrbuf.hxx>
namespace cssu = com::sun::star::uno;
namespace cssxw = com::sun::star::xml::wrapper;
@@ -215,37 +216,37 @@ OUString BufferNode::printChildren() const
* result - the information string
******************************************************************************/
{
- OUString rc;
+ OUStringBuffer rc;
std::vector< const ElementCollector* >::const_iterator ii = m_vElementCollectors.begin();
for( ; ii != m_vElementCollectors.end() ; ++ii )
{
- rc += "BufID=" + OUString::number((*ii)->getBufferId());
+ rc.append("BufID=").append(OUString::number((*ii)->getBufferId()));
if ((*ii)->getModify())
{
- rc += "[M]";
+ rc.append("[M]");
}
- rc += ",Pri=";
+ rc.append(",Pri=");
switch ((*ii)->getPriority())
{
case cssxc::sax::ElementMarkPriority_BEFOREMODIFY:
- rc += "BEFOREMODIFY";
+ rc.append("BEFOREMODIFY");
break;
case cssxc::sax::ElementMarkPriority_AFTERMODIFY:
- rc += "AFTERMODIFY";
+ rc.append("AFTERMODIFY");
break;
default:
- rc += "UNKNOWN";
+ rc.append("UNKNOWN");
break;
}
- rc += "(SecID=" + OUString::number((*ii)->getSecurityId()) + ") ";
+ rc.append("(SecID=").append(OUString::number((*ii)->getSecurityId())).append(") ");
}
- return rc;
+ return rc.makeStringAndClear();
}
bool BufferNode::hasAnything() const
diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
index 9659f420c70a..5fea1e76fe3b 100644
--- a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
+++ b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/xml/crypto/sax/ConstOfSecurityId.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <osl/diagnose.h>
+#include <rtl/ustrbuf.hxx>
namespace cssu = com::sun::star::uno;
namespace cssl = com::sun::star::lang;
@@ -301,51 +302,51 @@ OUString SAXEventKeeperImpl::printBufferNode(
* info - the information string
******************************************************************************/
{
- OUString rc;
+ OUStringBuffer rc;
for ( int i=0; i<nIndent; ++i )
{
- rc += " ";
+ rc.append(" ");
}
if (pBufferNode == m_pCurrentBufferNode)
{
- rc += "[%]";
+ rc.append("[%]");
}
if (pBufferNode == m_pCurrentBlockingBufferNode)
{
- rc += "[B]";
+ rc.append("[B]");
}
- rc += " " + m_xXMLDocument->getNodeName(pBufferNode->getXMLElement());
+ rc.append(" ").append(m_xXMLDocument->getNodeName(pBufferNode->getXMLElement()));
BufferNode* pParent = const_cast<BufferNode*>(pBufferNode->getParent());
if (pParent != nullptr)
{
- rc += "[" + m_xXMLDocument->getNodeName(pParent->getXMLElement()) + "]";
+ rc.append("[").append(m_xXMLDocument->getNodeName(pParent->getXMLElement())).append("]");
}
- rc += ":EC=" + pBufferNode->printChildren() + " BR=";
+ rc.append(":EC=").append(pBufferNode->printChildren()).append(" BR=");
ElementMark * pBlocker = pBufferNode->getBlocker();
if (pBlocker != nullptr)
{
- rc += OUString::number( pBlocker->getBufferId() ) + "(SecId="
- + OUString::number( pBlocker->getSecurityId() ) + ") ";
+ rc.append(OUString::number( pBlocker->getBufferId() )).append("(SecId=")
+ .append(OUString::number( pBlocker->getSecurityId() )).append(") ");
}
- rc += "\n";
+ rc.append("\n");
std::vector< const BufferNode* >* vChildren = pBufferNode->getChildren();
for( auto jj = vChildren->begin();
jj != vChildren->end(); ++jj )
{
- rc += printBufferNode(*jj, nIndent+4);
+ rc.append(printBufferNode(*jj, nIndent+4));
}
delete vChildren;
- return rc;
+ return rc.makeStringAndClear();
}
cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > >