Bug 146273 - "Go To" control in Navigator must not accept other than numeric values
Summary: "Go To" control in Navigator must not accept other than numeric values
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.8.1 release
Hardware: All All
: medium trivial
Assignee: Matt K
URL:
Whiteboard: target:24.2.0
Keywords: easyHack, skillDebug, topicUI
Depends on:
Blocks: Navigator
  Show dependency treegraph
 
Reported: 2021-12-16 16:42 UTC by goodguy00@zoho.com
Modified: 2023-08-13 14:38 UTC (History)
4 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 goodguy00@zoho.com 2021-12-16 16:42:34 UTC
Description:
inconsistent data entry between navigator (F5) page entry field (=A) and the page dialog (left lower corner - click, popup =B):
- going to the last page by '$':
 allowed in A, jumps correctly to last page, but incorrectly shows page '1'
 not allowed in B, non-number entries always show '1'
- going to last page by entering a number beyond end:
 in A, input accepted and after <cr> jumps correctly to last page, showing correctly the number of the last page
 in B, immediately translates input to last number, handles properly


Steps to Reproduce:
s. description

Actual Results:
s. description

Expected Results:
-> in my opinion, A and B should show correct last page number, accept '$' for the last page and behave the same way.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.2.4.1 / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-CH (en_US.UTF-8); UI: en-US
Comment 1 LeroyG 2021-12-16 21:09:34 UTC
"$" in the Go to Page field and Enter, makes the cursor jump to the start (upper left) of the last page; but if do you do "$" Enter again, the cursor jumps to the start (upper left) of the first page.

And instead of "$": "·", "%", "ç", uppercase characters, """, etc.
With lowercase characters it behaves a bit erratically.

Version: 7.1.8.1 / LibreOffice Community
Build ID: e1f30c802c3269a1d052614453f260e49458c82c
CPU threads: 1; OS: Linux 4.12; UI render: default; VCL: x11
Locale: es-MX (es_AR.UTF-8); UI: en-US
Calc: threaded
Comment 2 Rainer Bielefeld Retired 2021-12-17 16:00:57 UTC
REPRODUCIBLE with  Installation of Version 7.2.4.1 (x64) / LibreOffice 
Build  27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win; Locale: de-DE (de_DE); UI: de-DE; Calc: threaded;  Elementary Theme; My normal User Profile
Navigator accepts non numeric characters, page navigation dialog does not.

UX should decide which is correct behavior. My opinion: reject non numerics.

Indeed, I would expect consistent behavior.

4.0.0 did not accept non numeric characters
Comment 3 goodguy00@zoho.com 2021-12-18 10:43:24 UTC
personally, i would prefer at least the '$' for last page.
Comment 4 Buovjaga 2022-11-25 12:45:07 UTC
(In reply to Rainer Bielefeld Retired from comment #2)
> REPRODUCIBLE with  Installation of Version 7.2.4.1 (x64) / LibreOffice 
> Build  27d75539669ac387bb498e35313b970b7fe9c4f9
> CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL:
> win; Locale: de-DE (de_DE); UI: de-DE; Calc: threaded;  Elementary Theme; My
> normal User Profile
> Navigator accepts non numeric characters, page navigation dialog does not.
> 
> UX should decide which is correct behavior. My opinion: reject non numerics.
> 
> Indeed, I would expect consistent behavior.
> 
> 4.0.0 did not accept non numeric characters
Comment 5 Dieter 2022-11-25 13:26:30 UTC
Not sure about the meaning of comment 4, but I confirm behaviour with

Version: 7.4.3.2 (x64) / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

So clearly a bug and design-team should decide about solution.
Comment 6 Heiko Tietze 2022-11-28 15:47:48 UTC
The numerical spin edit fields are not meant for some cryptic vi-like commands. Having $ jumping to the last value is just a fortuitous result. So I agree with Rainer to accept only numbers in the Navigator field.

The "Go-To-Page" dialog works as expected.

Code pointer: 

sw/uiconfig/swriter/ui/navigatorpanel.ui uses a GtkAdjustment and code in sw/source/uibase/utlui/navipi.cxx does m_xEdit->set_max(nPageCnt); as I'd expect. Needs some debugging...
Comment 7 Matt K 2023-07-07 07:18:09 UTC
Fix located at https://gerrit.libreoffice.org/c/core/+/154156.  Added Heiko to the review.
Comment 8 Commit Notification 2023-07-10 14:42:09 UTC
Matt K committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7019eef453954785ad039bebd8c8a00183992584

tdf#146273 Do not allow non-numeric values for Navigator "Go to"

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 9 Dieter 2023-08-13 14:38:30 UTC
VERIFIED with

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e25e27c85ed970cdb97c468bdac86c80964f4231
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded

Matt, thanks for fixing it!

Actual result: non-numeric value is replaced by "1"