Kaydet (Commit) c49ea4f3 authored tarafından Mike Kaganski's avatar Mike Kaganski

Simplify ShowLockedDocumentDialog argument list

No need to pass file URL explicitly - it's available as GetURLObject().
commit 607b80ca follow-up.

Change-Id: I6a2ceb6d3ae78c277f40215082af22112f9e2d27
Reviewed-on: https://gerrit.libreoffice.org/65300
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 8dc3fe63
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment