libreoffice-online/test/data
Miklos Vajna b14f3fffff cool#8465 clipboard: improve handling of plain text copy, complex case
In case the selection is complex (not simple), we used to just request
HTML, and then the browser converted that to plain text, which has the
downsides already mentioned in commit
7f9de46688 (cool#8465 clipboard: improve
handling of plain text copy, simple case, 2024-03-08).

Steps to support this:

1) Clipboard.js now asks for the text/html,text/plain;charset=utf-8 MIME
   types.

2) wsd: ClientRequestDispatcher::handleClipboardRequest() now maps this
   to DocumentBroker::CLIP_REQUEST_GET_HTML_PLAIN_ONLY

3) ClientSession::handleClipboardRequest() maps this to the HTML+plain
   text MIME type list.

4) kit: ChildSession::getClipboard() is now improved to take a list of
   MIME types, not just 1 or everything.

5) kit: ChildSession::getClipboard() now emits JSON in case not all, but
   multiple MIME types are requested.

6) wsd: ClientSession::postProcessCopyPayload() now knows how to
   postprocess clipboardcontent messages, which may or may not be JSON
   (it's JSON if more formats are requested explicitly, leaving the 1
   format or all format cases unchanged)

7) Control.DownloadProgress.js now handles the case when we get JSON and
   sets the core-provided plain text next to the HTML.

   Leave the handling of non-JSON case in, because this means we can
   copy from an old COOL server to a new one.

Note that this approach has the benefit that once the clipboard marker
is inserted, the length of the text/html format would change, which
means we can't parse the clipboard data till the marker is removed.
Emitting JSON for html+text means adding the marker keeps the ability to
parse the HTML and the plain text part of the clipboard in JS.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I67a1f669e8a638d34cc25a2f288a7b30884b9892
2024-03-20 10:21:59 +01:00
..
bullets.odt cool#8465 clipboard: improve handling of plain text copy, complex case 2024-03-20 10:21:59 +01:00
calc-render.ods
calc_render.xls
calc_render_0_256x256.3840,0.7680x7680.png
convert-to.xlsx
corrupted.odt
delta-graphic.png
delta-graphic2.png
delta-text.png
delta-text2.png
empty.odg
empty.odp
empty.ods
empty.odt
Example.odt
graphicviewselection.odp
graphicviewselection.ods
graphicviewselection.odt
hello-world.odg
hello.odp
hello.ods
hello.odt
hello.txt
hide-whitespace.odt
insert-delete.odp
large-six-hundred.odt
load12.ods
non-shape-image.odt
non_shape_writer_image.svg
password-protected.doc
password-protected.docx
password-protected.ods
paste.html
perf-test.odt
RenderSearchResultFragment.xml
RenderSearchResultTest.odt
setclientpart.odp
setclientpart.ods
shape.ods
shape.odt
shapes.odp
shapes_impress.svg
test.ott
test.ppsx
tiff.odt
timeline.xlsx
viewcursor.odp
with_comment.odt