Bug 148163 - #REF! in incorrect references
Summary: #REF! in incorrect references
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4 all versions
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.4.0 target:7.3.5
Keywords: bibisected, regression
Depends on:
Blocks:
 
Reported: 2022-03-24 17:36 UTC by Xisco Faulí
Modified: 2022-06-07 17:23 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 Xisco Faulí 2022-03-24 17:36:56 UTC
I found this issue when I tried to create a unittest for tdf#46338.

In https://cgit.freedesktop.org/libreoffice/core/commit/?id=1135bfd78802e5c40ca09bcbc75d0908a423872a

The behaviour was changed to show #NAME for invalid references ( e.g =SheetX.A1 )
However, in master Calc shows #REF! ( the old behaviour )

Reproduced in

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 4a46a74a3de0ac7df5d3ce949dda5e809c1729ab
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

and

Version: 6.3.0.0.alpha1+
Build ID: c98b1f1cd43b3e109bcaf6324ef2d1f449b34099
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3; 
Locale: es-ES (es_ES.UTF-8); UI-Language: en-US
Calc: threaded

but not in

Version: 6.1.7.0.0+
Build ID: 5b3765f4d881e7ddefd0c4aad6886a46f000b4fc
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3; 
Locale: es-ES (es_ES.UTF-8); Calc: group threaded
Comment 1 Xisco Faulí 2022-03-24 17:37:41 UTC
@Eike, since you fixed bug 46338, I thought you might be interested in this issue
Comment 2 Aron Budea 2022-03-29 03:46:25 UTC
(In reply to Xisco Faulí from comment #0)
> but not in
> 
> Version: 6.1.7.0.0+
For some reason I could repro this back to 4.2, and bibisecting with bibisect-42max points to the following commit:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=e247262327d04ad9933f4af354050f4420c6e303
author		Kohei Yoshida <kohei.yoshida@gmail.com>	2013-07-26 00:41:07 -0400
committer	Kohei Yoshida <kohei.yoshida@gmail.com>	2013-07-30 23:49:55 -0400

More on avoiding direct access to data members.
Comment 3 Eike Rathke 2022-04-08 14:15:56 UTC
I might take a look..

(clarification: input of invalid sheet reference like =SheetX.A1 correctly results in #REF! error but reference in formula is (technically correct from how references work) also changed to =#REF!.A1 instead of preserving the original input, which originally the fix of bug 46338 addressed).
Comment 4 Eike Rathke 2022-06-06 14:55:04 UTC
Fwiw, sc/qa/unit/ucalc_formula.cxx already indirectly tests the behaviour, which now changes with
https://gerrit.libreoffice.org/c/core/+/135453/1/sc/qa/unit/ucalc_formula.cxx
Comment 5 Commit Notification 2022-06-06 14:56:14 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/104596d005b32bd2bba15554e8c9ae740327aa46

Resolves: tdf#148163 Preserve names of bad cell reference input again

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 6 Commit Notification 2022-06-07 17:23:06 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

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

Resolves: tdf#148163 Preserve names of bad cell reference input again

It will be available in 7.3.5.

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.