349 if (not dialog.exec()) |
359 if (not dialog.exec()) |
350 return; |
360 return; |
351 |
361 |
352 // Find a spot to place the new comment |
362 // Find a spot to place the new comment |
353 for (obj = currentDocument()->getObject (0); |
363 for (obj = currentDocument()->getObject (0); |
354 obj and obj->next() and not obj->next()->isScemantic(); |
364 obj and next(obj) and not next(obj)->isScemantic(); |
355 obj = obj->next()) |
365 obj = next(obj)) |
356 { |
366 { |
357 LDComment* comment = dynamic_cast<LDComment*> (obj); |
367 LDComment* comment = dynamic_cast<LDComment*> (obj); |
358 |
368 |
359 if (comment and comment->text().startsWith ("!HISTORY ")) |
369 if (comment and comment->text().startsWith ("!HISTORY ")) |
360 ishistory = true; |
370 ishistory = true; |
373 ui.m_username->text(), |
383 ui.m_username->text(), |
374 ui.m_comment->text())); |
384 ui.m_comment->text())); |
375 |
385 |
376 // If we're adding a history line right before a scemantic object, pad it |
386 // If we're adding a history line right before a scemantic object, pad it |
377 // an empty line |
387 // an empty line |
378 if (obj and obj->next() and obj->next()->isScemantic()) |
388 if (obj and next(obj) and next(obj)->isScemantic()) |
379 currentDocument()->emplaceAt<LDEmpty>(idx); |
389 currentDocument()->emplaceAt<LDEmpty>(idx); |
380 } |
390 } |
381 |
391 |
382 void AlgorithmToolset::splitLines() |
392 void AlgorithmToolset::splitLines() |
383 { |
393 { |