From 9df9208b7d0fd9dd49c681c3c1b546d8ca402925 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 10 Dec 2020 15:15:40 +0100 Subject: Catch inadvertent uses of OString(char) ctor ...similar to cbe944e323edb20f958bb46ea644de659b75382e "Catch inadvertent uses of OUString(sal_Unicode) ctor". The existing few places did mean to use that ctor after all, but this clean-up should come in handy when single-character instances of OString are replaced with OStringChar, which already rejects non- char arguments. Change-Id: I9dbd85b85c3be653c5e8084aed39689f8c6c3bb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107557 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- include/rtl/string.hxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx index 4d229fd86931..3c540198f95f 100644 --- a/include/rtl/string.hxx +++ b/include/rtl/string.hxx @@ -243,6 +243,12 @@ public: rtl_string_newFromStr_WithLength( &pData, &value, 1 ); } +#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST_CONCAT + // Catch inadvertent conversions to the above ctor (e.g., from sal_[u]Int8, aka [un]signed + // char): + OString(int) = delete; +#endif + /** New string from a character buffer array. -- cgit