summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--framework/source/services/autorecovery.cxx2
-rw-r--r--sfx2/source/doc/docfile.cxx29
2 files changed, 29 insertions, 2 deletions
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 653567dd6d94..619fbba2a080 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -2013,7 +2013,7 @@ void AutoRecovery::implts_changeAllDocVisibility(sal_Bool bVisible)
*/
void lc_removeLockFile(AutoRecovery::TDocumentInfo& rInfo)
{
-#if !HAVE_FEATURE_MULTIUSER_ENVIRONMENT
+#if !HAVE_FEATURE_MULTIUSER_ENVIRONMENT || HAVE_FEATURE_MACOSX_SANDBOX
(void) rInfo;
#else
if ( rInfo.Document.is() )
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 8a93ef20a36b..2034369eb1bc 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -140,13 +140,21 @@ static const sal_Int8 LOCK_UI_TRY = 2;
bool IsSystemFileLockingUsed()
{
+#if HAVE_FEATURE_MACOSX_SANDBOX
+ return true;
+#else
return officecfg::Office::Common::Misc::UseDocumentSystemFileLocking::get();
+#endif
}
//----------------------------------------------------------------
bool IsOOoLockFileUsed()
{
+#if HAVE_FEATURE_MACOSX_SANDBOX
+ return false;
+#else
return officecfg::Office::Common::Misc::UseDocumentOOoLockFile::get();
+#endif
}
bool IsLockingUsed()
@@ -831,6 +839,21 @@ void SfxMedium::SetEncryptionDataToStorage_Impl()
#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
+// FIXME: Hmm actually lock files should be used for sftp: documents
+// even if !HAVE_FEATURE_MULTIUSER_ENVIRONMENT. Only the use of lock
+// files for *local* documents is unnecessary in that case. But
+// actually, the checks for sftp: here are just wishful thinking; I
+// don't this there is any support for actually editing documents
+// behind sftp: URLs anyway.
+//
+// Sure, there could perhaps be a 3rd-party extension that brings UCB
+// the potential to handle files behind sftp:. But there could also be
+// an extension that handles some arbitrary foobar: scheme *and* it
+// could be that lock files would be the correct thing to use for
+// foobar: documents, too. But the hardcoded test below won't know
+// that. Clearly the knowledge whether lock files should be used or
+// not for some URL scheme belongs in UCB, not here.
+
//------------------------------------------------------------------
sal_Int8 SfxMedium::ShowLockedDocumentDialog( const uno::Sequence< OUString >& aData, sal_Bool bIsLoading, sal_Bool bOwnLock )
{
@@ -946,11 +969,15 @@ namespace
{
INetURLObject aUrl( rLogicName );
INetProtocol eProt = aUrl.GetProtocol();
+#if HAVE_FEATURE_MACOSX_SANDBOX
+ return eProt == INET_PROT_SFTP;
+#else
return eProt == INET_PROT_FILE || eProt == INET_PROT_SFTP;
+#endif
}
}
-#endif
+#endif // HAVE_FEATURE_MULTIUSER_ENVIRONMENT
// returns true if the document can be opened for editing ( even if it should be a copy )
// otherwise the document should be opened readonly