Commit Graph

1340 Commits

Author SHA1 Message Date
wmayer
54047878ac App: [skip ci] fix Property::isSame() and subclasses by first comparing the pointers directly 2022-01-07 17:09:08 +01:00
luz paz
fd3f2b0092 Fix various typos and refinements 2022-01-06 20:22:34 +01:00
wmayer
bea4b65639 App: include FCGlobal.h for export macro 2022-01-05 20:11:16 +01:00
luz paz
daa508a55c Fix more typos + whitespace fix and added 'TODO'
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,apoints,ba,beginn,behaviour,bloaded,bottome,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./build/doc/SourceDocu`
2022-01-04 18:57:56 -06: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
luz paz
546a243ad9 App: fix doxygen typo 2021-12-30 01:09:10 +01:00
luz paz
5c737973cf Link: Fix doxygen typo 2021-12-25 20:44:55 +01:00
Zheng, Lei
c4b0907c2c App: catch Base::Exception in ObjectIdentifier::getDep() 2021-12-23 15:35:22 +01:00
Zheng, Lei
16649243fb App: fix Enumeration assignment and comparison 2021-12-21 21:41:02 -07:00
Zheng, Lei
3e68a27960 Minor code changes according to suggestions 2021-12-21 21:41:02 -07:00
Zheng, Lei
c37c8658c4 App/Gui: add new ObjectStatus TouchOnColorChange
For triggering recompute on color changes
2021-12-21 21:41:02 -07:00
Zheng, Lei
611e79af53 App: insert UUID property to trace the source of copied object
A property _ObjectUUID will be added to an object before it is being to
copied, if the property does not exists. Anoter propert _SourceUUID
property will be added to any copied object, with value set to its
source objct's _ObjectUUID.
2021-12-21 21:41:02 -07:00
Zheng, Lei
9941830cfb App: clarify documentation of PropertyContainer::getPropertyNamedList() 2021-12-21 21:41:02 -07:00
Zheng, Lei
21903a1f41 App: fix property status restore 2021-12-21 21:41:02 -07:00
Zheng, Lei
c7255f196b Spreadsheet: improve copy/cut/paste cells
Add color bound around user copy/cut ranges. Do not touch Spreadsheet
object when cutting, only do so when pasting.
2021-12-21 21:41:02 -07:00
Zheng, Lei
8bb8bf8644 App: expose some property status bits to PropertyContainerPy 2021-12-21 21:41:02 -07:00
Zheng, Lei
156b6aa359 App: fix pending object remove on recomputing 2021-12-21 21:41:02 -07:00
Zheng, Lei
7e4f71606c App: warning on invalid cell offset in Expression 2021-12-21 21:41:02 -07:00
Zheng, Lei
54c484df9b App: add Property::isSame() API
To compare if two property contains the same content. The default
implementation in Property uses the persistense interface to save both
properties to string and compares the content. This may not work at the
moment if the property saves content in separate file or in binary.

Various properties have cheaper implementation to direct compare their
internal values.
2021-12-21 21:41:02 -07:00
Zheng, Lei
5229f5776f App: support CopyOnChange property in Link
New property status bit 'CopyOnChange' is added for any document object
to publish any property as a 'Configuration' option. When Link is
linked to any object with such property, it will duplicate those
properties and added it Link itself as dynamic properties. If the user
changes any of these dynamic properties, the Link will auto copy the
linked to object and apply the new configuration to it.

The Link has a new property 'LinkCopyOnChange' to allow user to
enable/disable this feature.

Spreadsheet's 'Configuration Table' feature will publish its
configuration property with 'CopyOnChange'.

Currently, once the linked object is copied, it will be independent with
the original object. There is no mechanism to auto sync changes back to
the copy.
2021-12-21 21:41:02 -07:00
Zheng, Lei
753d51aedf Spreadsheet: change alias handling
No longer add dynamic property for alias, simply rely on
get(Dynamic)PropertyByName() to check for aliases.

Add new API PropertyContainer::getPropertyNamedList() so that
ExpressionCompleter can discover properties with aliases.
2021-12-21 21:41:02 -07: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
10f1ac8436 App: add expression build-in href() for backward compatibility
As deprecated alias for hiddenref()
2021-12-21 21:41:02 -07:00
wmayer
dbaf53a26a App: fix ObjectIdentifier::getDep
+ it's an obscure way to clear the error state by instantiating PyException, instead use the clear() method
+ do not handle unknown exceptions because this suppresses all exceptions and thus makes error search more complicated
2021-12-20 16:43:02 +01:00
wmayer
dcb0c4c75f App: workaround for boost's file_lock with version < 1.76 on Windows 2021-12-20 16:08:47 +01:00
Chris Hennes
12e3f9f222 Core: Fix installation conflict with pkgutils 2021-12-18 20:29:42 -06:00
Chris Hennes
3aebf0aead GUI: Handle packaged Workbenches and their icons 2021-12-18 20:29:42 -06:00
Chris Hennes
aab7cb408c Core: Modify metadata Python handling to use dict
Rather than trying to use a generic Py::Object and assigning properties
to it, use a Py::Dict object for simple data structures like Url,
Maintainer, and Author.

Update metadata standard to include subdirectory
2021-12-18 20:29:42 -06:00
Chris Hennes
d9afcacf6f Core: Fix std::string init from null pointer
Constructing a string from a null pointer is undefined behavior: it
turned out to work with gcc and MSVC, but with XCode/clang it results in
a segmentation fault. Theis fix assumes that the expected behavior is to
yield an empty string.
2021-12-16 00:09:05 -06:00
wmayer
ea836050f1 App: 0004649: Segmentation fault when clearing an expression in an onChanged handler 2021-12-09 18:21:26 +01:00
luz paz
d877ee4d47 Make source code comments use gender neutral pronouns
The changes also include some grammatical fixes as well.
2021-12-02 16:18:04 -05:00
wmayer
5824a64b61 App: expose more methods of Document class to Python 2021-12-02 11:46:13 +01:00
wmayer
33fa183392 App: [skip ci] improve importing a Python module when passed as program argument 2021-12-01 13:34:24 +01:00
Yorik van Havre
ae84229ebc App: Added warning at startup if user mods are found in older location 2021-11-26 16:01:23 +01:00
wmayer
3be18613e4 App: remove code to copy user config from old to new location 2021-11-24 19:11:34 +01:00
wmayer
9b59baaacf App: add CMAKE_BINARY_DIR to search paths 2021-11-23 20:13:02 +01:00
wmayer
1c6b7cca9d App: save version number of the most important libraries 2021-11-23 12:55:49 +01:00
Zheng, Lei
32e3eaa01b App: fix subname encoding when saving property links 2021-11-21 23:35:40 -06:00
Zheng, Lei
61ec1192f3 App: change PropertyContainer::Restore()
Changes the way PropertyContainer handles existing property while
restoring. Previously it will first ask DynamicProperty to restore
if possible, then fallback to static property if else.

This patch looks up existing property first, and only fallback to
DynamicProperty if not found. This handles situation when an object
changes an originally dynamic property into a static one. With the
original code, it will add an auto renamed dynamic property that no
one knows its existence.
2021-11-21 19:03:53 -06:00
Zheng, Lei
55d64d71c2 App: do not auto rename new dynamic property
Instead, throw exception in case of duplicate name. Use boolean
parameter 'Preferences/Document/AutoNameDynamicProperty' to get back
the old behavior.
2021-11-21 19:03:53 -06:00
luz paz
bd210c9ee0 App: remove superfluous whitespace in ObjectIdentifier.h 2021-11-20 14:03:40 +01:00
luz paz
05c5e0a6d9 App: fix doc typo in ObjectIdentifier.h 2021-11-20 14:03:40 +01:00
wmayer
15ce4955b3 MingGW: [skip ci] fix build failure 2021-11-17 17:14:27 +01:00
wmayer
387661360c App: standard path handling
* distinguish between temp and cache location
* document's transident directory is created in the cache location
* add functions to access temp and cache location via Python
2021-11-15 16:26:25 +01:00
wmayer
d6b17b2dbb App: add PropertyLinkSubList::addValue() to extend the list 2021-11-15 13:05:19 +01:00
wmayer
744290467d App: add PropertyLinkSubList::verifyObject() to reduce code duplication 2021-11-15 08:42:32 +01:00
Chris Hennes
32790d1351 App: Add colCount and rowCount to Range 2021-11-14 20:45:09 -06:00
Chris Hennes
2ecd720de8 App: Add missing use for boost placeholders 2021-11-14 20:45:09 -06:00
Chris Hennes
7687582d53 App: fix compilation of PropertyStandard.cpp during cherry-pick 2021-11-14 20:45:09 -06:00