Bug 79578 - UPDATING DATA RANGES Destroys Formulas
Summary: UPDATING DATA RANGES Destroys Formulas
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.2.4.2 release
Hardware: Other All
: medium major
Assignee: Kohei Yoshida
URL:
Whiteboard: target:4.4.0 target:4.3.1 target:4.2.7
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-03 09:17 UTC by Nikos
Modified: 2014-07-30 15:09 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
problematic (648.97 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-06-03 10:57 UTC, Nikos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos 2014-06-03 09:17:00 UTC
Go to sheet "Zuordnungen"
Note the functions in cells E9,F9
Select rows 30-33, rightclick, insert rows above
Copy cells E29:Z29 into the new empty cells E30:Z33 (note that the range was not updated)
Select Menu Data-->Define range-->Zuordnungen-->$Zuordnungen.$A$6:$T$2516-->modify-->OK
The functions in columns E,G,I are destroyed.
Closing the document without saving crashes Libreoffice

This is a really nasty bug, I have observed it in all the 4.2 series. Since it seems reproducible in 4.3 beta and I need these types of files to work, I tried submitting a file with not too much private info.
Comment 1 Cor Nouws 2014-06-03 09:55:16 UTC
Hi Nikos,

Can you pls attach your test document?
thanks,
Cor
Comment 2 Nikos 2014-06-03 10:57:06 UTC
Created attachment 100349 [details]
problematic

Sorry..thought I had
Comment 3 Eike Rathke 2014-06-04 13:15:09 UTC
This is giving me hard times. I can reproduce also in current master, in a dbg-util build a crash happens already after the step when having confirmed the Data-Define-Range dialog with OK. Involved is a corrupted FormulaTokenArray, bad memory passed from ScFormulaCell::pCode to ScInterpreter ctor, then accessed by  FormulaTokenIterator, and as if that wasn't enough it happens during the nasty ScCompiler::IsColRowName() check. So far I suspect this to be related to shared formulas.
Comment 4 Nikos 2014-07-05 12:31:17 UTC
Hello,

just wanted to ask if there is anything new on this (I can imagine it is not the simplest task).

Just retried it on LibreOffice 4.3.0RC2 openSUSE 64bit and the only difference to my prior experience (on 4.3 beta win) is that it crashes already after the step when having confirmed the Data-Define-Range dialog with OK (as Eike Rathke already observed).

Thank you for your efforts, and an otherwise great program.
Comment 5 Kohei Yoshida 2014-07-28 14:28:51 UTC
Finally found some time to get to this.  I'll be looking into it.
Comment 6 Commit Notification 2014-07-29 02:14:32 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a0b9200eed928ac81d798bd59aed69ed6d470bac

fdo#79578: Write test for this first.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2014-07-29 02:14:47 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=300845922eec7a28bc1da337acd21f138685d759

fdo#79578: Properly update formulas upon change in db collection.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Kohei Yoshida 2014-07-29 04:09:14 UTC
Fixed on master.
Comment 9 Commit Notification 2014-07-29 08:28:37 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=217d0ed1cdb492def7220859ecb4931d90d8022c&h=libreoffice-4-3

fdo#79578: Properly update formulas upon change in db collection.


It will be available in LibreOffice 4.3.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2014-07-29 09:25:03 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=155af162b260ee49e1c6603baa2c2a96d6e93b67&h=libreoffice-4-2

fdo#79578: Properly update formulas upon change in db collection.


It will be available in LibreOffice 4.2.7.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Nikos 2014-07-30 15:09:58 UTC
Thank you!

I have not come to test it (will have to wait for a week or two), but I really appreciate your work.