sc/source/ui/app/inputhdl.cxx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
New commits: commit 658ff424b8f4a95a3327ee9081bdfd3664c6a85f Author: Takeshi Abe <t...@fixedpoint.jp> Date: Sat Jun 30 21:19:29 2018 +0900 sc: Spare an OUStringBuffer by replacing removeChars() ... with OUString::replace(). Change-Id: I8d6ae6ff1674dafaafb276cb0efc72e01579f9bb Reviewed-on: https://gerrit.libreoffice.org/56759 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index d8ab78fe524e..742eadf257a6 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -279,17 +279,6 @@ ScTypedCaseStrSet::const_iterator findTextAll( return rDataSet.end(); // no matching text found } -void removeChars(OUString& rStr, sal_Unicode c) -{ - OUStringBuffer aBuf(rStr); - for (sal_Int32 i = 0, n = aBuf.getLength(); i < n; ++i) - { - if (aBuf[i] == c) - aBuf[i] = ' '; - } - rStr = aBuf.makeStringAndClear(); -} - } void ScInputHandler::InitRangeFinder( const OUString& rFormula ) @@ -497,13 +486,13 @@ inline OUString GetEditText(const EditEngine* pEng) static void lcl_RemoveTabs(OUString& rStr) { - removeChars(rStr, '\t'); + rStr = rStr.replace('\t', ' '); } static void lcl_RemoveLineEnd(OUString& rStr) { rStr = convertLineEnd(rStr, LINEEND_LF); - removeChars(rStr, '\n'); + rStr = rStr.replace('\n', ' '); } static sal_Int32 lcl_MatchParenthesis( const OUString& rStr, sal_Int32 nPos ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits