diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-13 12:51:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-13 16:47:32 +0000 |
commit | 13d3ae64dbf2ac4bda8e831c1da890b09024a8bb (patch) | |
tree | 5097d7b6d54186490452a62adc3e84634a0d8d4e /svl | |
parent | 25ae332bbafd0cb416a6a5c0db467e501661c679 (diff) |
make more use of OUStringBuffer::append(OUStringConcat)
where we can avoid constructing temporary OUStrings
Change-Id: I0eacd68a8d1b450894c2ea769055f16886b78ad0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148780
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 53914a0266cd..b9055a63d2fc 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -4596,8 +4596,7 @@ void NfCurrencyEntry::CompletePositiveFormatString(OUStringBuffer& rStr, std::u1 break; case 2: // $ 1 { - rStr.insert(0, ' '); - rStr.insert(0, rSymStr); + rStr.insert(0, OUString::Concat(rSymStr) + " "); } break; case 3: // 1 $ @@ -4622,21 +4621,18 @@ void NfCurrencyEntry::CompleteNegativeFormatString(OUStringBuffer& rStr, { case 0: // ($1) { - rStr.insert(0, rSymStr); - rStr.insert(0, '('); + rStr.insert(0, OUString::Concat("(") + rSymStr); rStr.append(')'); } break; case 1: // -$1 { - rStr.insert(0, rSymStr); - rStr.insert(0, '-'); + rStr.insert(0, OUString::Concat("-") + rSymStr); } break; case 2: // $-1 { - rStr.insert(0, '-'); - rStr.insert(0, rSymStr); + rStr.insert(0, OUString::Concat(rSymStr) + "-"); } break; case 3: // $1- @@ -4679,9 +4675,7 @@ void NfCurrencyEntry::CompleteNegativeFormatString(OUStringBuffer& rStr, break; case 9: // -$ 1 { - rStr.insert(0, ' '); - rStr.insert(0, rSymStr); - rStr.insert(0, '-'); + rStr.insert(0, OUString::Concat("-") + rSymStr + " "); } break; case 10: // 1 $- @@ -4693,14 +4687,12 @@ void NfCurrencyEntry::CompleteNegativeFormatString(OUStringBuffer& rStr, break; case 11: // $ -1 { - rStr.insert(0, " -"); - rStr.insert(0, rSymStr); + rStr.insert(0, OUString::Concat(rSymStr) + " -"); } break; case 12 : // $ 1- { - rStr.insert(0, ' '); - rStr.insert(0, rSymStr); + rStr.insert(0, OUString::Concat(rSymStr) + " "); rStr.append('-'); } break; @@ -4713,9 +4705,7 @@ void NfCurrencyEntry::CompleteNegativeFormatString(OUStringBuffer& rStr, break; case 14 : // ($ 1) { - rStr.insert(0, ' '); - rStr.insert(0, rSymStr); - rStr.insert(0, '('); + rStr.insert(0, OUString::Concat("(") + rSymStr + " "); rStr.append(')'); } break; |