summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-10-11 18:20:29 +0300
committerTor Lillqvist <tml@collabora.com>2018-10-11 19:57:40 +0300
commit4dcd54067d27376bd66402318ac891257191d805 (patch)
tree0b43c7e2f53ed49f75092b07c2e14d1c85549fc9 /sfx2/source/doc
parentfb4c929328027b1a804f214c4d189c9b59e0af51 (diff)
Skip the backup dance on iOS for now
The code is much too convoluted for my little brain. We can't create a backup copy of a file from outside the sandbox in the same folder as the original file. At least not using just normal Unix APIs. And if we store it somewhere else, how would the user find it anyway? Let's just skipt this mess for now. No idea how the code manages to create backup files in the same folder as the actual document in a sandboxed LibreOffice on macOS. Or does it? Maybe we do some similar bypassing of the backup dance at some other place in the code already, and I should just have made that happen for iOS, too? Change-Id: I0c90edf9e72f54cce78b2cd325e67c710b6df745
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r--sfx2/source/doc/objstor.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 9ff4ce357c2b..8181e1336a8a 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
@@ -1743,6 +1743,19 @@ bool SfxObjectShell::DisconnectStorage_Impl( SfxMedium& rSrcMedium, SfxMedium& r
uno::Reference< embed::XStorage > xStorage = rSrcMedium.GetStorage();
bool bResult = false;
+#ifdef IOS
+ // On iOS, we typically can't create a backup file in the same folder as where the document is
+ // because that is outside the sandbox, like "/private/var/mobile/Library/Mobile
+ // Documents/com~apple~CloudDocs" for documents opened from the iCloud Drive. So bypass this
+ // whole backup dance for now.
+
+ // FIXME: Also, should investigate whether iOS has some native high-level API that can be used
+ // for automatic keeping of some suitable number of backup copies from various pooints in time,
+ // or something. Although, even if it has, marrying that to the horrible mess here in sfx2, and
+ // in ucb, sal, etc won't be fun.
+ (void) rTargetMedium;
+ bResult = true;
+#else
if ( xStorage == pImpl->m_xDocStorage )
{
try
@@ -1781,7 +1794,7 @@ bool SfxObjectShell::DisconnectStorage_Impl( SfxMedium& rSrcMedium, SfxMedium& r
catch ( uno::Exception& )
{}
}
-
+#endif // !IOS
return bResult;
}