Created attachment 125898 [details] Tes file to copy global local named expressions https://wiki.documentfoundation.org/ReleaseNotes/5.2#Copying_named_expressions_and_ranges_while_copying_sheets IMO when a sheet is copied to a new one, shouldn't create a copy of named expressions having global scope to one with local scope. Name Expression Scope global $Sheet1.$A$1 Document (Global) global $NewSheet.$A$1 NewSheet XXXXXXXXXXXX -> not create global_global global*100 Document (Global) global_global global*100 NewSheet XXXXXXXXXXXX -> not create global_local Sheet1.local*1000 Document (Global) global_local local*1000 NewSheet XXXXXXXXXXXX -> not create local $Sheet1.$A$2 Sheet1 local $NewSheet.$A$2 NewSheet local_global global*10000 Sheet1 local_global global*10000 NewSheet local_local Sheet1.local*100000 Sheet1 local_local local*100000 NewSheet global $NewSheet.$A$1 NewSheet global_global global*100 NewSheet global_local local*1000 NewSheet Having a formula that has a named expression with global scope, what I expect when the cell is copied, is the references to the named expression (global) remaining without change, like happens doing an ordinary copy of cells between sheets. I don't think it's fine allowing global and local expressions with the same name
I confirm with Build ID: 91f2f71e7b936c3c9fb984aaa01d432926abb38f on Linux 64 bits.
Sorry, why highest and critical?
(In reply to m.a.riosv from comment #2) > Sorry, why highest and critical? Because it is impossible to use old spreadsheets using two kinds of names with the new version. In 5.1.4 they is a way to use old syntax : without sheet name prefix for local et with sheet name prefix for global, both define as global. I do not know how to do the same thing with the new feature as it is working. However, new feature is good if it works fine.
(In reply to royerjy from comment #3) Could you elaborate? A name with sheet prefix was not possible before 5.2, neither for global names nor for local names.
(In reply to m.a.riosv from comment #0) > IMO when a sheet is copied to a new one, shouldn't create a copy of named > expressions having global scope to one with local scope. Note that a global name is only copied to a local name if it references the same sheet that you are copying. This is because you're duplicating also the data it references. > I don't think it's fine allowing global and local expressions with the same > name That's perfectly fine and also allowed in other spreadsheet applications.
Actually there's no bug.
(In reply to Eike Rathke from comment #5) > (In reply to m.a.riosv from comment #0) > > IMO when a sheet is copied to a new one, shouldn't create a copy of named > > expressions having global scope to one with local scope. > > Note that a global name is only copied to a local name if it references the > same sheet that you are copying. This is because you're duplicating also the > data it references. I think I understand how it does, but if I want that behavior I can set the NamExp as local, so local is copied as local. But global copied as local, sorry I can't agree. > > > I don't think it's fine allowing global and local expressions with the same > > name > > That's perfectly fine and also allowed in other spreadsheet applications. IMHO only a source of mistakes.
(In reply to m.a.riosv from comment #7) > (In reply to Eike Rathke from comment #5) > > (In reply to m.a.riosv from comment #0) > > > IMO when a sheet is copied to a new one, shouldn't create a copy of named > > > expressions having global scope to one with local scope. > > > > Note that a global name is only copied to a local name if it references the > > same sheet that you are copying. This is because you're duplicating also the > > data it references. > > I think I understand how it does, but if I want that behavior I can set the > NamExp as local, so local is copied as local. But global copied as local, > sorry I can't agree. > > > > > > I don't think it's fine allowing global and local expressions with the same > > > name > > > > That's perfectly fine and also allowed in other spreadsheet applications. > > IMHO only a source of mistakes. I agree with all m.a.riosv remarks. How can we use names in macros with this behaviour ? May be is it necessary to adopt new rules, like : never, never, create global and local names in a sheet witch has to be copied ? Is that already explain somewhere ? In this case, an alert would be helpful when copying a global name. Global names must be created only in special sheets or directly in names.