From bcfe1de41e8f707a1911ff9cb68ef3b606c625f7 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Fri, 20 Sep 2024 11:44:13 +0200 Subject: vcl: Move UTF-16 toBool helper to it's local non-UTF16 equivalent include/vcl/builder.hxx declares a VCL_DLLPUBLIC bool toBool(std::u16string_view rValue); (taking a UTF-16 `std::u16string_view`) and vcl/source/window/builder.cxx defines a local helper function static bool toBool(std::string_view rValue) (taking a non-UTF16 `std::string_view`), while the function declared in builder.hxx was actually implemented in vcl/source/window/layout.cxx. Then, vcl/source/window/builder.cxx makes use of both functions, which was quite confusing. Move the definition of the function declared in the builder.hxx to builder.cxx as well. Change-Id: Ib1f3e3c92c4d3df56c83437e5078ddfe1f887c96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173710 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/window/builder.cxx | 5 +++++ vcl/source/window/layout.cxx | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'vcl/source/window') diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 1f1cca6688c8..3215c89f3e2c 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -94,6 +94,11 @@ static bool toBool(std::string_view rValue) return (!rValue.empty() && (rValue[0] == 't' || rValue[0] == 'T' || rValue[0] == '1')); } +bool toBool(std::u16string_view rValue) +{ + return (!rValue.empty() && (rValue[0] == 't' || rValue[0] == 'T' || rValue[0] == '1')); +} + namespace { OUString mapStockToImageResource(std::u16string_view sType) diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 988b470ca31f..9d0dc28b4f91 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1434,11 +1434,6 @@ void VclGrid::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) rJsonWriter.put("type", "grid"); } -bool toBool(std::u16string_view rValue) -{ - return (!rValue.empty() && (rValue[0] == 't' || rValue[0] == 'T' || rValue[0] == '1')); -} - bool VclGrid::set_property(const OUString &rKey, const OUString &rValue) { if (rKey == "row-spacing") -- cgit