Drop some useless conversions to sal_Int32
commit7469af24baeb74f171edec459d50e4502abe5017
authorStephan Bergmann <sbergman@redhat.com>
Tue, 14 Sep 2021 13:18:28 +0000 (14 15:18 +0200)
committerStephan Bergmann <sbergman@redhat.com>
Tue, 14 Sep 2021 14:49:24 +0000 (14 16:49 +0200)
treeaefefc13b6658becdd90f234e0edb0e1e899f4ac
parent7aa9f089e2f005c41d804530612e535c372f6c8b
Drop some useless conversions to sal_Int32

These started out as sal::static_int_cast<xub_StrLen> in
1b9a6329fcda25fd738bd0e0a36663a6e745cab8 "INTEGRATION: CWS calcwarnings",
presumably to silence some signed-to-unsigned conversion warnings, then morphed
into the completely useless sal::static_int_cast<sal_Int32> with the String ->
OUString changes (where the length parameter changed from unsigned xub_StrLen
to signed sal_Int32), which then started to hide erroneous overflow (see e.g.
4a4be7a1edead11b48e1a8598e52a3246e6744bb "tdf#144106 Don't proceed ptrim_i past
ptrim_f") from tools like -fsanitize=implicit-integer-sign-change with the
OUString -> std::u16string_view changes (where the length parameter changed from
signed sal_Int32 to unsigned std::size_t).  If there were demand to prevent
signed-to-unsigned conversion warnings here, that should be done with
o3tl::make_unsigned instead.

Change-Id: I9b078658500b6ed5dcd0e860d2f0b725133188f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122092
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
sc/source/ui/docshell/impex.cxx