Bug 55413

Summary: broken formulas and extra line added after saving in 3.6.2, closing and re-opening a spreadsheet; regression from LibO 3.5
Product: LibreOffice Reporter: James Stirling <james>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: critical CC: erack, kohei, markus.mohrhard, nopower, pmladek
Priority: highest    
Version: 3.6.2.2 release   
Hardware: x86-64 (AMD64)   
OS: Windows (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: The enclosed document is an example of what happens when opening a document and re-saving in LibreOffice 3.6.x
This attachement shows the worksheet openen in 3.6, then saved and re-opened
Attachement of the spreadsheet after an open and save in 3.5 then re-open and re-save in 3.6
After a re-save in 3.6 seems to have gained some lines
File before save as, this file contains the correct line locations

Description James Stirling 2012-09-28 12:22:57 UTC
I open a complex workbook with 21 spreadsheets liked to each other with formulas and it opens and works in LibreOffice 3.5.6. I can save, close and re-open with no problems.

When work on the the same workbook in LibreOffice 3.6.2, save it, close it and re-open the same document a number of the formulas change as an extra line is added into the sheets during the save/open process.

This breaks all the relative referencing in the cells and looks like an extra line has been added.

This makes the 3.6.2 update useless.
Comment 1 Markus Mohrhard 2012-09-30 21:36:14 UTC
Could you please attach a test document showing the issue?
Comment 2 James Stirling 2012-10-01 20:06:08 UTC
Created attachment 67945 [details]
The enclosed document is an example of what happens when opening a document and re-saving in LibreOffice 3.6.x

I have found this problem exists in 3.6.1 and 3.6.2
I have not tested this in 3.6.0.

The problem does not exist in 3.5.6 and I can open the same spreadsheet and it does not add an extra line close the the top of the sheet.

I removed many sheets in the workbook and the problem is still present.
I plan to try removing more data to see if any other factors are a cause.
Comment 3 Markus Mohrhard 2012-10-01 20:15:15 UTC
This is a drawing file and not a calc file. Are you maybe talking about a problem inside draw or impress?
Comment 4 James Stirling 2012-10-01 20:37:14 UTC
Created attachment 67948 [details]
This attachement shows the worksheet openen in 3.6, then saved and re-opened

The following attachment shows a sheet opening in 3.6 saved under a different file name and then re-opened. 

It adds and extra line in the spreadsheet and line 33.
Comment 5 Markus Mohrhard 2012-10-01 20:46:39 UTC
This is still a odg file! IF you want to save a calc file use ODS and not ODG.
Comment 6 James Stirling 2012-10-01 20:49:11 UTC
Comment on attachment 67948 [details]
This attachement shows the worksheet openen in 3.6, then saved and re-opened

By adding comments to line 33 and line 34 seems to stop the addition of an extra line at 32. I wonder if some has damaged the file causing the erratic behavior
Comment 7 James Stirling 2012-10-01 20:59:25 UTC
Created attachment 67950 [details]
Attachement of the spreadsheet after an open and save in 3.5 then re-open and re-save in 3.6

This the spreadsheet that will open fine and line 33 is the word Name, after opening and saving in 3.6 the word name is now on line 36.
Comment 8 James Stirling 2012-10-01 21:01:31 UTC
Created attachment 67951 [details]
After a re-save in 3.6 seems to have gained some lines

This is the after saving in 3.6 Name is now on line 36 the only change was open and save with different name.
Comment 9 James Stirling 2012-10-01 21:09:14 UTC
Changing the contents of Cells A31, A32, A33 and A34 seemed to solve the problem.
Just testing this on the main document with the work-around.
Comment 10 James Stirling 2012-10-01 21:15:28 UTC
Yep, that worked. Something in the spreadsheet caused LibreOffice to think that an extra line existed somewhere between line 32 and line 35.
Comment 11 James Stirling 2012-10-01 21:33:38 UTC
and when I remove the comments in row 32 and row 33 the problem comes back and an extra line is added at row 32.

This just rather random but reproducible.

I will leave using LibreOffice 3.6.x as this will cause problems.
Comment 12 James Stirling 2012-10-01 21:37:34 UTC
In LibreOffice 3.6.1.2.
Create a new spreadsheet.

Fill rows 2 to 15 with a series starting with 35 and going up to 50.
Insert a row and keep inserting rows until the number 35 is on row 35.
Save the sheet and close it.

Re-open the sheet, the number 35 is now on row 37.

Now that is a problem.
Comment 13 realyst 2012-10-10 09:33:17 UTC
Just followed the way to repoduce the problem as described in comment 12 in LibreOffice version 3.6.2.2.

After reopen the file there was not added an extra line.
So maybe this issue is solved now?
Comment 14 James Stirling 2012-10-10 19:55:21 UTC
I have downloaded and test 3.6.2 and the issue is still present.

Open the original file and save it with a different file name then open the new file the extra line is still added creating a problem with the formulas in the spreadsheet.

Release 3.6.2 does not solve the problem.

Thanks for the update.
Comment 15 James Stirling 2012-10-10 20:03:20 UTC
I have re-tested the method used and can not reproduce the problem.

I can open the spreadsheet uploaded save it with a different name and reproduce the problem.

Comment 8 contains a spreadsheet with the problem.

If you could please review this is may help isolate the problem.

Thanks
Comment 16 James Stirling 2012-10-10 20:07:31 UTC
Created attachment 68420 [details]
File before save as, this file contains the correct line locations

The file is the file version saved in 3.5 without an extra line.
Comment 17 realyst 2012-10-11 15:41:56 UTC
The attachment in comment 8 seems to be a broken file 

check filteype with file
----------------
file Pricing\ 2012\ J6.ods
Pricing 2012 J6.ods: XML  document text

check integrity with zip :
----------------
zip -T Pricing\ 2012\ J6.ods
        zip warning: expected 16 entries but found 13

zip error: Zip file structure invalid (Pricing 2012 J6.ods)


-> Trying to open this file opens the dialog for textimport.
So I can not do any more testing with this file.
Comment 18 realyst 2012-10-11 15:48:19 UTC
After saving the attachment in comment 16 with a new name and reopend the file I can reproduce the problem.

BUT : After deleting the comment in cell D-31 and saving with a new name and reopening the new file there are no extra lines and everything is fine.

So it seems the comment causes the problem.
Comment 19 James Stirling 2012-10-11 22:15:18 UTC
I can confirm that deleting the comment solves the problem.
Showing it, changing it is not enough.

Adding a comment on row 31 (tested on column A,B C,D) seems to be an issue.
Adding a comment on row 32 does not cause a problem.
How did you discover this as a solution?
Comment 20 Petr Mladek 2012-10-23 16:19:20 UTC
Thanks for nailing this down. Comment #18 is useful to reproduce and even fix this problem.

It is a nasty bug and I hope that we will fix it soon. Well, I am not aware of other similar bugs, so it looks like less typical scenario. The bug was already in older 3.6.x releases => we should not block 3.6.3 with other useful fixes => lowering the severity a bit. I hope that we could fix this for 3.6.4 because it is regression and potential data loss.
Comment 21 Eike Rathke 2013-12-13 11:41:01 UTC
Whatever it was, it appears to be fixed, tried in 4-1 and 4-2.