diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-10-19 15:41:59 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-10-19 16:52:22 +0200 |
commit | 7320d7a4a4dd0657f2d650a6f580ad399529f0f1 (patch) | |
tree | d6d4e3865290d2bbbbed0fcc13ae9981f648ca3f /include/rtl | |
parent | 766cdd869d7d983e9e171a3eae0629cb9a0206ff (diff) |
OUStringChar must either take a sal_Unicode or an ASCII char
...so forbid anything else, to avoid issues like the one described in
766cdd869d7d983e9e171a3eae0629cb9a0206ff "This code wants to add the numeric
SvxRotateMode value". Some remaining places that apparently do want to convert
some numeric value to sal_Unicode have been augmented with an explicit cast.
Change-Id: I6200a84e250e697bc88694bd71142ca1d9a13651
Reviewed-on: https://gerrit.libreoffice.org/81132
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/rtl')
-rw-r--r-- | include/rtl/stringutils.hxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/rtl/stringutils.hxx b/include/rtl/stringutils.hxx index 6ea44c72d8be..a043f753ccce 100644 --- a/include/rtl/stringutils.hxx +++ b/include/rtl/stringutils.hxx @@ -12,6 +12,7 @@ #include "sal/config.h" +#include <cassert> #include <cstddef> #include "sal/types.h" @@ -79,6 +80,8 @@ namespace rtl */ struct SAL_WARN_UNUSED OUStringChar_ { constexpr OUStringChar_(sal_Unicode theC): c(theC) {} + constexpr OUStringChar_(char theC): c(theC) { assert(c <= 0x7F); } + template<typename T> OUStringChar_(T &&) = delete; sal_Unicode const c; }; using OUStringChar = OUStringChar_ const; |