diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-07-21 18:50:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-22 11:13:28 +0200 |
commit | aa2067dda63852b0eb84d5c32497f5a28177bb1c (patch) | |
tree | c55e9293ba60ac588e2b9431905c5ea0d3e48895 /svgio/source/svgreader | |
parent | 7335d912de04eaa279dc805ee0ed5be0fcac5326 (diff) |
elide some makeStringAndClear() calls
Change-Id: Iccdb04df53bc981e2240240daddf15e9e1bb5a16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137310
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svgio/source/svgreader')
-rw-r--r-- | svgio/source/svgreader/svgnode.cxx | 3 | ||||
-rw-r--r-- | svgio/source/svgreader/svgstylenode.cxx | 12 |
2 files changed, 10 insertions, 5 deletions
diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx index 9ac07afb0f81..02954f986d96 100644 --- a/svgio/source/svgreader/svgnode.cxx +++ b/svgio/source/svgreader/svgnode.cxx @@ -94,7 +94,8 @@ namespace svgio::svgreader const sal_Int32 nInitPos(nPos); copyToLimiter(rClassList, u' ', nPos, aToken, nLen); skip_char(rClassList, u' ', nPos, nLen); - const OUString aPart(aToken.makeStringAndClear().trim()); + const OUString aPart(o3tl::trim(aToken)); + aToken.setLength(0); if(aPart.getLength()) { diff --git a/svgio/source/svgreader/svgstylenode.cxx b/svgio/source/svgreader/svgstylenode.cxx index 474b0a0e92e8..ac4c86d13ccc 100644 --- a/svgio/source/svgreader/svgstylenode.cxx +++ b/svgio/source/svgreader/svgstylenode.cxx @@ -89,7 +89,8 @@ namespace svgio::svgreader const sal_Int32 nInitPos(nPos); copyToLimiter(aSelectors, u' ', nPos, aToken, nLen); skip_char(aSelectors, u' ', nPos, nLen); - const OUString aSelectorPart(aToken.makeStringAndClear().trim()); + const OUString aSelectorPart(o3tl::trim(aToken)); + aToken.setLength(0); if(!aSelectorPart.isEmpty()) { @@ -151,7 +152,8 @@ namespace svgio::svgreader copyToLimiter(aSelectors, u',', nPos, aToken, nLen); skip_char(aSelectors, u' ', u',', nPos, nLen); - const OUString aSingleName(aToken.makeStringAndClear().trim()); + const OUString aSingleName(o3tl::trim(aToken)); + aToken.setLength(0); // add the current css class only if wasn't previously added auto [aIterator, bIsNew] = maSvgStyleAttributes.try_emplace(aSingleName); @@ -197,7 +199,8 @@ namespace svgio::svgreader copyToLimiter(aSelectorsAndContent, u'{', nPos, aToken, nLen); skip_char(aSelectorsAndContent, u' ', u'{', nPos, nLen); - const OUString aSelectors(aToken.makeStringAndClear().trim()); + const OUString aSelectors(o3tl::trim(aToken)); + aToken.setLength(0); OUString aContent; if(!aSelectors.isEmpty() && nPos < nLen) @@ -206,7 +209,8 @@ namespace svgio::svgreader copyToLimiter(aSelectorsAndContent, u'}', nPos, aToken, nLen); skip_char(aSelectorsAndContent, u' ', u'}', nPos, nLen); - aContent = aToken.makeStringAndClear().trim(); + aContent = o3tl::trim(aToken); + aToken.setLength(0); } if(!aSelectors.isEmpty() && !aContent.isEmpty()) |