Commit Graph

34 Commits

Author SHA1 Message Date
Florian Foinant-Willig
773c701eec Core: modernize type checking 2023-10-23 18:07:07 +02:00
wmayer
ee0fad4c90 App: modernize C++: use default member init 2023-08-23 19:51:44 +02:00
wmayer
26f16f7410 App: modernize C++: use range-based for loop 2023-08-14 16:40:25 +02:00
wmayer
72af60c22e 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
1cc6329eab App: use empty 2022-08-06 19:29:59 +02:00
berniev
65a356835b App: Modernise ctors dtors defs etc 2022-08-01 00:34:46 +02:00
berniev
b40de7a509 remove redundant void 2022-07-31 10:27:44 +02:00
Uwe
fa36a57724 [App] remove superfluous nullptr checks 2022-07-18 03:12:01 +02:00
Chris Hennes
132a1d7e55 App: PR6497 move return statement to new line 2022-03-29 12:33:37 -05:00
wmayer
749361d2f3 App: modernize C++11
* use nullptr
2022-03-23 17:29:23 +01:00
Uwe
8dd1140a4b [App] Range to VRML: remove unused includes 2022-02-24 11:28:52 +01:00
Uwe
62496d7277 Revert "App: fix property ordering problem when undo/redo (#3255)"
This reverts commit c3178343db.
2022-02-22 01:21:49 +01:00
Zheng, Lei
0a0bdf6762 App: fix undo/redo of dynamic property add/remove/change 2022-02-21 14:04:12 +01:00
Zheng Lei
c3178343db 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
4f308dc03c 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
41387fd991 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
b50b21576e 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
5a96db6483 App: fix property type matching in transaction 2019-08-17 15:32:50 +02:00
Zheng, Lei
1cb2e190b4 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
442e2dd381 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
1243b2543e put USE_OLD_DAG around use of backlinks 2018-10-22 12:06:22 +02:00
wmayer
bb39cc783a fixes #0003323: Crash when clearing transaction list 2018-01-31 23:39:13 +01:00
Unknown
a8ecffb652 Misc. typo fixes
Various workbenches
2017-12-23 14:30:30 +01:00
wmayer
09737f2db3 rename method from remObject to removeObject to be more readable 2017-09-13 18:57:38 +02:00
wmayer
e260f9dabd improve whitespaces 2017-09-09 18:07:46 +02:00
Stefan Tröger
946e470a6f Keep backlink consitent during undo/redo. issue 0003150 2017-09-09 16:55:55 +02:00
wmayer
a5bc70cca0 remove properties from transactions when being deleted 2017-08-28 21:20:17 +02:00
wmayer
71df967fdf fix -Wextra in FreeCADApp 2016-09-21 16:05:36 +02:00
wmayer
f2bad4598a + 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
0f2db9061f prepare view provider for undo/redo 2016-07-23 11:46:19 +02:00
wmayer
f0e00311cd prepare view provider for undo/redo 2016-07-23 11:45:21 +02:00
wmayer
0900025e2d + better check for opening a transaction when removing an object from document 2013-08-15 16:47:56 +02:00
wmayer
c08f8abc98 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