* Add support for better translations (using pluralizations)
* Add support for inserting rows/columns after the selection
* Informs the user that it will insert rows/cols above/under/left/right of the selection
* Informs the user how many rows/cols that will be inserted
Qt has deprecated the following constants, this commit replaces them
with their new equivalent/replacement:
Qt::TextColorRole -> Qt::ForegroundRole
Qt::BackgroundColorRole -> Qt::BackgroundRole
QPainter::HighQualityAntialiasing -> QPainter::Antialiasing
QPalette::Foreground -> QPalette::WindowText
After pull request https://github.com/FreeCAD/FreeCAD/pull/4215 it
doesn't make much sense helping the user to write expressions without
leading '=', as that content will be parsed as a string.
This change adjusts the behaviour in SpreadsheetGui's LineEdit to avoid
popping up the ExpressionCompleter when no leading equal sign is used.
There are no reason to check the return values for these functions
as the string passed as an argument will be set to an empty string
if it false. An empty string is a valid option in these instances.
Coverity warnings fixed:
CID 316520 (1 of 1): Unchecked return value (CHECKED_RETURN)
3. check_return: Calling getAlias without checking return value (as is done elsewhere 8 out of 10 times).
CID 316557 (1 of 1): Unchecked return value (CHECKED_RETURN)
8. check_return: Calling getAlias without checking return value (as is done elsewhere 8 out of 10 times).
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