summaryrefslogtreecommitdiff
path: root/include/rtl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-10 15:15:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-10 22:21:23 +0100
commit9df9208b7d0fd9dd49c681c3c1b546d8ca402925 (patch)
treea65dd5e1d41b8a94474fc42dddb7237d54c9f0d7 /include/rtl
parent605ee3213087b13782bfc0731762c175bc97e53f (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'include/rtl')
-rw-r--r--include/rtl/string.hxx6
1 files changed, 6 insertions, 0 deletions
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.