From f34ac579fac16fff37bf00fe85d43ad6b938eca7 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 12 Nov 2020 08:13:40 +0100 Subject: New loplugin:stringviewparam ...to "Find functions that take rtl::O[U]String parameters that can be generalized to take std::[u16]string_view instead." (Which in turn can avoid costly O[U]String constructions, see e.g. loplugin:stringview and subView.) Some of those functions' call sites, passing plain char string literals, needed to be adapted when converting them. Change-Id: I644ab546d7a0ce9e470ab9b3196e3e60d1e812bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105622 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- vcl/source/window/layout.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl/source/window/layout.cxx') diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 6aa30005942e..245befc2c3a7 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1318,9 +1318,9 @@ void VclGrid::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) rJsonWriter.put("type", "grid"); } -bool toBool(const OUString &rValue) +bool toBool(std::u16string_view rValue) { - return (!rValue.isEmpty() && (rValue[0] == 't' || rValue[0] == 'T' || rValue[0] == '1')); + return (!rValue.empty() && (rValue[0] == 't' || rValue[0] == 'T' || rValue[0] == '1')); } bool VclGrid::set_property(const OString &rKey, const OUString &rValue) -- cgit v1.2.3