Bug 38199 - Writer EDITING: Why when I press tab in read-only mode, then the document scrolls to top?
Summary: Writer EDITING: Why when I press tab in read-only mode, then the document scr...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.1.2 release
Hardware: x86 (IA32) All
: medium minor
Assignee: Jim Raykowski
URL:
Whiteboard: target:6.4.0
Keywords:
Depends on:
Blocks: Writer-View-Jumps Read-Only Tab-Character
  Show dependency treegraph
 
Reported: 2011-06-11 21:09 UTC by Bachue
Modified: 2019-11-07 09:00 UTC (History)
5 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 Bachue 2011-06-11 21:09:52 UTC
I always press tab by accident, and the document scroll to top. I think it is abnormal.
Comment 1 Björn Michaelsen 2011-12-23 12:28:43 UTC Comment hidden (obsolete)
Comment 2 Florian Reisinger 2012-08-14 14:03:58 UTC Comment hidden (obsolete)
Comment 3 Florian Reisinger 2012-08-14 14:04:52 UTC Comment hidden (obsolete)
Comment 4 Florian Reisinger 2012-08-14 14:09:20 UTC Comment hidden (obsolete)
Comment 5 Florian Reisinger 2012-08-14 14:11:20 UTC Comment hidden (obsolete)
Comment 6 sasha.libreoffice 2012-09-12 15:29:40 UTC
reproduced in 3.6.1 on Fedora 64 bit
To reproduce: open read-only document, scroll it some pages, press Tab
To create such document use File->Properties, tab "Security", enable "Open file read only", press Ok, then File->Reload.
Comment 7 sophie 2014-12-31 13:26:40 UTC
Hi, still present in Version: 4.3.4.1
Build ID: bc356b2f991740509f321d70e4512a6a54c5f243 Ubuntu 14.10 - Sophie
Comment 8 QA Administrators 2016-01-17 20:04:44 UTC Comment hidden (obsolete)
Comment 9 QA Administrators 2017-03-06 14:30:01 UTC Comment hidden (obsolete)
Comment 10 Telesto 2017-04-27 12:59:56 UTC
Confirming with:
Version: 5.4.0.0.alpha0+
Build ID: a917902c48f21d04039da86048c5c36555137d7e
CPU threads: 4; OS: Windows 6.2; UI render: default; 
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2017-04-24_23:35:22
Comment 11 Harald Koester 2018-06-29 09:28:38 UTC
If hyperlinks are inserted in your document, the behaviour is different: Press tab jumps to the next occurence of a hyperlink. May be this is intended. But then it is not obvious at all and it's not documented in the help. For me this is buggy as well.
Comment 12 Jim Raykowski 2018-10-01 06:52:03 UTC
Hi All, 

Currently key input action for read only mode is defined at:
https://opengrok.libreoffice.org/xref/core/sw/source/uibase/docvw/edtwin.cxx#2162

Harald is correct about hyperlinks being traversed. This is the default action if one of two conditions for tab key action in read only mode are not met.

First a check is made to determine if a Graphic, Frame, Ole, DrawObject, or DbForm object is selected. If so, tab/shift tab will move to the next/previous object of these types.

Second a check is made to determine if there is no multiselection and if the cursor is inside and input field. If so, tab/shift tab will move to the next/previous input field.

I tested the first check by: 
1) inserting some shapes and frames into a document
2) saving the document
3) setting the document in read only mode
4) selecting a shape 
5) pressing tab to moved to the next shape or frame.

I did not test the second check when an input field is selected.
Comment 13 QA Administrators 2019-10-02 02:55:50 UTC Comment hidden (obsolete)
Comment 14 Harald Koester 2019-10-21 12:47:45 UTC
Bug checked again with version 6.3.2 (Win7, 64 bit). Bug still exists respective descriptions in Comment 0 (jump to top), comment 11 (jump to next hyperlink) and comment 12 (jump to next shape.)
Comment 15 Jim Raykowski 2019-11-02 22:33:45 UTC
When viewing a document in readonly mode the action of the tab key is to
move among Graphic, Frame, Ole, DrawObject, or DbForm if one these is
already selected. If the cursor is inside an input field and has no multi
selection then move among InputFields. Finally if neither the previous
two cases apply then move among Hyperlinks which causes cursor position
to move to top or bottom of the document when no Hyperlink is found.

Here is a link to a patch that does not scroll when all three search cases are not found:

https://gerrit.libreoffice.org/#/c/81955/
Comment 16 Commit Notification 2019-11-06 23:59:17 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/25c390e17a7f1c018b5eed1ef7dfd568b76f4a84

tdf#38199 Readonly mode tab key: Don't scroll if no hyperlink found

It will be available in 6.4.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.