diff options
Diffstat (limited to 'include/rtl/ustring.hxx')
-rw-r--r-- | include/rtl/ustring.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index c6e3760838ce..35e0ca7756be 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -24,6 +24,7 @@ #include <cassert> #include <cstddef> +#include <limits> #include <new> #include <ostream> #include <utility> @@ -410,6 +411,16 @@ public: } #endif +#if defined LIBO_INTERNAL_ONLY + OUString(std::u16string_view sv) { + if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) { + throw std::bad_alloc(); + } + pData = nullptr; + rtl_uString_newFromStr_WithLength(&pData, sv.data(), sv.size()); + } +#endif + /** Release the string data. */ |