diff options
author | Tor Lillqvist <tml@iki.fi> | 2022-01-04 16:33:16 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2022-01-06 13:52:00 +0100 |
commit | 6bcf00763402fc0969486e852634b5559fa044ba (patch) | |
tree | d407b5ac57a25944abb9fca05eddf59fec3e1dd6 /desktop/source/lib | |
parent | 69880354d192c34fec1e77f94e55bc5e8e16dcee (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/lib')
-rw-r--r-- | desktop/source/lib/init.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index fc43e606d7bb..407c1c0ebf33 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; @@ -4706,6 +4708,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; @@ -4782,6 +4796,7 @@ static int doc_getClipboard(LibreOfficeKitDocument* pThis, } return 1; +#endif } static int doc_setClipboard(LibreOfficeKitDocument* pThis, @@ -5529,7 +5544,9 @@ static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, SolarMutexGuard aGuard; SetLastExceptionMsg(); +#ifndef IOS LOKClipboardFactory::releaseClipboardForView(nId); +#endif SfxLokHelper::destroyView(nId); @@ -5796,6 +5813,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)); @@ -5817,6 +5835,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 } } |