diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-09-20 11:44:13 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-09-21 09:07:09 +0200 |
commit | bcfe1de41e8f707a1911ff9cb68ef3b606c625f7 (patch) | |
tree | 84f6bd3c4563e6171c6c8ff42bae8c4195f45886 /vcl/source/window | |
parent | 98f2f49b5ac098ee0b7e33a7c8282e687d22d730 (diff) |
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 <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/builder.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 5 |
2 files changed, 5 insertions, 5 deletions
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") |