src/ldtypes.cpp

changeset 269
2d71227f35cb
parent 268
778eed342ee4
child 270
f5f2353af0d9
equal deleted inserted replaced
268:778eed342ee4 269:2d71227f35cb
79 79
80 str LDSubfile::getContents () { 80 str LDSubfile::getContents () {
81 str val = fmt ("1 %d %s ", color (), position ().stringRep (false).chars ()); 81 str val = fmt ("1 %d %s ", color (), position ().stringRep (false).chars ());
82 val += transform ().stringRep (); 82 val += transform ().stringRep ();
83 val += ' '; 83 val += ' ';
84 val += fileName; 84 val += fileInfo ()->name ();
85 return val; 85 return val;
86 } 86 }
87 87
88 str LDLine::getContents () { 88 str LDLine::getContents () {
89 str val = fmt ("2 %d", color ()); 89 str val = fmt ("2 %d", color ());
260 // ============================================================================= 260 // =============================================================================
261 vector<LDObject*> LDSubfile::inlineContents (bool deep, bool cache) { 261 vector<LDObject*> LDSubfile::inlineContents (bool deep, bool cache) {
262 vector<LDObject*> objs, objcache; 262 vector<LDObject*> objs, objcache;
263 263
264 // If we have this cached, just clone that 264 // If we have this cached, just clone that
265 if (deep && fileInfo->cache ().size ()) { 265 if (deep && fileInfo ()->cache ().size ()) {
266 for (LDObject* obj : fileInfo->cache ()) 266 for (LDObject* obj : fileInfo ()->cache ())
267 objs << obj->clone (); 267 objs << obj->clone ();
268 } else { 268 } else {
269 if (!deep) 269 if (!deep)
270 cache = false; 270 cache = false;
271 271
272 for (LDObject* obj : fileInfo->objs ()) { 272 for (LDObject* obj : *fileInfo ()) {
273 // Skip those without schemantic meaning 273 // Skip those without schemantic meaning
274 switch (obj->getType ()) { 274 switch (obj->getType ()) {
275 case LDObject::Comment: 275 case LDObject::Comment:
276 case LDObject::Empty: 276 case LDObject::Empty:
277 case LDObject::Gibberish: 277 case LDObject::Gibberish:
311 objs << obj->clone (); 311 objs << obj->clone ();
312 } 312 }
313 } 313 }
314 314
315 if (cache) 315 if (cache)
316 fileInfo->setCache (objcache); 316 fileInfo ()->setCache (objcache);
317 } 317 }
318 318
319 // Transform the objects 319 // Transform the objects
320 for (LDObject* obj : objs) { 320 for (LDObject* obj : objs) {
321 // Set the parent now so we know what inlined this. 321 // Set the parent now so we know what inlined this.

mercurial