include/vcl/builder.hxx | 5 +---- vcl/source/window/builder.cxx | 5 +++++ vcl/source/window/layout.cxx | 5 ----- 3 files changed, 6 insertions(+), 9 deletions(-)
New commits: commit bcfe1de41e8f707a1911ff9cb68ef3b606c625f7 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Sep 20 11:44:13 2024 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Sat Sep 21 09:07:09 2024 +0200 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.wegh...@posteo.de> 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") commit 98f2f49b5ac098ee0b7e33a7c8282e687d22d730 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Sep 20 11:33:44 2024 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Sat Sep 21 09:06:55 2024 +0200 Use '#pragma once' in include/vcl/builder.hxx Change-Id: I7651640bc01cd216a930bdd8b4490ea0f43f5bee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173709 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index e8590a473d77..8c2181eef852 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -7,8 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef INCLUDED_VCL_BUILDER_HXX -#define INCLUDED_VCL_BUILDER_HXX +#pragma once #include <typeinfo> #include <sal/log.hxx> @@ -383,6 +382,4 @@ inline T* VclBuilder::get(const OUString& sID) */ VCL_DLLPUBLIC bool toBool(std::u16string_view rValue); -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */