Bug 39820 - Copying cells corrupts named range list
Summary: Copying cells corrupts named range list
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.4.1 release
Hardware: Other All
: medium major
Assignee: Markus Mohrhard
URL:
Whiteboard: target:3.5
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-03 19:06 UTC by James
Modified: 2011-12-23 15:46 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Source spreadsheet to copy/paste from (7.21 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-08-03 19:08 UTC, James
Details
Target spreadsheet to paste to (7.19 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-08-03 19:08 UTC, James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James 2011-08-03 19:06:59 UTC
I have attached two spreadsheets, Source and Target. They differ in only one respect:

Target has a named range called NamedRange local to Sheet1
Source has a named range called NamedRange both local to Sheet1 *and* global.
All of these ranges have the same definition.

Open both spreadsheets.
In Source, select and copy all of Sheet1 using Ctrl-A/Ctrl-C.
In Target, copy that selection onto cell R1C1 of Sheet1.

You will see that Target, previously having no global named ranges, now has a global named range called NamedRange. Since named range definitions are not one of the things that (so far as I know) are supposed to be copied when cells are copied, this behavior is unexpected.




in some cases that I cannot reliably reproduce, the target spreadsheet will suffer data corruption upon paste when the source spreadsheet contains a global named range that has the same name as a local named range (on any sheet) on the target. Primarily, this results in named range references being turned into other named ranges. For example, after pasting a formula that referenced range X now references range Y, with predictably bizarre results (usually either a bogus value or #VALUE errors). Turning a references to range X into a #NAME error is also common, even though the source and target both share the same definition of X.
Comment 1 James 2011-08-03 19:08:00 UTC
Created attachment 49895 [details]
Source spreadsheet to copy/paste from
Comment 2 James 2011-08-03 19:08:30 UTC
Created attachment 49896 [details]
Target spreadsheet to paste to
Comment 3 Rainer Bielefeld Retired 2011-08-04 01:26:23 UTC
[Reproducible] with reporters test kit and "LibreOffice 3.4.2  - WIN7  Home Premium (64bit) German UI [OOO340m1 (Build:203)]" .

So OS -> All

I see the same with LibO 3.4.1RC daily build, so I modify Version


Problem appears only if target document has a local range name with same spelling as global range in source document.

The problem also appears with 'Paste Special' and only "Text" checked (but not using Toolbar icon 'Paste - Unformatted Text).

@Kohei:
Please feel free to reassign if it’s not your area or if provided information is not sufficient. Please set Status to ASSIGNED if you accept this Bug.
Comment 4 m_a_riosv 2011-08-04 16:01:56 UTC
Where is the bug?
If you select "all", the right it's copy all range names in the source, global or not.
Comment 5 Jeffrey 2011-08-04 19:20:18 UTC
Reproduced on LibreOffice 3.4  340m1(Build:103) for OpenSuse Linux.
Comment 6 Markus Mohrhard 2011-08-05 11:52:56 UTC
let me have a look at it
Comment 7 Markus Mohrhard 2011-08-07 18:38:52 UTC
removing target 3.4.3: this won't be an easy change so no chance to include this in the stable branch, I will think about a solution for the 3.5 release

Problem is in our named range handling in formulas.
Comment 8 Markus Mohrhard 2011-08-15 23:25:06 UTC
might have a solution that is acceptable for 3-4, have send the patch to the ML for review
Comment 9 Markus Mohrhard 2011-08-25 05:38:48 UTC
will be fixed in 3-5 but not in the stable 3-4 branch