Bug 132466 - jump to a sheet named "C" not possible
Summary: jump to a sheet named "C" not possible
Status: CLOSED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.0.3 release
Hardware: All All
: medium minor
Assignee: Eike Rathke
URL:
Whiteboard: target:7.4.0 target:7.3.0.0.beta2
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2020-04-27 16:44 UTC by Oliver Brinzing
Modified: 2021-12-15 17:57 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
jumpToSheet Example (8.34 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-04-27 16:44 UTC, Oliver Brinzing
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Brinzing 2020-04-27 16:44:34 UTC
Created attachment 160003 [details]
jumpToSheet Example

steps to reproduce:
- open attached document
- press [jump to sheet "B"]
- sheet "B" is visible
- press [jump to sheet "C"]
- column A is selected instead

reproducible with:

Version: 5.4.7.2 (x64)
Build-ID: c838ef25c16710f8838b1faec480ebba495259d0
CPU-Threads: 4; BS: Windows 6.19; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: single

recent LO 7.0 master

but *not* reproducible with

Version: 4.4.7.2
Build-ID: f3153a8b245191196a4b6b9abd1d0da16eead600
Gebietsschema: de_DE
Comment 1 Ming Hua 2020-04-27 18:43:35 UTC
Reproduced in 5.2.7 with the attached example:

Version: 5.2.7.2 (x64)
Build ID: 2b7f1e640c46ceb28adf43ee075a6e8b8439ed10
CPU Threads: 2; OS Version: Windows 6.19; UI Render: default; 
Locale: zh-CN (zh_CN); Calc: group

Bibisect request?
Comment 2 Aron Budea 2020-04-27 19:50:29 UTC
Further narrowing down, it's buggy in 5.1.0.3, fine in in 5.0.0.5.
Can probably be bibisected on Windows, there's no bibisect repo for 5.1 on Linux.
Comment 3 Attila Baraksó (NISZ) 2020-04-28 07:08:53 UTC
Bibisected using bibisect-win32-5.1 to:
URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=106a4dc29980889c02faa526e5417b63fdce6c23
author: Markus Mohrhard <markus.mohrhard@googlemail.com>
committer: Markus Mohrhard <markus.mohrhard@googlemail.com>
summary: support R1C1 reference for hyperlinks

Adding Cc: Markus Mohrhard
Comment 4 Justin L 2021-12-02 11:38:01 UTC
JUMP TO B
sc/source/ui/view/tabvwsh3.cxx:128: ::try the Excel range A1 range convention result[0] if valid[0]
sc/source/ui/view/tabvwsh3.cxx:137: --- address convention result[0] if valid[0]
sc/source/ui/view/tabvwsh3.cxx:146: --- R1C1 range convention result[0] if valid[0]
sc/source/ui/view/tabvwsh3.cxx:154: --R1C1 address convention result[0] if valid[0]

JUMP TO C
sc/source/ui/view/tabvwsh3.cxx:128: ::try the Excel range A1 range convention result[0] if valid[0]
sc/source/ui/view/tabvwsh3.cxx:137: --- address convention result[0] if valid[0]
sc/source/ui/view/tabvwsh3.cxx:146: --- R1C1 range convention result[63266] if valid[1]
Comment 5 Justin L 2021-12-07 11:39:54 UTC
sc/source/core/tool/address.cxx lcl_ScRange_Parse_XL_R1C1

There are two special consonants: C and R for Column and Row. It seems like this is a valid address for SID_JUMPTOMARK, so I'm guessing there isn't much that can be done about this.
Comment 6 Ming Hua 2021-12-07 12:17:02 UTC
(In reply to Justin L from comment #5)
> sc/source/core/tool/address.cxx lcl_ScRange_Parse_XL_R1C1
> 
> There are two special consonants: C and R for Column and Row. It seems like
> this is a valid address for SID_JUMPTOMARK, so I'm guessing there isn't much
> that can be done about this.
The attached sample uses "Calc A1" formula syntax.

Is it possible to disable this attempt of parsing addresses in R1C1 syntax unless it is explicitly specified?
Comment 7 Eike Rathke 2021-12-07 20:59:20 UTC
"explicitly specified" how? There's just a hyperlink anchor target name that happens to look like a reference in the R1C1 notation, which we want to support regardless what the current actual reference syntax is.

Something similar would happen if you named a sheet A1 and wanted to jump there.

However, a plain C isn't a valid reference for the entire column 0, as if it was written C0, at least that is what's getting selected for the example. Au contraire, a plain C would indicate "this same column" in conjunction with a Ry row number.

That seems to be the underlying bug in *this* case.

I'll investigate.
Comment 8 Eike Rathke 2021-12-08 11:38:29 UTC
So, in R1C1 reference syntax C is a short notation for C[0] the same column as relative reference, or here the column of the current cell cursor position.
Comment 9 Commit Notification 2021-12-08 11:40:28 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/155024040de888270bf90bdd200799cea7d73e4e

Related: tdf#132466 Relative address parsing needs current position

It will be available in 7.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.
Comment 10 Eike Rathke 2021-12-08 11:58:05 UTC
There's no really satisfying way to cater for this ambiguous case of wanting to jump to a sheet being named the same as a valid cell reference or vice versa. However, there's always the workaround to specify a cell address along with the sheet name, like #C.A1

Closing as wontfix.
Comment 11 Eike Rathke 2021-12-15 17:57:42 UTC
Fwiw, above commit also on libreoffice-7-3
https://git.libreoffice.org/core/+/364c807cf22de7898e918a9cd1fa7e5392ca7577
for 7.3.0.0.beta2