From 4a96fb8ec0130e1036913093836bcf28bc37a49b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 16 Oct 2019 10:13:30 +0200 Subject: loplugin:bufferadd loosen some constraints and extend O*StringView to have a constructor that takes a pointer and a length Change-Id: I6120e96280f030757e855a6596efdae438b7e1e8 Reviewed-on: https://gerrit.libreoffice.org/80872 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/rtl/stringconcat.hxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx index c075a29d9c80..96b018d23d7a 100644 --- a/include/rtl/stringconcat.hxx +++ b/include/rtl/stringconcat.hxx @@ -497,6 +497,7 @@ struct ToStringHelper< OUStringNumber< T > > class OStringView { public: explicit OStringView(char const * s): view_(s) {} + explicit OStringView(char const * s, size_t len): view_(s, len) {} std::size_t length() const { return view_.length(); } @@ -518,6 +519,7 @@ struct ToStringHelper< OStringView > class OUStringView { public: explicit OUStringView(sal_Unicode const * s): view_(s) {} + explicit OUStringView(sal_Unicode const * s, size_t len): view_(s, len) {} std::size_t length() const { return view_.length(); } -- cgit