MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / replaceChildByName

Method replaceChildByName

forms/control.cpp:841–855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

839}
840
841bool Control::replaceChildByName(sp<Control> ctrl)
842{
843 for (auto c = Controls.begin(); c != Controls.end(); c++)
844 {
845 if ((*c)->Name == ctrl->Name)
846 {
847 (*c) = ctrl;
848 ctrl->owningControl = shared_from_this();
849 setDirty();
850 return true;
851 }
852 }
853
854 return false;
855}
856
857sp<Control> Control::getParent() const { return owningControl.lock(); }
858

Callers 1

initMethod · 0.80

Calls 2

endMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected