Description: The popup that appears when selecting text in the iOS App does not copy/paste text. The copy/paste functionality from the menu bar "Edit > Copy/paste" is greyed out. The only action that works is "cut", but it is impossible to "paste" this content again. Steps to Reproduce: 1. Select text by tapping three times on a word 2. Choose the leftmost icon (scissor) from the cut/copy/clipboard popup to cut the text 3. Tap another position in the document and try to let the popup appear again by tapping three times. 4. Click on "Edit" ("Bearbeiten" in the German screenshot) in the menu bar Actual Results: 1. The cut/copy/clipboard popup appears 2. The selected text disappears as expected. 3. The cut/copy/clipboard popup does not appear, only when selecting multiple characters, which is not intended to paste contents. 4. Actions "Edit > Cut/copy/paste" are greyed out. Expected Results: 1. The cut/copy/clipboard popup appears 2. The selected text disappears 3. The cut/copy/clipboard popup appears and lets me paste the contents. I would assume to paste in the same way I selected to cut/copy, but the popup does not appear. 4. The menu actions "Edit > Cut/copy/paste" should allow me to paste the content. Reproducible: Always User Profile Reset: No Additional Info: * Please see attached screenshots. * Loolwsd 4.0.3 (git hash: 3b931560) * Collabora Office 6.0-28 (git hash: 8286ce9)
Created attachment 150763 [details] pasting content is impossible
Created attachment 150764 [details] cut/copy/paste popup
Created attachment 150765 [details] copy visible but paste impossible
Created attachment 150766 [details] copy visible but paste impossible
Looking at this bug now. Possibly this is simply caused by some code not being built for the non-desktop case, some #ifdef added many years ago. Anyway, tracing the code in the debugger to see what is going on. There is also, I think, the concept of an "internal" clipboard in LibreOffice core, while possibly in the iOS app we always want to put things onto the system clipboard and take them from there, right?
(In reply to Tor Lillqvist from comment #5) > Anyway, tracing the code in the debugger to see what is going on. There is > also, I think, the concept of an "internal" clipboard in LibreOffice core, > while possibly in the iOS app we always want to put things onto the system > clipboard and take them from there, right? Ack, one clipboard would be easier, see also the comment in 'online': > commit aa1d9ce19644fd55f18635f0784225cb0bedb6e3 > Author: Jan Holesovsky <kendy@collabora.com> > Date: Mon May 20 18:50:41 2019 +0200 > > The Internal Copy / Internal Cut / Internal Paste is just confusing. > > Every user so far is confused of the existence of two clipboards - the > system one, and the Online internal one. > > We are able to detect that the copy / paste is happening inside the > document and perform the "internal copy / paste" accordingly, so let's > do what the other online office suites do, and just warn when the user > tries to access copy / paste from the menu. However, I cannot see the consequences of having one clipboard only. Would it still be possible to copy/paste elements (e.g., shapes) from within the same document?
One thing I noticed now (well, I *should* have known it, but did not remember) is that LibreOffice has no code for interfacing with the iOS system clipboard. There is code to interface with the macOS clipboard (NSPasteboard), but not the iOS one (UIPasteboard). Their APIs are not similar enough that it would be a case of changing NSPasteboard to UIPasteboard. The fix for pasting text into the iOS app from the system clipboard that was implemented recently (bug #125410, commit 936f3a143520c5a8c72fd0976c88580d3393d034) was purely in JavaScript, I added handling of the "paste" event. But the copy/paste popup uses functionality inside LibreOffice core, that does not exist for iOS yet. Working on it.
Note that kendy's commit was in the context of "normal" Online, where the JavaScript code that the user interacts with is running in the user's browser, while the LibreOffice core code is running on a server. The "internal" clipboard in that case would be inside the process on the server serving the document being edited. In the iOS app case both the JavaScript and the "server" code are part of the app.
Anyway, last evening I worked on clipboard code for iOS, and hopefully today or early next week it will work, and then at least the Edit > Copy and Edit > Paste menu entries should work as expected, and hopefully be able to copy and paste also images and perhaps even other kinds of data (like HTML snippets) to/from the iOS clipboard. (The paste button on the on-screen keyboard, or the Cmd-C and Cmd-V shortcuts won't necessarily be able to copy or paste anything else than text, though. Will see.)
Tor Lillqvist committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/online/+/a494b4f8d50c179c19fa87cce87cdfc2eafdf14e%5E%21 tdf#124752: Do post the UNO clipboard commands in a mobile app
Tor Lillqvist committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/b8c1f54d67c5ae90a868f9b33747c43b97c23351%5E%21 tdf#124752: Add system clipboard interface for iOS It will be available in 6.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Now it works better, for text (even formatted). Still need to work on images and test more complex things like tables or formatted text with images and stuff included.
Tor Lillqvist committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/e1cd536edd2636d150ae50b0d44a5aee1b8d4e34%5E%21 tdf#124752: Use best speed for PNG encoding on iOS It will be available in 6.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Tor Lillqvist committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/edf1f755d40c5423ffb411ff17f024fbafeb02b3%5E%21 tdf#124752: Reduce number of formats offered on clipboard on mobile devices It will be available in 6.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Tor Lillqvist committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/12800a215102435b16fd0e3028f1fdfe8ebeb090%5E%21 tdf#124752: Simplify the iOS DataFlavorMapping thing a lot It will be available in 6.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Now copy/paste between the Collabora Office app and other apps works much better. Will provide a fresh build of the app tomorrow.
Tor Lillqvist committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/3f8ac50022215e53b592c1d630dd0609cab4e58e%5E%21 tdf#124752: We do need to accept text/html from the system clipboard It will be available in 6.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Marking as resolved.