As far as I understand it, the method bool LayoutNode::setupShape() in engine/oox/source/drawingml/diagram/diagramlayoutatoms.cxx always returns true. And I see no derived class, that defines an own version of that method.
What do I miss? Could the return value be removed?
The only return statement is the unconditional return true; at the end; the “busted, skip it” cases inside just continue, they never fail the whole function. The comment above the return even says so: “even if no data node found, successful anyway.” The method isn’t virtual either, so no subclass overrides it with a false path.
Both call sites use if (rAtom.setupShape(...)) { ... }, but since the result is always true, those blocks always run.
So yes – the return value is effectively dead, and it could be changed to void with the two if wrappers dropped, without changing any behaviour. The only reason to keep it is that the if blocks mark the work that should be skipped if setup ever failed (naming, parenting, storing the shape), so it leaves room for a future failure path that was never finished.
Thank you for looking at it. You are right about “future failure path”. I have added my obsevation to my collection in ProblemsInSmartArtImplementation.odt - Nextcloud . We can decide about it, after the missing parts of SmartArt are implemented.