From 104567a5340db731f08ee6eef03f0deef9e5118d Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 20 Jun 2012 17:57:02 +0200 Subject: 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 --- desktop/source/app/app.cxx | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'desktop') diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 7ddec0ee3ec5..e29e53518d29 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 -- cgit v1.2.3