File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -66,16 +66,18 @@ std::shared_ptr<Block> Block::next() const
6666/* ! Returns the ID of the next block. */
6767std::string Block::nextId () const
6868{
69- if (impl->next )
70- return impl->next ->id ();
71- else
72- return impl->nextId ;
69+ return impl->nextId ;
7370}
7471
7572/* ! Sets the next block. */
7673void Block::setNext (std::shared_ptr<Block> block)
7774{
7875 impl->next = block;
76+
77+ if (block)
78+ impl->nextId = block->id ();
79+ else
80+ impl->nextId = " " ;
7981}
8082
8183/* ! Sets the next block by ID. */
@@ -94,16 +96,18 @@ std::shared_ptr<Block> Block::parent() const
9496/* ! Returns the ID of the parent block. */
9597std::string Block::parentId () const
9698{
97- if (impl->parent )
98- return impl->parent ->id ();
99- else
100- return impl->parentId ;
99+ return impl->parentId ;
101100}
102101
103102/* ! Sets the parent block. */
104103void Block::setParent (std::shared_ptr<Block> block)
105104{
106105 impl->parent = block;
106+
107+ if (block)
108+ impl->parentId = block->id ();
109+ else
110+ impl->parentId = " " ;
107111}
108112
109113/* ! Sets the parent block by ID. */
You can’t perform that action at this time.
0 commit comments