# Bool LayoutNode::setupShape() always returns true?

**URL:** <https://forum.collaboraonline.com/t/bool-layoutnode-setupshape-always-returns-true/4806>\
**Category:** Development\
**Created:** [June 28, 2026, 12:22pm UTC](https://forum.collaboraonline.com/t/bool-layoutnode-setupshape-always-returns-true/4806 "2026-06-28T12:22:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Regina](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Regina](https://forum.collaboraonline.com/u/Regina)\
**Post date:** [June 28, 2026, 12:22pm UTC](https://forum.collaboraonline.com/t/bool-layoutnode-setupshape-always-returns-true/4806/1 "2026-06-28T12:22:11Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [June 29, 2026, 2:19pm UTC](https://forum.collaboraonline.com/t/bool-layoutnode-setupshape-always-returns-true/4806/2 "2026-06-29T14:19:10Z")

</div>

hi @Regina

You’re right – it does always return true.

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.

---

<div class="post-metadata">

**Author:** ![Regina](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Regina](https://forum.collaboraonline.com/u/Regina)\
**Post date:** [June 29, 2026, 7:09pm UTC](https://forum.collaboraonline.com/t/bool-layoutnode-setupshape-always-returns-true/4806/3 "2026-06-29T19:09:47Z")

</div>

> [@darshan](#):
>
> 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](https://staging-perf.eu.collaboraonline.com/nextcloud/index.php/s/HxZ2iatHfeP7wLt) . We can decide about it, after the missing parts of SmartArt are implemented.
