Files
odfstudio/include
Miklos Vajna d926b932c4 cool#15908 engine sw, SetHyperlink: ignore given text when there is a selection
Have a text document, select a word, dispatch the postmessage API's
'Action_InsertLink' message with a '{"url": "http://www.example.com",
"text": "mytext"}' value, the selected word is replaced by 'mytext'.

As described in commit 1e91e03bb69ce162323f7b42dd4b25536963e396 (wopi:
Action_InsertLink: accept optional "text" label from the host,
2026-04-22), the idea is that the "text" key is only used as a hint,
when the cursor has no selection.

Implement this first in Writer: if there is a selection, then set the
hyperlink on that selection, else try to use the "text" key, finally go
with the URL. Do this via an opt-in flag, so the hyperlink dialog
behavior is unchanged.

An alternative approach would be to try to have the current text
selection in the browser all the time as
<https://gerrit.collaboraoffice.com/c/online/+/1447> would do it, but
that would require storing the currently selected text in the browser
again, and not doing that was an improvement in commit
75251f9496f44f8678e43c1525719e5e4cc3b6ee (cool#8648 clipboard: try to
use navigator.clipboard.write(), 2024-04-04). It would also not preserve
the formatting of the text selection.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ib7473ec2b301c913af767c2f9e655b08d07a70bd
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3609
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 277ebe4cdc9ce386e9baedc687f67498b8c60cba)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206210
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-08 15:59:44 +02:00
..
2026-05-22 09:32:38 +02:00
2026-02-18 13:44:22 +01:00
2026-04-30 08:54:45 +02:00
2026-06-04 10:00:29 +02:00
2026-06-04 10:00:29 +02:00
2026-04-30 08:54:45 +02:00
2026-06-08 10:09:40 +02:00
2026-04-30 08:54:45 +02:00
2026-06-05 12:42:59 +02:00
2026-05-22 09:32:38 +02:00
…
2026-04-30 08:54:45 +02:00
…
…
…
…