168 // ----------------------------------------------------------------------------- |
168 // ----------------------------------------------------------------------------- |
169 static void writeObjects (const LDObjectList& objects, QFile& f) |
169 static void writeObjects (const LDObjectList& objects, QFile& f) |
170 { |
170 { |
171 for (LDObject* obj : objects) |
171 for (LDObject* obj : objects) |
172 { |
172 { |
173 if (obj->getType() == LDObject::ESubfile) |
173 if (obj->type() == LDObject::ESubfile) |
174 { |
174 { |
175 LDSubfile* ref = static_cast<LDSubfile*> (obj); |
175 LDSubfile* ref = static_cast<LDSubfile*> (obj); |
176 LDObjectList objs = ref->inlineContents (LDSubfile::DeepInline); |
176 LDObjectList objs = ref->inlineContents (LDSubfile::DeepInline); |
177 |
177 |
178 writeObjects (objs, f); |
178 writeObjects (objs, f); |
179 |
179 |
180 for (LDObject* obj : objs) |
180 for (LDObject* obj : objs) |
181 obj->deleteSelf(); |
181 obj->deleteSelf(); |
182 } |
182 } |
183 else |
183 else |
184 f.write ((obj->raw() + "\r\n").toUtf8()); |
184 f.write ((obj->asText() + "\r\n").toUtf8()); |
185 } |
185 } |
186 } |
186 } |
187 |
187 |
188 // ============================================================================= |
188 // ============================================================================= |
189 // ----------------------------------------------------------------------------- |
189 // ----------------------------------------------------------------------------- |