Commit Graph

1419 Commits

Author SHA1 Message Date
wmayer
e4d1ed8366 Base: rename BaseExceptionFreeCADError to PyExc_FC_GeneralError 2022-03-17 14:45:48 +01:00
wmayer
1f12dca2b4 Py: replace BaseExceptionFreeCADError with more suitable exception types 2022-03-17 13:54:23 +01:00
wmayer
6e5feb5ccc App: change base types of some exceptions and raise XML exceptions in MetadataPy::PyInit 2022-03-17 11:43:59 +01:00
wmayer
a90a39a4c9 Base: add more custom Python exception types 2022-03-17 11:29:09 +01:00
wmayer
0f9768fb33 Fix coverity issue:
* CID 332682: Resource leak
* CID 350607: Resource leak
* CID 332677: Resource leak
2022-03-14 11:35:04 +01:00
Chris Hennes
46cd740269 App: Improve Metadata error handling
Report XML parse exception details.
2022-03-13 21:01:47 -05:00
Chris Hennes
4fc8ee56a6 App: Fix Metadata Py constructors
Also adds unit tests for the corrected Copy and Default constructors.
2022-03-13 21:01:47 -05:00
wmayer
b78dc894e1 Core: Fix several coverity issues:
* CID 350582: Big parameter passed by value
* CID 350639: Big parameter passed by value
* CID 305234: Uncaught exception
* CID 316529: Uncaught exception
* CID 350597: Uncaught exception
* CID 350623: Uncaught exception
* CID 332690: Uncaught exception
* CID 332700: Unchecked return value
* CID 350576: Uninitialized scalar field
* CID 350587: Uninitialized scalar variable
* CID 192606: Uninitialized scalar field
* CID 332699: Uninitialized pointer field
* CID 350561: Dereference null return value
* CID 350610: Dereference null return value
* CID 350567: Dereference after null check
2022-03-13 13:53:32 +01:00
wmayer
5fd93b7d3b Fix several coverity issues:
* CID 350617: Dereference after null check
* CID 350585: Out-of-bounds read
* CID 350624: Resource leak
* CID 332701: Uncaught exception
* CID 350642: Uninitialized scalar field
* CID 350590: Uninitialized scalar field
* CID 350629: Uninitialized scalar variable
* CID 350602: Uninitialized scalar variable
* CID 350564: Uninitialized scalar variable
* CID 350548: Uninitialized scalar variable
2022-03-13 12:12:49 +01:00
wmayer
b34a00fe14 App: add convenience method DocumentObject::clearExpression() 2022-03-10 12:09:57 +01:00
wmayer
042d9d248e App: correctly handle int as argument for ocumentPy::getObject
Add a unit test to confirm correct behaviour
2022-03-09 23:02:22 +01:00
wmayer
55bd9677a9 App: [skip ci] fix bug in Metadata::supportsCurrentFreeCAD()
clang prints the warning: operator '?:' has lower precedence than '<<'; '<<' will be evaluated first [-Wparentheses]
2022-03-09 22:05:14 +01:00
wmayer
08b77bff08 Core/Mod: modernize C++11
* use nullptr
2022-03-09 21:55:31 +01:00
Chris Hennes
0c85c16932 Core: Support disabling Addon by FreeCAD version
If package.xml metadata file exists, it is scanned for FreeCAD version
compatibility before the Addon is loaded. If the Addon specifies that it is
explicitly not compatible with the current version of FreeCAD, the Addon is
not loaded.
2022-03-08 23:19:04 -06:00
Uwe
7d1a64e1c1 [App] AutoTransaction: a change to silence MSVC compiler
as proposed here: https://github.com/FreeCAD/FreeCAD/pull/6519#discussion_r820641762
2022-03-07 20:34:02 +01:00
wmayer
f1f68db55b App: Optimize includes to reduce compile time 2022-03-07 15:53:58 +01:00
wmayer
4b0658a3a6 App: include cstddef to get definition of size_t 2022-03-07 01:00:14 +01:00
Uwe
cdff8e19dc Revert "[App] add a missing return statement (#6519)"
This reverts commit 5c7ef17ac063f9339c68333afecf1cd88404b959.
2022-03-07 00:50:18 +01:00
wmayer
4a343ab31e Base/App: fix warnings from code analysers:
* convert old-style-casts to explicit C++ casts where possible
* make some implicit conversions explicit
2022-03-06 23:49:30 +01:00
Uwe
26ece78df4 [App] add a missing return statement (#6519)
* [App] add a missing return statement

as discussed here: ceae048a43 (commitcomment-68066635)
2022-03-06 23:20:05 +01:00
wmayer
91e4e468dd Base: move ILogger sub-classes to their own source files in order to reduce including stream classes in client code 2022-03-06 10:13:47 +01:00
Uwe
f274c63e0e [App] next attempt to fix CI build error
- revert previous commit and re-add application as header
2022-03-06 03:25:14 +01:00
Uwe
8250cab590 [App] try to fix CI build failure
- since I have no clue what the error is about:
https://gitlab.com/freecad/FreeCAD-CI/-/jobs/2167699355
I follow MSVC's advice that tells me that a function definition in the .cpp file is missing
2022-03-06 03:02:14 +01:00
wmayer
5e0cfc64ee App: use forward declarations 2022-03-04 21:09:46 +01:00
wmayer
2a33fe77f6 App/Gui: move template classes (ViewProvider)ExtensionPythonT to their own header files 2022-03-04 18:54:42 +01:00
wmayer
1cbecdf122 App: use forward declaration to reduce compile time 2022-03-04 17:27:53 +01:00
wmayer
6c2e1a2d6e Base: implement a lightweight smart pointer for PyObject like Py::Object to reduce includes of Python.h in header files 2022-03-04 15:51:51 +01:00
wmayer
9798e6de2b App: move member DocumentPythonObject to DocumentP 2022-03-03 20:28:47 +01:00
Chris Hennes
6dd6c3168d Core: Remove Init.py stop file check from inner package loop
Check was unused, only stop files located at the top-level should halt loading.
2022-03-02 10:00:52 -06:00
Uwe
7a551a82f3 [App] remove header
slipped in with previous commit but will be part of a PR
2022-03-02 01:53:28 +01:00
Uwe
71d6e43d54 [Base] some sorting and cleanup 2022-03-02 01:51:05 +01:00
wmayer
739804b511 Mod: add string header to dxf.h 2022-03-01 17:18:29 +01:00
wmayer
e70170dbf3 App: [skip ci] Add enum value to suppress error messages on document recompute 2022-02-28 17:54:25 +01:00
Uwe
d64c091385 [App] Origin and Part: remove unused includes 2022-02-28 13:15:23 +01:00
Chris Hennes
7d0e6aa1ac Core: Correct metadata docs 2022-02-27 23:33:07 -06:00
Uwe
f04194b7bb [App] Object, Meta, Merge: remove unused includes 2022-02-28 01:02:06 +01:00
Uwe
efd68f1c69 [App] remove unused code and some header sorting 2022-02-28 00:17:16 +01:00
Uwe
062944f674 [App] Link and Material: remove unused includes 2022-02-27 21:23:51 +01:00
Uwe
7a60d92282 [App] Annotation: remove unused code 2022-02-27 18:30:15 +01:00
Uwe
9d30b0af6a [App] Feature: remove unused includes 2022-02-27 16:37:29 +01:00
Uwe
a8c912d6f8 [App] Expression and Extension: remove unused includes 2022-02-25 18:06:57 +01:00
Uwe
d837160c8e [App] remove some unused includes 2022-02-25 02:25:47 +01:00
Uwe
beb0152996 [App] Range to VRML: remove unused includes 2022-02-24 11:28:52 +01:00
Uwe
d88397f3d6 [App] Placement and Property: remove unused includes 2022-02-24 01:09:00 +01:00
Uwe
09ce5ce137 [App] Document: remove unused includes 2022-02-23 01:56:26 +01:00
Uwe
d3473523d2 [App] Application: remove unused includes
- also sort the includes
2022-02-22 13:17:07 +01:00
Uwe
16467d9067 Revert "App: fix property ordering problem when undo/redo (#3255)"
This reverts commit 24d30636e4fb990fdbd67538360846ff09456dfc.
2022-02-22 01:21:49 +01:00
Zheng, Lei
2895f8f631 App: fix undo/redo of dynamic property add/remove/change 2022-02-21 14:04:12 +01:00
Zheng Lei
170a12089c App: fix property ordering problem when undo/redo (#3255)
* Part: fix Placement/Shape onChanged() handling

* App: fix property ordering problem when undo/redo
See https://tracker.freecadweb.org/view.php?id=4265#c14271

* Gui: fix undo/redo signaling
Make sure to signal after all properties has been restored
2022-02-21 12:29:01 +01:00
Chris Hennes
ec90b7f954 Core: Add mechanism to disable addon 2022-02-20 22:09:57 -06:00