diff options
Diffstat (limited to 'uui/source/iahndl-locking.cxx')
-rw-r--r-- | uui/source/iahndl-locking.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx index 53b0e6a2fc77..08b5b5c7fd99 100644 --- a/uui/source/iahndl-locking.cxx +++ b/uui/source/iahndl-locking.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/task/XInteractionDisapprove.hpp> #include <com/sun/star/task/XInteractionAbort.hpp> #include <com/sun/star/task/XInteractionRequest.hpp> +#include <com/sun/star/task/XInteractionRetry.hpp> #include <unotools/resmgr.hxx> #include <vcl/svapp.hxx> @@ -66,7 +67,9 @@ handleLockedDocumentRequest_( uno::Reference< task::XInteractionApprove > xApprove; uno::Reference< task::XInteractionDisapprove > xDisapprove; uno::Reference< task::XInteractionAbort > xAbort; - getContinuations(rContinuations, &xApprove, &xDisapprove, &xAbort); + // In case an option to ignore lock and open the file is available + uno::Reference< task::XInteractionRetry > xRetry; + getContinuations(rContinuations, &xApprove, &xDisapprove, &xAbort, &xRetry); if ( !xApprove.is() || !xDisapprove.is() || !xAbort.is() ) return; @@ -86,11 +89,14 @@ handleLockedDocumentRequest_( aArguments.push_back( !aInfo.isEmpty() ? aInfo : Translate::get( STR_UNKNOWNUSER, aResLocale) ); + aArguments.push_back( xRetry.is() + ? Translate::get( STR_OPENLOCKED_ALLOWIGNORE_MSG, aResLocale ) + : "" ); aMessage = Translate::get(STR_OPENLOCKED_MSG, aResLocale); aMessage = UUIInteractionHelper::replaceMessageWithArguments( aMessage, aArguments ); - ScopedVclPtrInstance< OpenLockedQueryBox > xDialog(pParent, aResLocale, aMessage); + ScopedVclPtrInstance< OpenLockedQueryBox > xDialog(pParent, aResLocale, aMessage, xRetry.is()); nResult = xDialog->Execute(); } else if ( nMode == UUI_DOC_SAVE_LOCK ) @@ -128,6 +134,8 @@ handleLockedDocumentRequest_( xApprove->select(); else if ( nResult == RET_NO ) xDisapprove->select(); + else if ( nResult == RET_IGNORE && xRetry.is() ) + xRetry->select(); else xAbort->select(); } |