Skip to content

Commit 3cc2758

Browse files
alxbilgerfredroy
andauthored
[Core] Use toBaseComponent() instead of toBaseObject() (sofa-framework#6004)
* Use `toBaseComponent()` instead of `toBaseObject()` * fix typo --------- Co-authored-by: Frederick Roy <froy@lnrobo.com>
1 parent 0c78593 commit 3cc2758

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sofa/framework/Core/src/sofa/core/objectmodel/BaseLink.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ std::string BaseLink::CreateString(const std::string& path, const std::string& d
209209
std::string BaseLink::CreateStringPath(Base* dest, Base* from)
210210
{
211211
if (!dest || dest == from) return std::string("[]");
212-
BaseObject* o = dest->toBaseObject();
213-
BaseObject* f = from->toBaseObject();
212+
BaseObject* o = dest->toBaseComponent();
213+
BaseObject* f = from->toBaseComponent();
214214
const BaseContext* ctx = from->toBaseContext();
215215
if (!ctx && f) ctx = f->getContext();
216216
if (o)

applications/projects/Modeler/lib/GraphHistoryManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void GraphHistoryManager::undoOperation(Operation &o)
9191
switch(o.ID)
9292
{
9393
case Operation::DELETE_OBJECT:
94-
o.parent->addObject(o.sofaComponent->toBaseObject());
94+
o.parent->addObject(o.sofaComponent->toBaseComponent()());
9595
graph->moveItem(graph->graphListener->items[o.sofaComponent.get()],graph->graphListener->items[o.above.get()]);
9696
o.ID = Operation::ADD_OBJECT;
9797
message=std::string("Undo Delete NODE ") + " (" + o.sofaComponent->getClassName() + ") " + o.sofaComponent->getName();
@@ -109,7 +109,7 @@ void GraphHistoryManager::undoOperation(Operation &o)
109109
case Operation::ADD_OBJECT:
110110
o.parent=graph->getNode(graph->graphListener->items[o.sofaComponent.get()]);
111111
o.above=graph->getComponentAbove(graph->graphListener->items[o.sofaComponent.get()]);
112-
o.parent->removeObject(o.sofaComponent->toBaseObject());
112+
o.parent->removeObject(o.sofaComponent->toBaseComponent()());
113113
o.ID = Operation::DELETE_OBJECT;
114114

115115
message=std::string("Undo Delete OBJECT ") +" (" + o.sofaComponent->getClassName() + ") " + o.sofaComponent->getName();

0 commit comments

Comments
 (0)