GNOME Bugzilla – Bug 723600
Conflict between array formulas and merged ranges
Last modified: 2014-02-08 22:31:53 UTC
Created attachment 268048 [details] Problematic Gnumeric spreadsheet file, fails to load A spreadsheet file that had some calculations, merged cells and other basic formatting was created in Gnumeric-1.12.1. Then the file was saved with .gnumeric file extension. The file compression level was set to "0" in the program preferences in order to make the .gnumeric file easily readable. Afterwards, upon an attempt at re-opening this file, Gnumeric just showed an error message "Would split array G32:L35" and refused to load the spreadsheet file. I have found no way to open this spreadsheet document again. I have attached the problematic spreadsheet file. As a sidenote, if the uncompressed .gnumeric file is opened in a text editor and the following block is deleted/commented out, Gnumeric will accept and load the document again but it will lose all information related to cell merging. <gnm:MergedRegions> <gnm:Merge>G35:L35</gnm:Merge> <gnm:Merge>G34:L34</gnm:Merge> .... .... .... </gnm:MergedRegions>
Please note that you can open the file by just deleting: <gnm:Merge>G35:L35</gnm:Merge> <gnm:Merge>G34:L34</gnm:Merge> <gnm:Merge>G33:L33</gnm:Merge> <gnm:Merge>G32:L32</gnm:Merge> These collide with <gnm:Cell Row="31" Col="6" Rows="4" Cols="6">=E24:G27-AF24:AH27</gnm:Cell> It is not clear to me how you it happen that you have merged cells colliding with an array formula.
Here is a way to create a small sample file causing the same issue: Select A1:B1 and merge Select A1:C1 enter =pi() using ctrl-shift-enter save reopen: Would split array A1:C1 Interesting that nobody ever run into this before.
Confirming the recipe from comment 2. I note that if the two steps are swapped, the merge is not allowed. I am guessing we need to disallow the entry of the array formula in the recipe because it covers a merged range.
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report. Fixed in the sense that entry of arrays on top of merges is now prohibited in the same way as merging part an array already was. If you have any trouble reviving your files as outlined in comment 1, please let us know.
I'm very glad that my bug report was useful. As for the spreadsheet file, I managed to revive it by just commenting out the "MergedRegions" portion of the file with text editor and saving it into a new file.
I am not sure whether the error message presented when the user is trying to enter an array expression makes sense: Invalid Set Text: 'cannot operate on merged cells'