diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-07 10:34:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-14 08:35:00 +0200 |
commit | cd66852f6dd08631a25d15a1527a647e69ab8ce3 (patch) | |
tree | 0ac1fab1d063046376e31e21d6656ee05eebb627 /sc | |
parent | 095e1ca4372d90da7fc56051f1271ddd975a9e3a (diff) |
create appendCopy method in OUStringBuffer
so we can avoid temporary copies when appending a substring of an
OUString to the buffer. I would have preferred to call the method just
"append" but that results in ambiguous method errors when the callsite
is something like
sal_Int32 n;
OUStringBuffer s;
s.append(n, 10);
I'm not sure why
Change-Id: I6b5b6641fcb5b26ce2269f89ef06e03c0b6aa76f
Reviewed-on: https://gerrit.libreoffice.org/58666
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/address.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xehelper.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 35e1dbe69a7d..036ba8376a8d 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -2154,7 +2154,7 @@ static void lcl_ScRange_Format_XL_Header( OUStringBuffer& rString, const ScRange { if (!aDocName.isEmpty()) { - rString.append("'[").append(aDocName).append("]").append(aTabName.copy(1)); + rString.append("'[").append(aDocName).append("]").appendCopy(aTabName, 1); } else { diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index ecc10f076f6a..c2b825814b78 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -921,7 +921,7 @@ OUString lclEncodeDosUrl( // Excel seems confused by this token). aBuf.append(EXC_URL_PARENTDIR); else - aBuf.append(aOldUrl.copy(0,nPos)).append(EXC_URL_SUBDIR); + aBuf.appendCopy(aOldUrl,0,nPos).append(EXC_URL_SUBDIR); aOldUrl = aOldUrl.copy(nPos + 1); } diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 2a544ab4151b..4c1f3a51e9d6 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -985,9 +985,9 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText ) if (nStartPosition > 0) { OUStringBuffer aBuf; - aBuf.append(aNew.copy(0, nStartPosition)); + aBuf.appendCopy(aNew, 0, nStartPosition); aBuf.append(u'\x25BA'); - aBuf.append(aNew.copy(nStartPosition)); + aBuf.appendCopy(aNew, nStartPosition); nArgs = ppFDesc->getParameterCount(); sal_Int16 nVarArgsSet = 0; if ( nArgs >= PAIRED_VAR_ARGS ) |