summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-02-16 18:15:46 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-02-16 22:45:42 +0100
commitc6db02a2afe4263e060fe6166db8e5426dd2ecd1 (patch)
tree6d4e6a9ab05176001d1a26ae433ab994f1df171f /svl
parent2b58a0979f9206cfca6d78cb2f3d5e65cd735f8b (diff)
Extend loplugin:stringview to OUStringBuffer::copy
(Somewhat oddly, there is no OStringBuffer::copy counterpart.) This required some modification to StringView::VisitCXXConstructExpr to avoid > In file included from odk/qa/checkapi/checkapi.cxx:29: > In file included from workdir/CustomTarget/odk/allheaders/allheaders.hxx:351: > In file included from instdir/sdk/include/rtl/math.hxx:31: > instdir/sdk/include/rtl/ustrbuf.hxx:1687:16: error: rather than copy, pass with a view using subView() [loplugin:stringview] > return copy( beginIndex, getLength() - beginIndex ); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ while building CppunitTest_odk_checkapi as external C++03 code, where the returned value is wrapped in a CXXConstructExpr. And testing for that case required a new CompilerTest_compilerplugins_clang-c++03 that uses gb_CXX03FLAGS and needs to not set LIBO_INTERNAL_ONLY (via gb_CompilerTest_set_external_code), as compiling as C++03 would otherwise generate lots of errors like unknown char16_t at include/sal/types.h:118. (There was a choice whether to name the new test "-c++03" or "-external", but the issue it tests is caused more by the code being compiled with C++03 than by this being external code, see above.) Change-Id: I873a9c5a70d3ea949cf13a169d46920b71282712 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130036 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforlist.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 98f607e6f07a..8606a4a24226 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -3231,9 +3231,9 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex,
{
sal_Int32 nIndexSep = ImpPosToken( sOldFormatString, ';', nIndexE );
if (nIndexSep > nIndexE)
- sString.append( sOldFormatString.copy(nIndexE, nIndexSep - nIndexE) );
+ sString.append( sOldFormatString.subView(nIndexE, nIndexSep - nIndexE) );
else
- sString.append( sOldFormatString.copy(nIndexE) );
+ sString.append( sOldFormatString.subView(nIndexE) );
}
}
else if (eType == SvNumFormatType::CURRENCY)