Bug 157168 - MetricSpinButton ignores out-of-range value instead of limiting to range
Summary: MetricSpinButton ignores out-of-range value instead of limiting to range
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.4.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:24.2.0 target:7.5.8 target:7.6.3
Keywords: bibisected, bisected, regression
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2023-09-09 15:12 UTC by Justin L
Modified: 2023-09-27 17:38 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 Justin L 2023-09-09 15:12:01 UTC
Before 7.6 (backported to 7.5.4), entering a number greater than the allowed range would automatically replace the number with the maximum or minimum value. Now the original number is left untouched, and the user is given no feedback that the value they entered is invalid.

Steps to reproduce.
1. Open anchoredInCellTextbox2.docx (attachment 189442 [details])
2. right-click on the textbox frame and choose "Position and Size"
3. Change the horizontal From-Left number to something like -10

Previously, the smallest value would have been entered.
Now, the original number is left unchanged.

The same will be true for pretty much any ranged number. The table border width is another example in this document.

caused by commit 4ae776b842a8b6f065206d3250113493fd688756
Author: Caolán McNamara on Thu May 11 16:03:57 2023 +0100
    tdf#155241 keep current MetricSpinButton value if unparseable junk input
Comment 1 Justin L 2023-09-09 15:31:23 UTC
Looking over the patch, it is clear this is a GTK-only problem. I suggest just reverting the GTK part.
Comment 2 Stéphane Guillou (stragu) 2023-09-14 17:02:07 UTC
Using the following steps:

1. Open attachment 189442 [details]
2. right-click on the textbox frame and choose "Position and Size"
3. Change the horizontal From-Left number from the original 1.27 cm to -20 cm, click in other field
- Result with 7.4.7.2: updated to -10.46 cm
- Result with 7.5.6.2: updated back to original 1.27 cm
4. Press OK, reopen the same dialog
- Result with 7.4.7.2: value is now 5.76 cm (a bug in itself?)
- Result with 7.5.6.2: value stays 1.27 cm

Version: 7.5.6.2 (X86_64) / LibreOffice Community
Build ID: f654817fb68d6d4600d7d2f6b647e47729f55f15
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

You're right that gen VCL plugin is not affected.
Comment 3 Commit Notification 2023-09-23 06:03:50 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c794cc61cdb07f2b7d1a2f30add52a53ccdac458

tdf#157168 GtkSpinButton ignores out-of-range value instead of limiting

It will be available in 24.2.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 4 Caolán McNamara 2023-09-23 06:04:51 UTC
done in trunk, backports to 7-6 and 7-5 in gerrit
Comment 5 Commit Notification 2023-09-25 10:17:23 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/4ca16def0e375f6e190870b2d20ac50ad834d8e3

tdf#157168 GtkSpinButton ignores out-of-range value instead of limiting

It will be available in 7.5.8.

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 6 Commit Notification 2023-09-25 10:18:27 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/d7443d6a3191e37e1e2ad2f2f2d9310e0198b9bf

tdf#157168 GtkSpinButton ignores out-of-range value instead of limiting

It will be available in 7.6.3.

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 7 Stéphane Guillou (stragu) 2023-09-27 17:38:38 UTC
Fix verified in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 2902ab24ecc5ffbf4907ea83b2028508b9de6364
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Seems to actually have fixed more than the gtk issue, now even with the gen VCL plugin the box doesn't go beyond the page edge...
Big improvement over 7.4, thanks Caolán!