sfx2/inc/pch/precompiled_sfx.hxx | 1 - sfx2/source/appl/shutdownicon.cxx | 24 ++++++++---------------- 2 files changed, 8 insertions(+), 17 deletions(-)
New commits: commit 0a666480276f704d5127f578333659893517abe7 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue Aug 10 13:27:24 2021 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Tue Aug 10 15:35:52 2021 +0200 Replace a use of boost::logic::tribool with std::call_once Change-Id: Ifff3fc422719c55d8cb560e679f2585036350aa1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120268 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx index fc1d910d520e..dc98200fdf49 100644 --- a/sfx2/inc/pch/precompiled_sfx.hxx +++ b/sfx2/inc/pch/precompiled_sfx.hxx @@ -47,7 +47,6 @@ #include <unordered_map> #include <utility> #include <vector> -#include <boost/logic/tribool.hpp> #include <boost/property_tree/json_parser.hpp> #include <boost/property_tree/ptree.hpp> #endif // PCH_LEVEL >= 1 diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index fcebfe809d1e..cbae2881122a 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -20,9 +20,8 @@ #include <sal/config.h> #include <sal/log.hxx> -#include <cassert> +#include <mutex> -#include <boost/logic/tribool.hpp> #include "shutdownicon.hxx" #include <sfx2/strings.hrc> #include <sfx2/app.hxx> @@ -113,28 +112,20 @@ extern "C" { namespace { -boost::logic::tribool loaded(boost::logic::indeterminate); // loplugin:constvars:ignore oslGenericFunction pInitSystray = disabled_initSystray; oslGenericFunction pDeInitSystray = disabled_deInitSystray; -bool LoadModule() +void LoadModule() { - if (boost::logic::indeterminate(loaded)) - { #ifdef ENABLE_QUICKSTART_APPLET # ifdef _WIN32 - pInitSystray = win32_init_sys_tray; - pDeInitSystray = win32_shutdown_sys_tray; - loaded = true; + pInitSystray = win32_init_sys_tray; + pDeInitSystray = win32_shutdown_sys_tray; # elif defined MACOSX - pInitSystray = aqua_init_systray; - pDeInitSystray = aqua_shutdown_systray; - loaded = true; + pInitSystray = aqua_init_systray; + pDeInitSystray = aqua_shutdown_systray; # endif // MACOSX #endif // ENABLE_QUICKSTART_APPLET - } - assert(!boost::logic::indeterminate(loaded)); - return bool(loaded); } } @@ -145,7 +136,8 @@ void ShutdownIcon::initSystray() return; m_bInitialized = true; - (void) LoadModule(); + static std::once_flag flag; + std::call_once(flag, LoadModule); m_bVeto = true; pInitSystray(); }