Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi,

the patch was fixed with:

 http://cgit.freedesktop.org/libreoffice/core/commit/?id=f3d78616dfc0805ff31038e00148e115d409ef9a

please review the attached combined patch for 3-5 and 3-5-1. Thanks.

Best,

Bjoern
From 3186b948d5c162b2277d577052eb3262fde293f0 Mon Sep 17 00:00:00 2001
From: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
Date: Tue, 28 Feb 2012 14:29:06 +0100
Subject: [PATCH] lp#562027: fix logout with quickstarter

lp#562027: actually give the quickstart suppressor a scope
---
 framework/inc/services/desktop.hxx            |    4 +++
 framework/source/services/desktop.cxx         |   30 +++++++++++++++++++++++++
 framework/source/services/sessionlistener.cxx |   15 +++++++++++-
 3 files changed, 48 insertions(+), 1 deletions(-)

diff --git a/framework/inc/services/desktop.hxx b/framework/inc/services/desktop.hxx
index 8dcc872..324a056 100644
--- a/framework/inc/services/desktop.hxx
+++ b/framework/inc/services/desktop.hxx
@@ -339,6 +339,10 @@ class Desktop   :   // interfaces
         virtual ::rtl::OUString SAL_CALL getUntitledPrefix()
             throw (css::uno::RuntimeException);
 
+        // we need this wrapped terminate()-call to terminate even the QuickStarter
+        // non-virtual and non-UNO for now
+        bool SAL_CALL terminateQuickstarterToo()
+            throw( css::uno::RuntimeException );
     
//-------------------------------------------------------------------------------------------------------------
     //  protected methods
     
//-------------------------------------------------------------------------------------------------------------
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 5cdf44d..2f32ba8 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -427,6 +427,36 @@ sal_Bool SAL_CALL Desktop::terminate()
     return bTerminate;
 }
 
+namespace
+{
+    class QuickstartSuppressor
+    {
+        Desktop* const m_pDesktop;
+        css::uno::Reference< css::frame::XTerminateListener > m_xQuickLauncher;
+        public:
+            QuickstartSuppressor(Desktop* const pDesktop, css::uno::Reference< 
css::frame::XTerminateListener > xQuickLauncher)
+                : m_pDesktop(pDesktop)
+                , m_xQuickLauncher(xQuickLauncher)
+            {
+                SAL_INFO("fwk.desktop", "temporary removing Quickstarter");
+                if(m_xQuickLauncher.is())
+                    m_pDesktop->removeTerminateListener(m_xQuickLauncher);
+            }
+            ~QuickstartSuppressor()
+            {
+                SAL_INFO("fwk.desktop", "readding Quickstarter");
+                if(m_xQuickLauncher.is())
+                    m_pDesktop->addTerminateListener(m_xQuickLauncher);
+            }
+    };
+}
+
+bool SAL_CALL Desktop::terminateQuickstarterToo()
+    throw( css::uno::RuntimeException )
+{
+    QuickstartSuppressoraQuickstartSuppressor(this, m_xQuickLauncher);
+    return terminate();
+}
 
 //=============================================================================
 void SAL_CALL Desktop::addTerminateListener( const css::uno::Reference< 
css::frame::XTerminateListener >& xListener )
diff --git a/framework/source/services/sessionlistener.cxx 
b/framework/source/services/sessionlistener.cxx
index 6dc4877..c150aa5 100644
--- a/framework/source/services/sessionlistener.cxx
+++ b/framework/source/services/sessionlistener.cxx
@@ -30,6 +30,7 @@
 // my own includes
 
 #include <services/sessionlistener.hxx>
+#include <services/desktop.hxx>
 #include <threadhelp/readguard.hxx>
 #include <threadhelp/resetableguard.hxx>
 #include <protocols.h>
@@ -318,7 +319,19 @@ void SAL_CALL SessionListener::approveInteraction( sal_Bool bInteractionGranted
             StoreSession( sal_False );
 
             css::uno::Reference< css::frame::XDesktop > xDesktop( 
m_xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW);
-            m_bTerminated = xDesktop->terminate();
+            // honestly: how many implementations of XDesktop will we ever have?
+            // so casting this directly to the implementation
+            Desktop* pDesktop(dynamic_cast<Desktop*>(xDesktop.get()));
+            if(pDesktop)
+            {
+                SAL_INFO("fwk.session", "XDesktop is a framework::Desktop -- good.");
+                m_bTerminated = pDesktop->terminateQuickstarterToo();
+            }
+            else
+            {
+                SAL_WARN("fwk.session", "XDesktop is not a framework::Desktop -- this should never 
happen.");
+                m_bTerminated = xDesktop->terminate();
+            }
 
             if ( m_rSessionManager.is() )
             {
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.