summaryrefslogtreecommitdiff
path: root/include/sfx2/docfile.hxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-02-08 18:06:06 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-02-09 05:48:58 +0100
commit2a7057250c8f73fdfb4c65a7525d17e9770459df (patch)
tree2fb8b54e2e00f731818041449362ec2163f908ad /include/sfx2/docfile.hxx
parent7d56128654457bfc859217c23a957d1712fd6e1c (diff)
tdf#108210: Allow to ignore a lock file if there's no filesystem lock
Two cases are handled: when a file is being opened, and when it was opened read-only already, and one tries to reopen it in edit mode. The option to ignore locking and open the file anyway is only offered when there is no filesystem lock present on the file. Change-Id: I377d3cae4c949ae64d449634acea8fb3f68a5700 Reviewed-on: https://gerrit.libreoffice.org/49448 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'include/sfx2/docfile.hxx')
-rw-r--r--include/sfx2/docfile.hxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 822c69b1da4f..06a7f9623764 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -162,11 +162,13 @@ public:
bool Commit();
bool IsStorage();
- enum class ShowLockResult { NoLock, Succeeded,Try };
- ShowLockResult ShowLockedDocumentDialog( const LockFileEntry& aData, bool bIsLoading, bool bOwnLock, bool bHandleSysLocked);
- void LockOrigFileOnDemand( bool bLoading, bool bNoUI );
- enum class MessageDlg { LockFileIgnore, LockFileCorrupt };
- bool ShowLockFileProblemDialog(MessageDlg nWhichDlg);
+ enum class LockFileResult
+ {
+ Failed,
+ FailedLockFile, // there was only lock file that prevented success - no syslock or IO error
+ Succeeded,
+ };
+ LockFileResult LockOrigFileOnDemand( bool bLoading, bool bNoUI, bool bTryIgnoreLockFile = false );
void DisableUnlockWebDAV( bool bDisableUnlockWebDAV = true );
void UnlockFile( bool bReleaseLockStream );
/// Lets Transfer_Impl() not fsync the output file.
@@ -275,6 +277,13 @@ public:
static bool SetWritableForUserOnly( const OUString& aURL );
static sal_uInt32 CreatePasswordToModifyHash( const OUString& aPasswd, bool bWriter );
+
+private:
+ enum class ShowLockResult { NoLock, Succeeded, Try };
+ ShowLockResult ShowLockedDocumentDialog(const LockFileEntry& aData, bool bIsLoading, bool bOwnLock, bool bHandleSysLocked);
+ enum class MessageDlg { LockFileIgnore, LockFileCorrupt };
+ bool ShowLockFileProblemDialog(MessageDlg nWhichDlg);
+
};
#endif