Commit Graph

10 Commits

Author SHA1 Message Date
Ladislav Michl
8b94d49a3c Gui: fix ViewProviderCoordinateSystem::claimChildren()
Until 8de6382 ("Gui: Fix stackoverflow when loading corrupted file")
a static_cast was used to obtain App::Origin object, however with
introducing App::LocalCoordinateSystem this was no longer correct,
although not causing any troubles as OriginFeatures moved into
LocalCoordinateSystem as well.

Recent use of getObject template triggered this problem, so use now
correct cast to App::LocalCoordinateSystem.

Fixes: 19702dc ("Core: Add App::LocalCoordinateSystem")
2025-06-10 10:20:06 +02:00
wmayer
8de63825cf Gui: Fix stackoverflow when loading corrupted file
If an object has a link to itself it may cause a stackoverflow
in several cases:
* If the method claimChildren3D() returns a list containing the
  object of the view provider then Document::handleChildren3D()
  will add a SoGroup to itself as a child. This will result into
  a stackoverflow as soon as an action traverses the scene.
* If the method claimChildren() returns a list containing the
  object of the view provider then DocumentItem::createNewItem()
  causes an infinite loop with DocumentItem::populateItem()

Solution:
* Inside Document::handleChildren3D() avoid to add a SoGroup to itself
* In this specific case fix ViewProviderCoordinateSystem::claimChildren()
  to avoid a cyclic dependency

Hint: Since PR 18126 FreeCAD is vulnerable for this problem.

This fixes issue 19682
2025-05-30 18:04:33 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
wmayer
cbd116b451 Gui: Use bitmask instead of three booleans in setTemporaryVisibility to improve readability 2024-12-31 13:29:01 +01:00
wmayer
63088a29a9 Gui: Reduce cognitive complexity of ViewProviderCoordinateSystem::setTemporaryVisibility 2024-12-30 19:03:58 +01:00
wmayer
8d4ddac85e Gui: Reduce code duplication in ViewProviderCoordinateSystem 2024-12-30 18:42:50 +01:00
PaddleStroke
e977eb49e3 Core datums: Rework to improve new sketch 2024-12-30 09:05:44 +01:00
wmayer
8fdbdccd8f Core: Move LCS migration warning to Std_Open command 2024-12-16 11:34:39 -05:00
PaddleStroke
e517400ed9 LCS migration : replace warning by a QMessageBox. 2024-12-13 18:04:10 +01:00
PaddleStroke
b7f1a0c150 ViewProviderOrigin: Renamed to ViewProviderCoordinateSystem 2024-11-27 12:15:53 +01:00