Commit Graph

32 Commits

Author SHA1 Message Date
luz paz
4be3fe84c7 App: fix trailing whitespace 2022-12-02 19:19:17 -06:00
wmayer
656890be38 App: modernize C++: replace 'typedef' with 'using' 2022-08-29 12:58:39 +02:00
berniev
d2babf0eb5 App: Single arg ctors must be explicit 2022-08-24 07:20:57 +02:00
wmayer
1a457d0fb9 App: fix -Winconsistent-missing-override 2022-08-01 01:14:19 +02:00
berniev
b6cae3bfdf App: Modernise ctors dtors defs etc 2022-08-01 00:34:46 +02:00
berniev
85170b2879 remove redundant void 2022-07-31 10:27:44 +02:00
wmayer
0f5725b34a modernize C++: replace boost::function with std::function 2022-06-30 20:31:55 +02:00
Christoph Moench-Tegeder
ecc3fb7218 fix Expressions assignment for FreeBSD
Just like Apple, FreeBSD uses clang as it's main compiler, and thus
runs afoul of the same problem in src/App/PropertyExpressionEngine.cpp
like Apple (issue #5281): "error: no viable overloaded '='".
Extend the fix from #5281 for the BSDs (check macro FC_OS_BSD) -
at least OpenBSD uses clang, too (maybe this check should be reworked
to test for clang, but I can't test on Apple, so let's keep this fix
minimalistic).

References: #5281
2022-06-19 16:14:10 +02:00
wmayer
1a20b7f119 App: modernize C++11
* use nullptr
2022-03-23 17:29:23 +01: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
1cbecdf122 App: use forward declaration to reduce compile time 2022-03-04 17:27:53 +01:00
Uwe
d88397f3d6 [App] Placement and Property: remove unused includes 2022-02-24 01:09:00 +01:00
Benjamin Alterauge
e81ee6f540 Use std::map without const 2021-12-30 17:40:45 +01:00
Benjamin Alterauge
3f85853e09 Spreadsheet: Fix trouble with clang and MacOS
Since the Spreadsheet: support cell binding commit, I got trouble by building freecad. I didn't find similar reports in install/compile forum. So I will only use the old version of typedef for macos. Better solutions are welcome.

See [trouble details](0c54f3236e (commitcomment-62364932))
2021-12-30 17:40:45 +01:00
Zheng, Lei
0c2c334f87 Spreadsheet: support cell binding
Cell binding allows one to bind a range of cells of one sheet to another
range of cells of an arbitary sheet, including any empty cells in the
range.

The binding is implemented with PropertyExpressionEngine and
PropertySheet::setPathValue(), which binds a special path of
PropertySheet, such as

    .cells.Bind.A1.D1

to an expression, such as

     tuple(.cells, <<A2>>, <<A5>>)

The A1 and D1 in the example above specifies the binding start and end
cell address. And <<A2>> and <<A5>> are the range of cells to bind to.
Note that you can use any expression that evalutes to string for the
binding destination, e.g. <<A%d>> % B1, which uses the value inside B1
to construct the binding destination. The '.cells' in the tuple shown
above is an example to bind cells of the same PropertySheet. It can be
change to to reference to any other spreadsheet, even those outside the
current document, e.g. Document#Spreadsheet001.cells
2021-12-21 21:41:02 -07:00
Zheng, Lei
fdae470c1b App: add hiddenref() expression built-in function
Any object reference inside this function is treated as hidden to
exclude it from dependency calculation. This function allows some form
of cyclic depdenency.

Merger note: renamed from "HREF" to "HIDDENREF" to avoid confusion with
the standard "hypertext reference" use of HREF.
2021-11-14 20:45:09 -06:00
Benjamin Nauck
079ffa5b0f [App] Use std::shared_ptr instead of boost::shared_ptr
There's no need to use boost version when stl has support for shared_ptr
2021-03-06 19:32:03 +01:00
wmayer
eac4062b3f Boost: [skip ci] Fix build warnings from deprecated Boost headers (v1.75) 2020-12-29 15:34:25 +01:00
Mateusz Skowroński
98f63ba60f Fix build warnings from deprecated Boost headers (they are used internally by Boost). Thanks @wwmayer for the hint. 2020-12-29 10:20:53 +01:00
luz.paz
019f73852c src/App: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/App` files
2019-12-25 11:38:43 +01:00
wmayer
53e597a5d6 Fix clang compiler warnings:
+ fix -Winconsistent-missing-override
+ fix -Wunused-private-field
+ suppress -Woverloaded-virtual but fix later
2019-08-17 19:51:51 +02:00
Zheng, Lei
ced27a69c6 PropertyExpressionEngine: convert to link type property
PropertyExpressionEngine is changed to derived from a new class
PropertyExpressionContainer, which is in turn derives from
PropertyXLinkContainer. This makes PropertyExpressionEngine a link type
property that is capable of external linking. It now uses the unified
link property APIs for dependency management and tracking of object
life time, re-labeling, etc.

ObjectIdentifier is modified to support sub-object reference, but is
not exposed to end-user, because expression syntax is kept mostly
unchanged, which will be submitted in future PR. There is, however,
one small change in expression syntax (ExpressionParser.y) to introduce
local property reference to avoid ambiguity mentioned in
FreeCAD/FreeCAD#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
2019-08-17 14:52:09 +02:00
wmayer
36271b4052 move from deprecated boost.signals to boost.signals2 library 2018-10-30 19:09:03 +01:00
luz.paz
ce91b1f766 Misc. typo fix
Found via `codespell`
2018-10-11 16:21:28 -04:00
wmayer
004206aa0b 0003279: Error 'invalid DAG' after deleting sketch using expressions 2018-01-31 00:27:38 +01:00
Eivind Kvedalen
495b23209c Document/PropertyExpressionEngine: Added onDocumentRestored function, to update internals of PropertyExpressionEngine after loading a document from disk. 2016-01-08 23:08:55 +01:00
Eivind Kvedalen
72bb18a53f PropertyExpressionEngine/DocumentObject: Track object deletes and update dependencies accordingly. 2015-12-21 14:11:13 +01:00
Stefan Tröger
96a586d04a Expressions: Integrate into the property editor
- basic infrastructure for handling of expressions
- port the unit properties editor to support expressions
- port placement editor to support expressions
- expressions for double spinbox
- expressions in sketch constraints
2015-12-09 14:08:48 +01:00
wmayer
2acb38daa7 + fix clang warning: -Woverloaded-virtual 2015-10-02 20:42:16 +02:00
Eivind Kvedalen
d7d184e198 Removed PropertyExpressionEngine::getPaths() method. 2015-09-30 15:54:16 +02:00
wmayer
343c915569 + reimplement virtual methods in PropertyExpressionEngine 2015-09-25 00:52:44 +02:00
Eivind Kvedalen
bcbec533db Added PropertyExpressionEngine class. 2015-09-21 14:51:05 +02:00