[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Dec 18 04:00:51 UTC 2018


 include/sfx2/docfile.hxx    |    2 +-
 sfx2/source/doc/docfile.cxx |   14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit c49ea4f3155dcb3538c81734e911eb2910570553
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Dec 18 03:05:02 2018 +0100
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Dec 18 05:00:30 2018 +0100

    Simplify ShowLockedDocumentDialog argument list
    
    No need to pass file URL explicitly - it's available as GetURLObject().
    commit 607b80ca3cddc239a35580470944a438ce144fc8 follow-up.
    
    Change-Id: I6a2ceb6d3ae78c277f40215082af22112f9e2d27
    Reviewed-on: https://gerrit.libreoffice.org/65300
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 8e22b0a40b31..8019c8a676d2 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -295,7 +295,7 @@ public:
 
 private:
     enum class ShowLockResult { NoLock, Succeeded, Try };
-    ShowLockResult ShowLockedDocumentDialog(const OUString& aDocURL, const LockFileEntry& aData,
+    ShowLockResult ShowLockedDocumentDialog(const LockFileEntry& aData,
                                             bool bIsLoading, bool bOwnLock, bool bHandleSysLocked);
     enum class MessageDlg { LockFileIgnore, LockFileCorrupt };
     bool                ShowLockFileProblemDialog(MessageDlg nWhichDlg);
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 7c23cfa90046..e6eefe86e6b6 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -986,8 +986,7 @@ OUString tryForeignLockfiles(const OUString& sDocURL)
 }
 }
 
-SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog(const OUString& aDocURL,
-                                                              const LockFileEntry& aData,
+SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog(const LockFileEntry& aData,
                                                               bool bIsLoading, bool bOwnLock,
                                                               bool bHandleSysLocked)
 {
@@ -1028,9 +1027,10 @@ SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog(const OUString& aD
             else
                 aInfo = aData[LockFileComponent::SYSUSERNAME];
 
-            if (aInfo.isEmpty() && !aDocURL.isEmpty())
+            if (aInfo.isEmpty() && !GetURLObject().isAnyKnownWebDAVScheme())
                 // Try to get name of user who has locked the file using other applications
-                aInfo = tryForeignLockfiles(aDocURL);
+                aInfo = tryForeignLockfiles(
+                    GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE));
 
             if ( !aInfo.isEmpty() && !aData[LockFileComponent::EDITTIME].isEmpty() )
                 aInfo += " ( " + aData[LockFileComponent::EDITTIME] + " )";
@@ -1265,7 +1265,8 @@ SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand( bool bLoading, bool b
 
                             if ( !bResult && !bNoUI )
                             {
-                                bUIStatus = ShowLockedDocumentDialog("", aLockData, bLoading, false , true );
+                                bUIStatus
+                                    = ShowLockedDocumentDialog(aLockData, bLoading, false, true);
                             }
                         }
                         catch( ucb::InteractiveNetworkWriteException& )
@@ -1488,8 +1489,7 @@ SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand( bool bLoading, bool b
                                 {
                                     if (!bNoUI)
                                         bUIStatus = ShowLockedDocumentDialog(
-                                            pImpl->m_aLogicName, aData, bLoading, bOwnLock,
-                                            bHandleSysLocked);
+                                            aData, bLoading, bOwnLock, bHandleSysLocked);
                                     else if (bLoading && bTryIgnoreLockFile && !bHandleSysLocked)
                                         bUIStatus = ShowLockResult::Succeeded;
 


More information about the Libreoffice-commits mailing list