summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-02-08 18:06:06 +0300
committerAron Budea <aron.budea@collabora.com>2018-02-09 15:44:10 +0100
commite189dd061bb0817e1f9e872c9b8dc82b72bfffc5 (patch)
tree0dcd15c79b7fc00208fa22d33d31dcfd540cf3d9 /include
parentImprove tdf#106942: always erase empty/corrupt lockfile (diff)
downloadcore-e189dd061bb0817e1f9e872c9b8dc82b72bfffc5.tar.gz
core-e189dd061bb0817e1f9e872c9b8dc82b72bfffc5.zip
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> Reviewed-on: https://gerrit.libreoffice.org/49470 Reviewed-by: Aron Budea <aron.budea@collabora.com> Tested-by: Aron Budea <aron.budea@collabora.com>
Diffstat (limited to 'include')
-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 3a9c8978774f..6df519c2c625 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -163,11 +163,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