sfx2/source/doc/docfile.cxx | 51 ++
uui/source/iahndl-locking.cxx |3 +-
uui/source/ids.hrc| 35 ++--
uui/source/trylater.cxx | 29 ++-
uui/source/trylater.hxx |2 -
uui/source/trylater.src |4 +++
6 files changed, 84 insertions(+), 40 deletions(-)
New commits:
commit ea0a6c66e8ae2002953a458c1a8cc8fd54ccc297
Author: Mike Kaganski
Date: Wed Feb 21 00:45:04 2018 +0300
tdf#115742: allow ignoring stale lockfile on save
This change reuses TryLaterQueryBox, but only uses the new option to
ignore the lock and save. Other options ("Try Again" and "Save As")
are not used, because this functionality is not implemented currently
(TODO/LATER).
Change-Id: Idf825be23cf97d2b338c0cf5d532f8460843bf48
Reviewed-on: https://gerrit.libreoffice.org/50371
Tested-by: Jenkins
Reviewed-by: Mike Kaganski
Reviewed-on: https://gerrit.libreoffice.org/51149
Reviewed-by: Andras Timar
Tested-by: Andras Timar
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index a7b8af14c13a..b80374fa39f7 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -29,6 +29,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -67,6 +68,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -858,7 +860,7 @@ SfxMedium::ShowLockResult
SfxMedium::ShowLockedDocumentDialog( const LockFileEnt
// show the interaction regarding the document opening
uno::Reference< task::XInteractionHandler > xHandler =
GetInteractionHandler();
-if ( ::svt::DocumentLockFile::IsInteractionAllowed() && xHandler.is() && (
bIsLoading || bOwnLock ) )
+if ( ::svt::DocumentLockFile::IsInteractionAllowed() && xHandler.is() && (
bIsLoading || !bHandleSysLocked || bOwnLock ) )
{
OUString aDocumentURL = GetURLObject().GetLastName();
OUString aInfo;
@@ -873,27 +875,32 @@ SfxMedium::ShowLockResult
SfxMedium::ShowLockedDocumentDialog( const LockFileEnt
xInteractionRequestImpl = new ::ucbhelper::InteractionRequest(
uno::makeAny(
document::OwnLockOnDocumentRequest( OUString(),
uno::Reference< uno::XInterface >(), aDocumentURL, aInfo, !bIsLoading ) ) );
}
-else /*logically therefore bIsLoading is set */
+else
{
+// Use a fourth continuation in case there's no filesystem lock:
+// "Ignore lock file and open/replace the document"
+if (!bHandleSysLocked)
+nContinuations = 4;
+
if ( !aData[LockFileComponent::OOOUSERNAME].isEmpty() )
aInfo = aData[LockFileComponent::OOOUSERNAME];
else
aInfo = aData[LockFileComponent::SYSUSERNAME];
if ( !aInfo.isEmpty() &&
!aData[LockFileComponent::EDITTIME].isEmpty() )
+aInfo += " ( " + aData[LockFileComponent::EDITTIME] + " )";
+
+if (!bIsLoading) // so, !bHandleSysLocked
{
-aInfo += " ( " ;
-aInfo += aData[LockFileComponent::EDITTIME];
-aInfo += " )";
+xInteractionRequestImpl = new
::ucbhelper::InteractionRequest(uno::makeAny(
+document::LockedOnSavingRequest(OUString(),
uno::Reference< uno::XInterface >(), aDocumentURL, aInfo)));
+// Currently, only the last "Retry" continuation (meaning
ignore the lock and try overwriting) can be returned.
+}
+else /*logically therefore bIsLoading is set */
+{
+xInteractionRequestImpl = new ::ucbhelper::InteractionRequest(
uno::makeAny(
+document::LockedDocumentRequest( OUString(),
uno::Reference< uno::XInterface >(), aDocumentURL, aInfo ) ) );
}
-
-xInteractionRequestImpl = new ::ucbhelper::InteractionRequest(
uno::makeAny(
-document::LockedDocumentRequest( OUString(), uno::Reference<
uno::XInterface >(), aDocumentURL, aInfo ) ) );
-
-// Use a fourth continuation in case there's no filesystem lock:
-// "Ignore lock file and open the document"
-if (!bHandleSysLocked)
-nContinuations = 4;
}
uno::Sequence< uno::Reference< task::XInteractionContinuation > >
aContinuations(nContinuations);
@@ -903,7 +910,7 @@ SfxMedium::ShowLockResult
SfxMedium::ShowLockedDocumentDialog( const LockFileEnt
if (nContinuations > 3)
{
// We use InteractionRetry to reflect that user wants to
-// ignore the (stale?) alien lock file and open the document
+// ignore the (stale?) alien lock file and