Commit Graph

38 Commits

Author SHA1 Message Date
Ladislav Michl
9683cf1e4f Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Benjamin Nauck
ecc2571d12 App: use contains() instead of count() 2025-05-03 22:22:10 +02:00
Joao Matos
6797cfdfbe App: Remove old DAG implementation. 2025-02-28 14:32:32 +00:00
wmayer
6f5259af26 App: Apply clang format (part 1) 2024-11-21 07:54:24 +01:00
Florian Foinant-Willig
741296b82e Core: modernize type checking 2023-10-23 18:07:07 +02:00
wmayer
1cf1a90a17 App: modernize C++: use default member init 2023-08-23 19:51:44 +02:00
wmayer
4991475341 App: modernize C++: use range-based for loop 2023-08-14 16:40:25 +02:00
wmayer
a020382f09 App: fixes issue #7628: Crash after creating Sketch for Body
The problem is that inside Transaction::addObjectNew() a transaction object is deleted before removing it from the container. When deleting the corresponding transactional object (i.e. a DocumentObject or ViewProvider)
it can happen that it e.g. calls Transaction::addOrRemoveProperty() that now finds the dangling pointer in the container.

The safe way is to first remove the object from the container before deleting it.
2022-10-24 16:49:29 +02:00
berniev
22dcf5866f App: use empty 2022-08-06 19:29:59 +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
Uwe
e69a920f18 [App] remove superfluous nullptr checks 2022-07-18 03:12:01 +02:00
Chris Hennes
f7edc74eee App: PR6497 move return statement to new line 2022-03-29 12:33:37 -05:00
wmayer
1a20b7f119 App: modernize C++11
* use nullptr
2022-03-23 17:29:23 +01:00
Uwe
beb0152996 [App] Range to VRML: remove unused includes 2022-02-24 11:28:52 +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
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
Zheng, Lei
f6ad70195f App: fix dynamic property undo/redo
Instead of enforce property type match when undo/redo, modify various
property Paste() to make it type safe.
2019-10-07 17:24:31 +02:00
wmayer
9fa56345cf core system
force strict ISO C++ (-Wpedantic)
TODO: still a lot of variadic macros are not valid ISO C++
2019-09-18 01:01:14 +02:00
Zheng, Lei
d7dd720eaf App: fix property type matching in transaction 2019-08-17 15:32:50 +02:00
Zheng, Lei
de4651bc99 App: transaction related API changes
Introduce a new concept of transaction ID. Each transaction must be
unique inside the document. Multiple transactions from different
documents can be grouped together with the same transaction ID.
This makes it possible to undo/redo single operation that contains
changes from multiple documents due to external linking.

Application:

* get/set/closeActiveTransaction() is used to setup potential
  transactions with a given name. The transaction is only created when
  there is actual changes. If objects from multiple documents are
  changed under the same active transaction, they will have the same
  trasnaction ID, and can be undo/redo togtether later.

* signalUndo/signalRedo, new signals triggered once after an undo/redo
  operation. Unlike signalUndo/RedoDocument, these signals will only be
  triggered once even if there may be multiple documents involved during
  undo/redo.

* signal(Before)CloseTransaction, new signals triggered before/after an
  actual transaction is created or aborted.

AutoTransaction:

* Helper class to enable automatic management of transactions. See class
  document for more details. This class will be used by Gui::Command
  in later patches to allow better automation of transactions in
  command.

Document:

* open/commit/abortTransaction() are now redirected to call
  Application::get/set/closeActiveTransaction() instead.

* _openTransaction() is added to do the real creation of transaction.

* _checkTransaction() is modified to create transaction on actual change
  of any property.

* getTransactionID() is used to find out the position of a transaction
  with a given ID. When triggering undo in external document, it may be
  necessary to perform multi-step undo/redo in order to match for the
  transaction ID.

Transaction/TransactionObject:

* Various changes for the new transaction ID concept.

* Support undo/redo add/remove dynamic property
2019-08-17 14:52:09 +02:00
wmayer
06fa64a00d add method to check if an open transaction is empty
This is needed to avoid to incorrectly abort a transaction if a recompute was done between opening and closing an editor in the property view
2018-11-10 14:50:58 +01:00
wmayer
9c86a3918f put USE_OLD_DAG around use of backlinks 2018-10-22 12:06:22 +02:00
wmayer
5e16cb9792 fixes #0003323: Crash when clearing transaction list 2018-01-31 23:39:13 +01:00
Unknown
e3eca59173 Misc. typo fixes
Various workbenches
2017-12-23 14:30:30 +01:00
wmayer
712966ff50 rename method from remObject to removeObject to be more readable 2017-09-13 18:57:38 +02:00
wmayer
3a0c3499e5 improve whitespaces 2017-09-09 18:07:46 +02:00
Stefan Tröger
b2874ec0dc Keep backlink consitent during undo/redo. issue 0003150 2017-09-09 16:55:55 +02:00
wmayer
a5bf15b55d remove properties from transactions when being deleted 2017-08-28 21:20:17 +02:00
wmayer
c636974ec8 fix -Wextra in FreeCADApp 2016-09-21 16:05:36 +02:00
wmayer
ac32ab0b00 + fix order of removed objects in transaction list
+ add assert to check for obvious error
+ removed unneeded method
2016-07-23 11:47:01 +02:00
wmayer
71390dcf20 prepare view provider for undo/redo 2016-07-23 11:46:19 +02:00
wmayer
3d16ae0f04 prepare view provider for undo/redo 2016-07-23 11:45:21 +02:00
wmayer
ff56a3b53d + better check for opening a transaction when removing an object from document 2013-08-15 16:47:56 +02:00
wmayer
50a0e00960 Fix build error on MacOSX 2013-02-25 11:57:11 +01:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00