Make `Cell::setContent` use `unique_ptr` and
`make_unique` for expressions to avoid potential memory
leaks.
Also renames `expo` to `newExpr` to avoid mixup with the
member variable `expression`.
Both changes was made at the request of @chennes.
This commit only changes the user interaction with spreadsheet and does
not affect backwards compatibility (as valid cell expressions are
prefixed with '=' when serialized).
This fixes [#4156](https://tracker.freecadweb.org/view.php?id=4156),
which is discussed in the forum thread:
https://forum.freecadweb.org/viewtopic.php?f=3&t=39665
There has been additional logic added to handle numbers and simple
fractions without using '='.
The behaviour is what is expected by the spreadsheet test cases
and in line with how other spreadsheet software works.
The '-prefix can still be used to force the input to be handled as
as string instead.
Example of numbers and fractions handled are:
3
2mm
1/8
1mm/2
1/2mm
2/m
1mm/2s
More complex expressions are not handled without '=' and will be stored
as strings instead, for example:
2 / 3 / 2
1 + 1/3
When removing a row in a spreadsheet which has an assigned alias, the
alias will not be removed from the list of dynamic properties.
This makes it impossible to create a new alias which uses the same name
even if the original was removed (using removeRows/removeColumns)
Fixes#4492
When a user performs insert rows, remove rows, insert columns, or
remove rows, we need to move multiple cells as a batch. The cells are
moved sequentially. For each cell, its dependent alias positions are
looked up and dependencies are added. However, those cells with
aliases may be moved later in the batch. Thus the earlier dependencies
become wrong. This commit fixes this bug by moving all the aliases
before moving the cells. Unit tests are added to for this bug.
fixes issue #4429
while fixing a SVG export issue for techDraw I noticed that some SVG files have program-dependent (and thus not clean) code in it. These are traces of the programs Sodipodi and Inkscape, like e.g. this line:
inkscape:export-filename="/home/yorik/PartDesign_Groove.png
This is unnecessary and FC should not use program-dependent code in the SVG but use instead plain SVG strictly following the SVG specification.
This PR transforms the few affected SVGs to a plain version.