File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -666,6 +666,12 @@ void Attributable::readAttributes(ReadMode mode)
666666
667667void Attributable::preferCurrentBackpointer () const
668668{
669+ /*
670+ * This is called when reopening some object as a specific type (e.g.
671+ * RecordComponent) that had originally been opened generically as
672+ * CustomHierarchy already. In this case, the specific type's pointer should
673+ * be preferred for Writable::attributable as it has more information.
674+ */
669675 auto this_as_custom_hierarchy = dynamic_cast <CustomHierarchy const *>(this );
670676 if (this_as_custom_hierarchy)
671677 {
@@ -682,13 +688,21 @@ void Attributable::preferCurrentBackpointer() const
682688 return ;
683689 }
684690
691+ // Now:
692+ // !this_as_custom_hierarchy && backpointer_as_custom_hierarchy
693+
685694 w.attributable = m_attri.get ();
686695
696+ // Now:
697+ // !this_as_custom_hierarchy && !backpointer_as_custom_hierarchy
698+
687699 if (!w.parent )
688700 {
689701 throw error::Internal (
690702 " CustomHierarchy object was created without parent. Why?" );
691703 }
704+
705+ // dont manage this as a customhierarchy instance
692706 auto count_of_erased_elements =
693707 (*w.parent ->attributable )
694708 ->m_children_managed_as_custom_hierarchy .erase (
You can’t perform that action at this time.
0 commit comments