[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3-desktop' - sfx2/source uui/source

2018-03-12 Thread Mike Kaganski
 sfx2/source/doc/docfile.cxx   |2 +-
 uui/source/iahndl-locking.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6a5f15d2b35a5a6e3ae0a1fa534facfe7e92bb3c
Author: Mike Kaganski 
Date:   Mon Mar 12 19:22:28 2018 +0100

Build fix after ea0a6c66e8ae2002953a458c1a8cc8fd54ccc297

Also contains e93a48a3e290022213a90c58e057907b8ee2907f

Reviewed-on: https://gerrit.libreoffice.org/51162
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 
(cherry picked from commit db585162fdc8dcd804a99338d0c2c3c5e9d8088d)

Change-Id: I5aa972e6c9b5f9c24f69350171b9ac570a866003
Reviewed-on: https://gerrit.libreoffice.org/51179
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index b80374fa39f7..dfcf9d94d09f 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1261,7 +1261,7 @@ SfxMedium::LockFileResult 
SfxMedium::LockOrigFileOnDemand( bool bLoading, bool b
 if (!bLoading && bUseSystemLock && pImpl->pTempFile)
 {
 INetURLObject aDest(GetURLObject());
-OUString 
aDestURL(aDest.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+OUString 
aDestURL(aDest.GetMainURL(INetURLObject::DecodeMechanism::NO_DECODE));
 
 if (comphelper::isFileUrl(aDestURL) || 
!aDest.removeSegment())
 {
diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx
index f4a14ef9bc3f..3f82480cdb35 100644
--- a/uui/source/iahndl-locking.cxx
+++ b/uui/source/iahndl-locking.cxx
@@ -116,7 +116,7 @@ handleLockedDocumentRequest_(
 aMessage = UUIInteractionHelper::replaceMessageWithArguments(
 aMessage, aArguments );
 
-ScopedVclPtrInstance< TryLaterQueryBox > xDialog( pParent, 
xManager.get(), aMessage );
+ScopedVclPtrInstance< TryLaterQueryBox > xDialog( pParent, 
xManager.get(), aMessage, xRetry.is() );
 nResult = xDialog->Execute();
 }
 else if ( nMode == UUI_DOC_OWN_LOAD_LOCK ||
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3-desktop' - sfx2/source uui/source

2018-03-12 Thread Mike Kaganski
 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