rspreadsheet icon indicating copy to clipboard operation
rspreadsheet copied to clipboard

rewriting cell addresses in formulas when inserting rows / cells

Open gorn opened this issue 4 years ago • 1 comments

This idea might very well be out of the scope of any gem like this, but I put it here for discussion. Currently the gem touches the original file only as less as necessarry. This for example means, that if I insert a row, all other rows after it are pushed down, but no formulas are influenced. This can possibly lead to unexpected results if any cells contain adresses to other cells. Open/LibreOffice deals with the same thing by implementing very sophisticated rewriting of cell adresses in such cases. It might sound natural to work with it, but I am sure that the logic behind is complex. The question is wheter it is even worth of trying to implement something like this.

Note that if you work with spreadsheets without any formulas, than there is no problem at all. Generally it really depends on how the gem is used. In most cases the formulas are not neededed as the values can be precalculated in ruby and then inserted as value only. I am curious about any opinions regarding this.

gorn avatar Sep 26 '19 21:09 gorn

Sounds useful, given the discussion of #45.

I wonder if DocumentBuilder of OnlyOffice could recalculate https://www.onlyoffice.com/document-builder.aspx ?

vtamara avatar Sep 27 '19 08:09 vtamara