int KoChangeTracker::getDeleteChangeId(const KUndo2MagicString &title, const QTextDocumentFragment &selection, int existingChangeId) { if ( existingChangeId ) { d->children.insert(existingChangeId, d->changeId); d->parents.insert(d->changeId, existingChangeId); } KoChangeTrackerElement *changeElement = new KoChangeTrackerElement(title, KoGenChange::DeleteChange); changeElement->setDate(KDateTime::currentLocalDateTime().toString(KDateTime::ISODate).replace(KGlobal::locale()->decimalSymbol(), QString("."))); changeElement->setCreator(d->changeAuthorName); changeElement->setDeleteData(selection); changeElement->setEnabled(d->recordChanges); d->changes.insert(d->changeId, changeElement); return d->changeId++; }
int KoChangeTracker::getDeleteChangeId(QString title, QTextDocumentFragment selection, int existingChangeId) { if ( existingChangeId ) { d->m_childs.insert(existingChangeId, d->m_changeId); d->m_parents.insert(d->m_changeId, existingChangeId); } KoChangeTrackerElement *changeElement = new KoChangeTrackerElement(title, KoGenChange::deleteChange); changeElement->setDate(KDateTime::currentLocalDateTime().toString(KDateTime::ISODate)); changeElement->setCreator(QString("essai delete")); //TODO preserve formating info there. this will do for now changeElement->setDeleteData(selection.toPlainText()); changeElement->setEnabled(d->m_enabled); d->m_changes.insert(d->m_changeId, changeElement); return d->m_changeId++; }