summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2022-01-04 16:33:16 +0200
committerAndras Timar <andras.timar@collabora.com>2022-02-14 11:25:42 +0100
commit0111b70afdce44118a3616496c70c75962e7f57f (patch)
treee472c6d90579549f75a36c037e9c5afe89bb74e2 /desktop/source
parenta22174988fe078fd1307804b254105f36931a9c7 (diff)
We don't want or need any LOKClipboard on iOS
Try to make the code more like in the co-2021 branch, where copy/paste between Collabora Office and other iOS apps currently works again, in both directions, both for text and images. Sadly something is broken or missing either here in core or in online as it doesn't fully work in a Collabora Office based on the master branch of core, even after this commit, though. We use only the system clipboard on iOS. (It is actually called the "pasteboard" in Apple's operating systems.) The code to interface with the system clipboard is in vcl. It has worked fine to copy and paste between the Collabora Office iOS app and other iOS apps without any LOKClipboard being involved. If LOKClipboard is used it doesn't work at all. Change-Id: I0d3b4e3eabe17b633390e071701225e1d356a75a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128037 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2f7de4793558..a79e69e1b85b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2352,7 +2352,9 @@ static void doc_destroy(LibreOfficeKitDocument *pThis)
SolarMutexGuard aGuard;
+#ifndef IOS
LOKClipboardFactory::releaseClipboardForView(-1);
+#endif
LibLODocument_Impl *pDocument = static_cast<LibLODocument_Impl*>(pThis);
delete pDocument;
@@ -4716,6 +4718,18 @@ static int doc_getClipboard(LibreOfficeKitDocument* pThis,
size_t **pOutSizes,
char ***pOutStreams)
{
+#ifdef IOS
+ (void) pThis;
+ (void) pMimeTypes;
+ (void) pOutCount;
+ (void) pOutMimeTypes;
+ (void) pOutSizes;
+ (void) pOutStreams;
+
+ assert(!"doc_getClipboard should not be called on iOS");
+
+ return 0;
+#else
comphelper::ProfileZone aZone("doc_getClipboard");
SolarMutexGuard aGuard;
@@ -4792,6 +4806,7 @@ static int doc_getClipboard(LibreOfficeKitDocument* pThis,
}
return 1;
+#endif
}
static int doc_setClipboard(LibreOfficeKitDocument* pThis,
@@ -5539,7 +5554,9 @@ static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis,
SolarMutexGuard aGuard;
SetLastExceptionMsg();
+#ifndef IOS
LOKClipboardFactory::releaseClipboardForView(nId);
+#endif
SfxLokHelper::destroyView(nId);
@@ -5806,6 +5823,7 @@ static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindo
}
else if (nAction == LOK_WINDOW_PASTE)
{
+#ifndef IOS
OUString aMimeType;
css::uno::Sequence<sal_Int8> aData;
std::vector<beans::PropertyValue> aArgs(jsonToPropertyValuesVector(pData));
@@ -5827,6 +5845,10 @@ static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindo
}
else
SetLastExceptionMsg("Window command 'paste': wrong parameters.");
+#else
+ (void) pData;
+ assert(!"doc_postWindow() with LOK_WINDOW_PASTE should not be called on iOS");
+#endif
}
}