[Libreoffice-commits] .: 2 commits - desktop/source sal/osl

Stephan Bergmann sbergmann at kemper.freedesktop.org
Wed Jun 20 09:06:48 PDT 2012


 desktop/source/app/app.cxx |   30 ++++++++----------------------
 sal/osl/unx/signal.c       |    3 +--
 2 files changed, 9 insertions(+), 24 deletions(-)

New commits:
commit 104567a5340db731f08ee6eef03f0deef9e5118d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jun 20 17:57:02 2012 +0200

    Show backing window instead of empty writer upon an "empty session"
    
    ...(i.e., after logging out of a session with soffice still running, but only
    with the backing window still open).  The key issue was that bSessionDataExists
    would always be true if /org.openoffice.Office.Recovery/RecoveryInfo/SessionData
    is true, even if /org.openoffice.Office.Recovery/RecoveryList is empty.  Always
    calling doRestore (unless bExistsRecoveryData, but even if !bExistsSessionData)
    is there to ensure that /org.openoffice.Office.Recovery/RecoveryInfo/SessionData
    is eventually reset (whether or not that is really necessary).
    
    Change-Id: I9c3fff23f8019069f36e1dd5ded634ea1917bbd4

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 7ddec0e..e29e535 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1153,27 +1153,13 @@ void impl_checkRecoveryState(sal_Bool& bCrashed           ,
                              sal_Bool& bRecoveryDataExists,
                              sal_Bool& bSessionDataExists )
 {
-    static const ::rtl::OUString SERVICENAME_RECOVERYCORE("com.sun.star.frame.AutoRecovery");
-    static const ::rtl::OUString PROP_CRASHED("Crashed");
-    static const ::rtl::OUString PROP_EXISTSRECOVERY("ExistsRecoveryData");
-    static const ::rtl::OUString PROP_EXISTSSESSION("ExistsSessionData");
-
-    bCrashed            = sal_False;
-    bRecoveryDataExists = sal_False;
-    bSessionDataExists  = sal_False;
-
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
-    try
-    {
-        css::uno::Reference< css::beans::XPropertySet > xRecovery(
-            xSMGR->createInstance(SERVICENAME_RECOVERYCORE),
-            css::uno::UNO_QUERY_THROW);
-
-        xRecovery->getPropertyValue(PROP_CRASHED       ) >>= bCrashed           ;
-        xRecovery->getPropertyValue(PROP_EXISTSRECOVERY) >>= bRecoveryDataExists;
-        xRecovery->getPropertyValue(PROP_EXISTSSESSION ) >>= bSessionDataExists ;
-    }
-    catch(const css::uno::Exception&) {}
+    bCrashed = officecfg::Office::Recovery::RecoveryInfo::Crashed::get();
+    bool elements = officecfg::Office::Recovery::RecoveryList::get()->
+        hasElements();
+    bool session
+        = officecfg::Office::Recovery::RecoveryInfo::SessionData::get();
+    bRecoveryDataExists = elements && !session;
+    bSessionDataExists = elements && session;
 }
 
 //-----------------------------------------------
@@ -2488,7 +2474,7 @@ void Desktop::OpenClients()
             OSL_FAIL(OUStringToOString(aMessage, RTL_TEXTENCODING_ASCII_US).getStr());
         }
 
-        if ( bExistsSessionData )
+        if ( !bExistsRecoveryData )
         {
             // session management
             try
commit 796d273925c92eb91cc6ebef5caad01ccf3308b3
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jun 20 16:56:22 2012 +0200

    Clarify SIGHUP behavior
    
    The combination of marking it as ACT_IGNORE and osl_Signal_Terminate was
    strange, as osl_Signal_Terminate caused SalMainPipeExchangeSignal_impl
    (desktop/source/app/officeipcthread.cxx) to call DisableOfficeIPCThread, but
    ACT_IGNORE (instead of ACT_EXIT, like other signals marked osl_Signal_Terminate)
    caused the process to continue running.  The net effect was that calling an
    additional soffice instance after a SIGHUP would no longer connect to the first
    instance, but instead would lead to two soffice instances running simultaneously
    on the same UserInstallation.
    
    Marking SIGHUP as ACT_HIDE most closely resembles the old behavior (of having
    ~no effect).  Other options would be to mark it as ACT_IGNORE and
    osl_Signal_System or as ACT_EXIT and osl_Signal_Terminate, which would both
    result in instant termination.  I do not know if that wouldn't actually be
    better.
    
    Change-Id: Id1ee7c1108765301e6010e0e05d6c1ff5894a414

diff --git a/sal/osl/unx/signal.c b/sal/osl/unx/signal.c
index 57263c7..8697522 100644
--- a/sal/osl/unx/signal.c
+++ b/sal/osl/unx/signal.c
@@ -105,7 +105,7 @@ static struct SignalAction
     void (*Handler)(int);
 } Signals[] =
 {
-    { SIGHUP,    ACT_IGNORE, NULL },    /* hangup */
+    { SIGHUP,    ACT_HIDE, NULL },    /* hangup */
     { SIGINT,    ACT_EXIT,   NULL },    /* interrupt (rubout) */
     { SIGQUIT,   ACT_EXIT,  NULL },    /* quit (ASCII FS) */
     { SIGILL,    ACT_SYSTEM,  NULL },    /* illegal instruction (not reset when caught) */
@@ -973,7 +973,6 @@ void SignalHandlerFunction(int Signal)
         case SIGINT:
         case SIGTERM:
         case SIGQUIT:
-        case SIGHUP:
             Info.Signal = osl_Signal_Terminate;
             break;
 


More information about the Libreoffice-commits mailing list