78 for (LDObject* obj : selectedObjects()) |
78 for (LDObject* obj : selectedObjects()) |
79 { |
79 { |
80 types << obj->type(); |
80 types << obj->type(); |
81 |
81 |
82 if (obj->type() == LDObjectType::SubfileReference) |
82 if (obj->type() == LDObjectType::SubfileReference) |
83 subfilenames << static_cast<LDSubfileReference*> (obj)->fileInfo()->name(); |
83 subfilenames << static_cast<LDSubfileReference*>(obj)->fileInfo(m_documents)->name(); |
84 } |
84 } |
85 |
85 |
86 QItemSelection selection; |
86 QItemSelection selection; |
87 |
87 |
88 for (QModelIndex index : currentDocument()->indices()) |
88 for (QModelIndex index : currentDocument()->indices()) |
93 if (not types.contains (type)) |
93 if (not types.contains (type)) |
94 continue; |
94 continue; |
95 |
95 |
96 // For subfiles, type check is not enough, we check the name of the document as well. |
96 // For subfiles, type check is not enough, we check the name of the document as well. |
97 if (type == LDObjectType::SubfileReference |
97 if (type == LDObjectType::SubfileReference |
98 and not subfilenames.contains (static_cast<LDSubfileReference*> (obj)->fileInfo()->name())) |
98 and not subfilenames.contains(static_cast<LDSubfileReference*>(obj)->fileInfo(m_documents)->name())) |
99 { |
99 { |
100 continue; |
100 continue; |
101 } |
101 } |
102 |
102 |
103 selection.select(index, index); |
103 selection.select(index, index); |