summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-26 13:15:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-27 11:15:46 +0200
commitc8fa03b1f565461364b9f6423b65680e09281c14 (patch)
tree78ff35dfeb569354b41e89b9d55d77b46f7d3d95 /l10ntools
parent82a4ef72d6e34c2f5075069a1b353f7fd41c7595 (diff)
new loplugin:stringloop, and applied in various
look for OUString being appended to in a loop, better to use OUStringBuffer to accumulate the results. Change-Id: Ia36e06e2781a7c546ce9cbad62727aa4c5f10c4b Reviewed-on: https://gerrit.libreoffice.org/58092 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/source/po.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index 7959b8361d7d..c2ccb47cdfe1 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -28,7 +28,7 @@
class GenPoEntry
{
private:
- OString m_sExtractCom;
+ OStringBuffer m_sExtractCom;
OString m_sReference;
OString m_sMsgCtxt;
OString m_sMsgId;
@@ -129,7 +129,7 @@ void GenPoEntry::writeToFile(std::ofstream& rOFStream) const
if ( !m_sExtractCom.isEmpty() )
rOFStream
<< "#. "
- << m_sExtractCom.replaceAll("\n","\n#. ") << std::endl;
+ << m_sExtractCom.toString().replaceAll("\n","\n#. ") << std::endl;
if ( !m_sReference.isEmpty() )
rOFStream << "#: " << m_sReference << std::endl;
if ( m_bFuzzy )
@@ -162,9 +162,9 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream)
{
if( !m_sExtractCom.isEmpty() )
{
- m_sExtractCom += "\n";
+ m_sExtractCom.append("\n");
}
- m_sExtractCom += sLine.copy(3);
+ m_sExtractCom.append(sLine.copy(3));
}
else if (sLine.startsWith("#: "))
{