Bug 137896 - Insert -> Named Range or Expression, pastes sheet-local scoped names without sheet prefix
Summary: Insert -> Named Range or Expression, pastes sheet-local scoped names without ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-31 10:36 UTC by Jerzy Moruś
Modified: 2020-11-04 10:15 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 Jerzy Moruś 2020-10-31 10:36:54 UTC
Is this an extra property or a bug?
In Calc is possibility defining a names with local scope, only for one sheet. The name may be use only in this sheet (?).
But is possibility use this name in any sheets when the name will be preceeded by by sheet's name. 
For example if name ABC is defined in AAA sheet as local, may be used in another sheet by write AAA.ABC e.g =124+AAA.ABC or INDEX(AAA.ABC;1;1). 
If write the local name with name of sheet, then name of sheet is automatically removed when this name was placed to  her own scope.
It is good news.
But this name not could be use in INDIRECT function. INDIRECT("AAA.ABC") generate #REF! error and e.g formula INDEX(INDIRECT("AAA.ABC");1;1) is not calculate.
 Also is not possibility inserting the name by "Insert -> Named Range or Expression" in another sheet then this who have definition local name.
If first part of my post is true (is the extra property), then would be good  should remove the imperfections described in the second part.
Comment 1 Eike Rathke 2020-10-31 11:15:12 UTC
> If write the local name with name of sheet, then name of sheet is automatically removed
Only when used on the same sheet where it is defined, using the name on another sheet displays the sheet scope.

For INDIRECT() that's just implemented against bug 100818.

Keeping this bug for the "Insert -> Named Range or Expression" part, which pastes a sheet-local name without the sheet prefix even if it originates from a different sheet.
Comment 2 Commit Notification 2020-10-31 20:31:43 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8720ccc3fb40a9e0df0b0c62d0854f744fa715f8

Resolves: tdf#137896 Paste sheet-local names with sheet name prefix

It will be available in 7.1.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 3 Commit Notification 2020-10-31 22:26:49 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5805a1d57c4a52566899b7fdaf88d6309056411e

Enquote sheet name if necessary, tdf#137896 follow-up

It will be available in 7.1.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 Commit Notification 2020-11-02 23:31:11 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#137896: sc: Add UItest

It will be available in 7.1.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 5 Xisco Faulí 2020-11-04 10:15:46 UTC
UItest added. Setting to VERIFIED.
@Eike, thanks for fixing this issue!!