summaryrefslogtreecommitdiff
path: root/sw/source/uibase/dbui/mailmergehelper.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-30 15:24:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-30 18:54:15 +0200
commit4bef6511332073fbe3899fa2003caf88d9f2ac49 (patch)
treedca0d58c3fc86d6c88abc2a72fd91f149a917058 /sw/source/uibase/dbui/mailmergehelper.cxx
parentc9dcd0a6197160fdc8bf086ae4d8a78558e7d078 (diff)
loplugin:stringloop in sw
Change-Id: Ie316aee8d1e4f772dc25725b46e130c6717458c2 Reviewed-on: https://gerrit.libreoffice.org/58331 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/dbui/mailmergehelper.cxx')
-rw-r--r--sw/source/uibase/dbui/mailmergehelper.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx
index 7345797b1d67..e742e88b8583 100644
--- a/sw/source/uibase/dbui/mailmergehelper.cxx
+++ b/sw/source/uibase/dbui/mailmergehelper.cxx
@@ -464,7 +464,6 @@ OUString SwAddressPreview::FillData(
rConfigItem.GetCurrentDBData() );
const OUString* pAssignment = aAssignment.getConstArray();
const std::vector<std::pair<OUString, int>>& rDefHeaders = rConfigItem.GetDefaultAddressHeaders();
- OUString sAddress(rAddress);
OUString sNotAssigned = "<" + SwResId(STR_NOTASSIGNED) + ">";
bool bIncludeCountry = rConfigItem.IsIncludeCountry();
@@ -480,8 +479,8 @@ OUString SwAddressPreview::FillData(
sCountryColumn = aSpecialAssignment[MM_PART_COUNTRY];
}
- SwAddressIterator aIter(sAddress);
- sAddress.clear();
+ SwAddressIterator aIter(rAddress);
+ OUStringBuffer sAddress;
while(aIter.HasMore())
{
SwMergeAddressItem aItem = aIter.Next();
@@ -540,9 +539,9 @@ OUString SwAddressPreview::FillData(
}
}
- sAddress += aItem.sText;
+ sAddress.append(aItem.sText);
}
- return sAddress;
+ return sAddress.makeStringAndClear();
}
SwMergeAddressItem SwAddressIterator::Next()