summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-06-20 17:57:02 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-06-20 18:06:38 +0200
commit104567a5340db731f08ee6eef03f0deef9e5118d (patch)
tree898fb906e71472688e24c516f0336eabe5d3a209 /desktop
parent796d273925c92eb91cc6ebef5caad01ccf3308b3 (diff)
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
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx30
1 files changed, 8 insertions, 22 deletions
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