Bug 127870 - "Hyperlink" dialogue box trims "Text:" to 255 characters, even if it's longer
Summary: "Hyperlink" dialogue box trims "Text:" to 255 characters, even if it's longer
Status: RESOLVED DUPLICATE of bug 101463
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
3.3.0 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Hyperlink-Dialog
  Show dependency treegraph
Reported: 2019-09-29 22:08 UTC by David Gerard
Modified: 2021-01-04 18:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description David Gerard 2019-09-29 22:08:51 UTC
If you highlight text over 255 characters long and open the "Hyperlink" dialogue (either via Insert->Hyperlink or ctrl-k), then the text in the "Text:" field is cut to the first 255 characters. Adding a URL and hitting "OK" will then cut the text in the document to just these 255 characters.

Steps to Reproduce:
1. Select text over 255 characters.
2. Open "Hyperlink" dialogue.
3. Add a URL to the "URL:" box.
4. Hit "OK." Text is trimmed to 255 characters in the document (and hyperlinked).

Actual Results:
Text is trimmed to 255 characters in the document (and hyperlinked).

Expected Results:
Text should be hyperlinked, and not trimmed.

Reproducible: Always

User Profile Reset: Yes

Additional Info:
Manifests in Linux 6.4-alpha from git master, built today: 725b51044b955946c6528ca08a8a36dc44f09cd8

Also manifests in Windows 6.4-alpha in daily build  d744838991594eebe27acc4c7d9fb4579d654853 from 2019-09-29_05:12:00

Testing an old version, it showed up in Windows 6.4-alpha in daily build 12748b06cbdefd67725009520e4c27bd82cab60f from 2019-07-02_13:41:00
Comment 1 David Gerard 2019-09-30 16:56:01 UTC
This looks like an old one - I found it in 6.2.7 for Windows and 6.3.1 for Windows, the current download versions.

And in fact, I tested LO 3.3.0 from 2011 ... and the bug as described works there too! The text field cuts off the text at 255 characters.

I discovered this in the course of just using LO for writing - one accepted way to reference tweets from Twitter is to quote the entire tweet as the title of the work, and hyperlink that title. And now tweets can go up to 280 characters.

I can work around the bug, but it's fiddly and prone to breakage if I open the Hyperlink dialogue again ...
Comment 2 martin.nadal 2019-10-03 11:26:19 UTC
Confirmed in Ubuntu 19.4 x64
Comment 3 David Gerard 2019-10-04 20:28:52 UTC
To be precise - it seems to trim the text when it's being read into the Hyperlink dialogue. If you select text that's over 255 characters long, and open Hyperlink, the text in the Text field will be cut off at 255 characters - and if you hit "OK", then that cut-off text is what will be saved.

You can make the text in the Text field longer than 255 characters, and if you hit "OK" then the extra characters are saved. So the 255-character cutoff seems to be in the process of reading the selected text into the Hyperlink box.

For comparison, Google Docs doesn't suffer this limitation.
Comment 4 David Gerard 2019-11-02 18:23:08 UTC
In further tests: if I have the Hyperlink dialogue already open, the "Text" field can take up to 65,534 characters (2^16-2). When I hit "OK", these are put into the document correctly.

So I would guess that all this needs to fix it is for whatever takes the selection from the document reading 16 bits of characters from the selection, instead of 8 bits.
Comment 5 BogdanB 2020-12-19 10:56:20 UTC
Exacly, if the text is already selected just 255, if I insert the text ather the hyperlink dialog opened is ok.

Tested in 
Build ID: dcf040e67528d9187c66b2379df5ea4407429775
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 6 Gabor Kelemen (allotropia) 2021-01-04 18:52:40 UTC

*** This bug has been marked as a duplicate of bug 101463 ***