The "angle" variable was not being initialized in any of the
constructors for the CutDimensionSet, and nothing was being initialized
by the default constructor. This commit adds angle as an optional final
argument to the parameterized constructors, defaulting to 0.0, and adds
default values to the default constructor using the first of each enum
and 0.0 for the angle. The default constructor is required elsewhere in
the code so cannot be trivially removed. Issue identified by Coverity.
LGTM complains if this calculation is done from inside the sqrt() call
because it sees the explicit cast to float and assumes that sqrt() is
intended to take a double. By adding an intermediate step it should be
clear to LGTM that the float version of sqrt is intended.
========================================
The geometry state stored in the geometryFacade is modified following a mutable model
(without setting the Geometry property on Constraint change), in order to avoid coupling
the addition/removal of a constraint with a change of the Geometry Property.
This design decision however interferes with the ability of the Geometry property to restore
the correct geometry state upon redo/undo.
While such a situation is rare in the case of Internal Alignment geometry, because constraint
addition/removal is performed with the corresponding geometry addition/removal (within the same
transaction. That is not the case with the Block constraint (or another future general case where
the geometry state may be applied).
This commit leverages the synchronisation mechanism already in use for non-properties (e.g. external geometry or
vertex indices) to check and synchronise geometry state upon undo/redo and restore.
Bonus:
- addGeometryState is refactored to separate the checking logic from the setting logic.
In some PartDesign task dialogs, the destructors call functions that may
throw exceptions. If that occurs and the exception is uncaught, this
will ususally end up terminating the program. This commit adds try-catch
blocks around each instance of that (identified by Coverity) and handles
the Python exception in the normal reporting workflow.
without Inkscape specials, just plan SVG 1.1
we frequently have problems that some of our SVGs cannot correctly be displayed by other programs like the Chrome browser. In most cases the reason is that the SVG were created with old Inkscape versions that added stuff that are not in the SVG specs. The clean way to avoid this for the future is to save as "plain SVG" from within Inkscape
THis PR does this only for those SVG for which I got DPI warnings and for some also git warnings about inconsistent line endings.
LGTM complains about this construct leaking memory. Commit 13927b2465
eliminated the parts of FreeCAD that throw those strings. This commit
eliminates the catch block.