96 { |
96 { |
97 for (LDSubfileReference* reference : filterByType<LDSubfileReference> (selectedObjects())) |
97 for (LDSubfileReference* reference : filterByType<LDSubfileReference> (selectedObjects())) |
98 { |
98 { |
99 // Get the index of the subfile so we know where to insert the |
99 // Get the index of the subfile so we know where to insert the |
100 // inlined contents. |
100 // inlined contents. |
101 QPersistentModelIndex referenceIndex = currentDocument()->index(reference->lineNumber()); |
101 QPersistentModelIndex referenceIndex = currentDocument()->indexOf(reference); |
102 int row = referenceIndex.row(); |
102 int row = referenceIndex.row(); |
103 |
103 |
104 if (referenceIndex.isValid()) |
104 if (referenceIndex.isValid()) |
105 { |
105 { |
106 Model inlined {m_documents}; |
106 Model inlined {m_documents}; |