summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-04-13 11:01:42 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-04-13 21:46:48 +0200
commit58f533029b5cbd31993f2c667b16d3b487258e85 (patch)
treefceccbaee62d7d7c4c23590f7e9a7ec5e65f3797 /desktop
parentab65a74998b498ff49c15db87fc14a9afa89d8bf (diff)
Clean up O[U]StringBuffer ctors taking a length parameter
For !LIBO_INTERNAL_ONLY, go back to the state before d91d98a53612a972de368186415aa48698e074d9 "fix gcc-4.0.1 and/or 32bit build for string literals" of having just a sal_Int32 overload. (For !LIBO_INTERNAL_ONLY, the current state was confusing, as the existence of further overloads depended on __cplusplus >= 201103L.) And for LIBO_INTERNAL_ONLY: * Have overloads for all integral types, with an assert checking that they do not use out-of-bounds length arguments. (The std::make_unsigned_t dance in the assert is needed to avoid signed/unsigned mismatch warnings as seen at least with MSVC.) This removes the need for explicitly casting arguments that are larger than (unsigned) int. (And I cleaned up two such places that I had become aware of with the abandoned previous attempt <https://gerrit.libreoffice.org/c/core/+/132825> "Let O[U]StringBuffer ctors take sal_Int32 length parameters"; there may be more places to clean up, though.) * Have deleted overloads for all integral types that are not actually integer types. (This excludes signed char and unsigned char, as at least > OUStringBuffer aBuf( rToken.GetByte()); in ScTokenConversion::ConvertToTokenSequence in sc/source/ui/unoobj/tokenuno.cxx does a legitimate call with an argument of type sal_Int8 aka signed char.) Change-Id: I2df77429f25b74f19cc3de5064e6fd982e87b05e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132951 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/cmdlineargs.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 95f00cb097bc..0a9d21e3caae 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -219,7 +219,7 @@ CommandLineEvent CheckWebQuery(/* in,out */ OUString& arg, CommandLineEvent curE
if (!SkipNewline(pPos))
return curEvt;
- OStringBuffer aResult(static_cast<unsigned int>(nRead));
+ OStringBuffer aResult(nRead);
do
{
const char* pPos1 = pPos;