Bug 127588 - BACKGROUND COLOR IN TABLE: Error message when pasting hex value "The inserted text exceeded the maximum length of this text field."
Summary: BACKGROUND COLOR IN TABLE: Error message when pasting hex value "The inserted...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.5.2 release
Hardware: All All
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.6.0
Keywords: needUITest
Depends on:
Blocks: Writer-Table-Properties-Dialog
  Show dependency treegraph
 
Reported: 2019-09-17 08:04 UTC by Grey
Modified: 2022-12-26 12:06 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grey 2019-09-17 08:04:15 UTC
Description:
Version: 6.3.0.4
Build ID: 057fc023c990d676a43019934386b85b21a9ee99
CPU threads: 8; OS: Mac OS X 10.12.6; UI render: default; VCL: osx; 

I am trying to paste Hex values copied from Firefox (using WebDeveloper "Inspect Element") to a LibreOffice Writer document's table cell. When I paste the Hex value into the value box, LireOffice consistently throws the following error:

"The inserted text exceeded the maximum length of this text field. The text was truncated."

I am pasting six digits, no leading #. For example, I paste FFB369 (or any six-digit value) into the Hex value box, LO throws the error and in the value box I find "b00000".

Verifying the copy/paste information is correct, I pasted the Hex value in the document itself and copied the freshly-pasted value from the document. When pasted into the value box LO throws the same error with the same result, "b00000".

Also, when entering the value by hand, LO lags in accepting typed data. Unless typed slowly, "ffb369" becomes "fb3690".

Steps to Reproduce:
1. Copy a valid six-digit Hex value from any source
2. Choose a cell in a Writer table and right-click "Properties..."
3. Paste the value into the Hex value box.

Actual Results:
LibreOffice Writer throws the error "The inserted text exceeded the maximum length of this text field. The text was truncated." Value automatically entered in the Hex value box is consistently "b00000".

Expected Results:
The pasted value should have been accepted, no error message.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Dieter 2019-09-18 16:56:41 UTC
I confirm it with

Version: 6.4.0.0.alpha0+ (x64)
Build ID: f0c832acb53326ccc9a8c1a47401fbc9e1081feb
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2019-09-11_05:46:53
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded

and also with

Version: 6.2.5.2 (x64)
Build-ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159
CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded
Comment 2 Sébastien Valente 2019-10-21 16:44:40 UTC
I reproduced this case on Linux Manjaro, but it depends on the way you select the existing Hex value: if you select the whole text from right to left with the mouse (for instance), this will bring the error message.

Now if you select the existing value from Tab, or from double click, or even from left to right, it works.
Comment 3 QA Administrators 2021-10-21 03:35:16 UTC Comment hidden (noise)
Comment 4 Roman Kuznetsov 2021-10-24 15:02:38 UTC
no repro in

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: f8bb970fd385c80b085a071da0f8acc119498005
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded

I see so strange behavior in HEX field => I can't delete current value and I just select all symbols and replaced it to new value from the clipboard. May be it is the problem here?

Someone please retest it too
Comment 5 Grey 2021-10-24 16:12:14 UTC
Version: 7.1.6.2 / LibreOffice Community
Build ID: 0e133318fcee89abacd6a7d077e292f1145735c3
CPU threads: 8; OS: Mac OS X 10.13.6; UI render: default; VCL: osx
Locale: it-IT (it_IT.UTF-8); UI: en-US
Calc: threaded

Retested. Results: LO still throws the same error, "The inserted text exceeded the maximum length of this text field. The text was truncated.", BUT the Hex # textbox accepts the pasted hex value instead of defaulting to an incorrect "b000000".

Regarding the text entry lag, this bug no longer exists; text is accepted normally.
Comment 6 Grey 2021-10-24 16:15:34 UTC
(In reply to Roman Kuznetsov from comment #4)
> I see so strange behavior in HEX field => I can't delete current value and I
> just select all symbols and replaced it to new value from the clipboard. May
> be it is the problem here?

Can't replicate: Values in the Hex # text field are fully editable/erasable.
Comment 7 Andreas Heinisch 2022-12-22 14:03:12 UTC
The hex input is a GtkEntry with a width-request of 6 characters with the possibility to select a single or more independent characters.

If a user selects for instance a single digit and tries to paste a 6 digits hex value (c99b45) then the 6 digits do not fit into the one digit number an the error message will be shown.

If you select two digits and paste a hex number, then LO inserts two digits of the copied hex number.

We could just select the entire text present in this field on focus, so pasting a 6 digit hex number will succeed.
Comment 8 Andreas Heinisch 2022-12-23 08:21:34 UTC
I am not quite sure how to solve this correctly:

- If you select just 2 numbers, these will be pasted.
- If you select the entire field, the entire content will be printed.

I suggest the following procedure:

- Paste everything from the current cursor position iff. the cursor is at position one and just ONE digit is selected in the field. Then, paste all the 6 hex digits.
- Otherwise, paste all numbers from the cursor position if just one character is selected, otherwise paste the selected ones.

What do you think?
Comment 9 Commit Notification 2022-12-26 12:04:48 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/68c4dbcebed057084083b968f244b8c430a4dc60

tdf#127588 - extend selection to the entire field if nothing is selected

It will be available in 7.6.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.
Comment 10 Andreas Heinisch 2022-12-26 12:06:22 UTC
I could not manage to provide an UI test since the control does not support the selection of a text portion neither the movement of the cursor inside the entry field. Tested it manually and any further testing is highly appreciated!