sfx2/source/appl/shutdownicon.cxx |   49 ++++++++++----------------------------
 1 file changed, 14 insertions(+), 35 deletions(-)

New commits:
commit e229547eb02ab6c9a1fe6abdfc42ce970cedc733
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Tue Aug 10 18:37:47 2021 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Tue Aug 10 20:15:42 2021 +0200

    Simplify init-/deInitSysTray even further
    
    7e8d46b8988527967825fbb7210747e625ba1975 "INTEGRATION: CWS gtkquickstart" 
had
    originally introduced the [m_]p_[De]InitSystray function pointers, for 
dynamic
    loading of libqstart_gtklo.so on UNX.  But
    3e9c908b73f0fe0978c9980750a06bbc9e02295e "remove Linux ('UNX') systray
    'Quickstarter'" removed that again, leaving behind the no longer necessary
    function pointer machinery.  And 0a666480276f704d5127f578333659893517abe7
    "Replace a use of boost::logic::tribool with std::call_once" tried to clean 
up
    that unnecessary machinery a bit, but failed to grasp the bigger picture.
    
    Change-Id: I370a6b212b1f25ea1e3ef5a250be72bfe509dd5c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120282
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/sfx2/source/appl/shutdownicon.cxx 
b/sfx2/source/appl/shutdownicon.cxx
index cbae2881122a..b6be7cad2fc6 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -20,8 +20,6 @@
 #include <sal/config.h>
 #include <sal/log.hxx>
 
-#include <mutex>
-
 #include "shutdownicon.hxx"
 #include <sfx2/strings.hrc>
 #include <sfx2/app.hxx>
@@ -105,41 +103,19 @@ css::uno::Sequence<OUString> SAL_CALL 
ShutdownIcon::getSupportedServiceNames()
 bool ShutdownIcon::bModalMode = false;
 rtl::Reference<ShutdownIcon> ShutdownIcon::pShutdownIcon;
 
-extern "C" {
-    static void disabled_initSystray() { }
-    static void disabled_deInitSystray() { }
-}
-
-namespace {
-
-oslGenericFunction pInitSystray = disabled_initSystray;
-oslGenericFunction pDeInitSystray = disabled_deInitSystray;
-
-void LoadModule()
-{
-#ifdef ENABLE_QUICKSTART_APPLET
-#  ifdef _WIN32
-    pInitSystray = win32_init_sys_tray;
-    pDeInitSystray = win32_shutdown_sys_tray;
-#  elif defined MACOSX
-    pInitSystray = aqua_init_systray;
-    pDeInitSystray = aqua_shutdown_systray;
-#  endif // MACOSX
-#endif // ENABLE_QUICKSTART_APPLET
-}
-
-}
-
 void ShutdownIcon::initSystray()
 {
     if (m_bInitialized)
         return;
     m_bInitialized = true;
 
-    static std::once_flag flag;
-    std::call_once(flag, LoadModule);
-    m_bVeto = true;
-    pInitSystray();
+#ifdef ENABLE_QUICKSTART_APPLET
+#  ifdef _WIN32
+    win32_init_sys_tray();
+#  elif defined MACOSX
+    aqua_init_systray();
+#  endif // MACOSX
+#endif // ENABLE_QUICKSTART_APPLET
 }
 
 void ShutdownIcon::deInitSystray()
@@ -147,12 +123,15 @@ void ShutdownIcon::deInitSystray()
     if (!m_bInitialized)
         return;
 
-    if (pDeInitSystray)
-        pDeInitSystray();
+#ifdef ENABLE_QUICKSTART_APPLET
+#  ifdef _WIN32
+    win32_shutdown_sys_tray();
+#  elif defined MACOSX
+    aqua_shutdown_systray();
+#  endif // MACOSX
+#endif // ENABLE_QUICKSTART_APPLET
 
     m_bVeto = false;
-    pInitSystray = nullptr;
-    pDeInitSystray = nullptr;
 
     m_pFileDlg.reset();
     m_bInitialized = false;

Reply via email to