From 58f533029b5cbd31993f2c667b16d3b487258e85 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 13 Apr 2022 11:01:42 +0200 Subject: 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 "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 --- sw/source/core/fields/authfld.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw') diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 5d4b72ba551b..f81feebca3d1 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -737,7 +737,7 @@ bool SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/ ) if(!(rAny >>= aParam)) return false; - OUStringBuffer sBuf(AUTH_FIELD_LOCAL_URL); + OUStringBuffer sBuf(+AUTH_FIELD_LOCAL_URL); comphelper::string::padToLength(sBuf, AUTH_FIELD_LOCAL_URL, TOX_STYLE_DELIMITER); OUString sToSet(sBuf.makeStringAndClear()); for(const PropertyValue& rParam : std::as_const(aParam)) -- cgit