From 4bef6511332073fbe3899fa2003caf88d9f2ac49 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 30 Jul 2018 15:24:04 +0200 Subject: loplugin:stringloop in sw Change-Id: Ie316aee8d1e4f772dc25725b46e130c6717458c2 Reviewed-on: https://gerrit.libreoffice.org/58331 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/uibase/dbui/mailmergehelper.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sw/source/uibase/dbui/mailmergehelper.cxx') 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>& 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() -- cgit