From 1792493e765f8027c2605bd72b9978c6769a262d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 15 Jun 2016 16:16:33 +0100 Subject: Resolves: tdf#91603 if we cancel/discard recovery dialog, continue as normal Change-Id: Ifd5df74063bcaf2f3a198b090ed2126449d7b8f8 --- svx/source/unodraw/recoveryui.cxx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'svx') diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx index 17b41e9b39d2..07cecc148abe 100644 --- a/svx/source/unodraw/recoveryui.cxx +++ b/svx/source/unodraw/recoveryui.cxx @@ -107,7 +107,7 @@ class RecoveryUI : public ::cppu::WeakImplHelper< css::lang::XServiceInfo bool impl_doEmergencySave(); - void impl_doRecovery(); + bool impl_doRecovery(); void impl_showAllRecoveredDocs(); @@ -157,19 +157,25 @@ css::uno::Any SAL_CALL RecoveryUI::dispatchWithReturnValue(const css::util::URL& switch(eJob) { - case RecoveryUI::E_DO_EMERGENCY_SAVE : + case RecoveryUI::E_DO_EMERGENCY_SAVE: { bool bRet = impl_doEmergencySave(); aRet <<= bRet; break; } - case RecoveryUI::E_DO_RECOVERY : - impl_doRecovery(); + case RecoveryUI::E_DO_RECOVERY: + { + bool bRet = impl_doRecovery(); + aRet <<= bRet; break; + } - default : + default: + { + aRet <<= false; break; + } } return aRet; @@ -243,7 +249,7 @@ bool RecoveryUI::impl_doEmergencySave() return (nRet==DLG_RET_OK_AUTOLUNCH); } -void RecoveryUI::impl_doRecovery() +bool RecoveryUI::impl_doRecovery() { // create core service, which implements the real "emergency save" algorithm. svxdr::RecoveryCore* pCore = new svxdr::RecoveryCore(m_xContext, false); @@ -254,11 +260,13 @@ void RecoveryUI::impl_doRecovery() ScopedVclPtrInstance xDialog(m_pParentWindow, pCore); // start the dialog - xDialog->Execute(); + short nRet = xDialog->Execute(); impl_showAllRecoveredDocs(); delete_pending_crash(); + + return nRet != RET_CANCEL; } void RecoveryUI::impl_showAllRecoveredDocs() -- cgit