Commit 7c8f475d authored by Luke De Mouy's avatar Luke De Mouy

Clean up KoTextWriter and Loader to remove the changetracking code. Also...

Clean up KoTextWriter and Loader to remove the changetracking code.  Also completely remove the KoDeleteChangeMarker class.
parent 1132a199
......@@ -90,7 +90,6 @@ set(kotext_LIB_SRCS
changetracker/KoChangeTracker.cpp
changetracker/KoChangeTrackerElement.cpp
changetracker/KoDeleteChangeMarker.cpp
changetracker/KoFormatChangeInformation.cpp
changetracker/KoDeletedRowColumnDataStore.cpp
changetracker/KoDeletedRowData.cpp
......@@ -216,7 +215,6 @@ install(
FILES
changetracker/KoChangeTracker.h
changetracker/KoChangeTrackerElement.h
changetracker/KoDeleteChangeMarker.h
changetracker/KoDeletedRowColumnDataStore.h
changetracker/KoDeletedRowData.cpp
changetracker/KoDeletedColumnData.cpp
......
......@@ -69,7 +69,7 @@ KoInlineObject *KoInlineTextObjectManager::inlineTextObject(int id) const
return m_objects.value(id);
}
void KoInlineTextObjectManager::insertInlineObject(QTextCursor &cursor, KoInlineObject *object)
void KoInlineTextObjectManager::insertInlineObject(QTextCursor& cursor, KoInlineObject *object)
{
QTextCharFormat oldCf = cursor.charFormat();
// create a new format out of the old so that the current formatting is
......
......@@ -44,7 +44,6 @@
#include "KoInlineCite.h"
#include "changetracker/KoChangeTracker.h"
#include "changetracker/KoChangeTrackerElement.h"
#include "changetracker/KoDeleteChangeMarker.h"
#include "styles/KoCharacterStyle.h"
#include "styles/KoParagraphStyle.h"
#include "styles/KoStyleManager.h"
......
......@@ -25,7 +25,6 @@
#include "changetracker/KoChangeTracker.h"
#include "changetracker/KoChangeTrackerElement.h"
#include "changetracker/KoDeleteChangeMarker.h"
#include "styles/KoCharacterStyle.h"
#include "styles/KoParagraphStyle.h"
#include "styles/KoStyleManager.h"
......
......@@ -513,9 +513,8 @@ static KoListStyle::ListIdType ListId(const QTextListFormat &format)
return listId;
}
QTextDocumentFragment KoChangeTracker::generateDeleteFragment(const QTextCursor &cursor, KoDeleteChangeMarker *marker)
QTextDocumentFragment KoChangeTracker::generateDeleteFragment(const QTextCursor &cursor)
{
int changeId = marker->changeId();
QTextCursor editCursor(cursor);
QTextDocument *document = cursor.document();
......@@ -527,10 +526,7 @@ QTextDocumentFragment KoChangeTracker::generateDeleteFragment(const QTextCursor
for (int i = cursor.anchor();i <= cursor.position(); i++) {
if (document->characterAt(i) == QChar::ObjectReplacementCharacter) {
editCursor.setPosition(i+1);
KoDeleteChangeMarker *testMarker = dynamic_cast<KoDeleteChangeMarker*>(textObjectManager->inlineTextObject(editCursor));
if (testMarker)
editCursor.deletePreviousChar();
}
}
}
}
......@@ -538,57 +534,19 @@ QTextDocumentFragment KoChangeTracker::generateDeleteFragment(const QTextCursor
QTextBlock startBlock = currentBlock;
QTextBlock endBlock = document->findBlock(cursor.position()).next();
// First remove any left-over DeletedList set from previous deletes
for (;currentBlock != endBlock; currentBlock = currentBlock.next()) {
editCursor.setPosition(currentBlock.position());
if (editCursor.currentList()) {
if (editCursor.currentList()->format().hasProperty(KoDeleteChangeMarker::DeletedList)) {
QTextListFormat format = editCursor.currentList()->format();
format.clearProperty(KoDeleteChangeMarker::DeletedList);
editCursor.currentList()->setFormat(format);
}
}
}
currentBlock = document->findBlock(cursor.anchor());
startBlock = currentBlock;
endBlock = document->findBlock(cursor.position()).next();
for (;currentBlock != endBlock; currentBlock = currentBlock.next()) {
editCursor.setPosition(currentBlock.position());
if (editCursor.currentList()) {
if (!editCursor.currentList()->format().hasProperty(KoDeleteChangeMarker::DeletedList)) {
bool fullyDeletedList = checkListDeletion(*editCursor.currentList(), cursor);
QTextListFormat format = editCursor.currentList()->format();
format.setProperty(KoDeleteChangeMarker::DeletedList, fullyDeletedList);
if (fullyDeletedList) {
KoListStyle::ListIdType listId = ListId(format);
KoList *list = KoTextDocument(document).list(currentBlock);
marker->setDeletedListStyle(listId, list->style());
}
editCursor.currentList()->setFormat(format);
}
if (cursor.anchor() <= (currentBlock.position() - 1)) {
//Then the list-item has been deleted. Set the block-format to indicate that this is a deleted list-item.
QTextBlockFormat blockFormat;
blockFormat.setProperty(KoDeleteChangeMarker::DeletedListItem, true);
editCursor.mergeBlockFormat(blockFormat);
} else {
QTextBlockFormat blockFormat;
blockFormat.setProperty(KoDeleteChangeMarker::DeletedListItem, false);
editCursor.mergeBlockFormat(blockFormat);
}
}
if (editCursor.currentTable()) {
QTextTableFormat tableFormat = editCursor.currentTable()->format();
tableFormat.setProperty(KoCharacterStyle::ChangeTrackerId, changeId);
editCursor.currentTable()->setFormat(tableFormat);
}
if (currentBlock != startBlock) {
QTextBlockFormat blockFormat;
blockFormat.setProperty(KoCharacterStyle::ChangeTrackerId, changeId);
editCursor.mergeBlockFormat(blockFormat);
}
}
......@@ -617,12 +575,10 @@ bool KoChangeTracker::checkListDeletion(const QTextList &list, const QTextCursor
}
}
void KoChangeTracker::insertDeleteFragment(QTextCursor &cursor, KoDeleteChangeMarker *marker)
void KoChangeTracker::insertDeleteFragment(QTextCursor &cursor)
{
QTextDocumentFragment fragment = KoTextDocument(cursor.document()).changeTracker()->elementById(marker->changeId())->getDeleteData();
QTextDocument tempDoc;
QTextCursor tempCursor(&tempDoc);
tempCursor.insertFragment(fragment);
bool deletedListItem = false;
......@@ -655,18 +611,6 @@ void KoChangeTracker::insertDeleteFragment(QTextCursor &cursor, KoDeleteChangeMa
}
if (textList) {
if (textList->format().property(KoDeleteChangeMarker::DeletedList).toBool() && !currentList) {
//Found a Deleted List in the fragment. Create a new KoList.
KoListStyle::ListIdType listId;
if (sizeof(KoListStyle::ListIdType) == sizeof(uint))
listId = textList->format().property(KoListStyle::ListId).toUInt();
else
listId = textList->format().property(KoListStyle::ListId).toULongLong();
KoListStyle *style = marker->getDeletedListStyle(listId);
currentList = new KoList(cursor.document(), style);
}
deletedListItem = currentBlock.blockFormat().property(KoDeleteChangeMarker::DeletedListItem).toBool();
if (deletedListItem && currentBlock != tempDoc.begin()) {
// Found a deleted list item in the fragment. So insert a new list-item
int deletedListItemLevel = KoList::level(currentBlock);
......@@ -757,7 +701,6 @@ int KoChangeTracker::fragmentLength(const QTextDocumentFragment &fragment)
for (QTextBlock currentBlock = tempDoc.begin(); currentBlock != tempDoc.end(); currentBlock = currentBlock.next()) {
tempCursor.setPosition(currentBlock.position());
if (tempCursor.currentList()) {
deletedListItem = currentBlock.blockFormat().property(KoDeleteChangeMarker::DeletedListItem).toBool();
if (currentBlock != tempDoc.begin() && deletedListItem)
length += 1; //For the Block separator
} else if (tempCursor.currentTable()) {
......
......@@ -31,7 +31,6 @@
class KoXmlElement;
class KoChangeTrackerElement;
class KoFormatChangeInformation;
class KoDeleteChangeMarker;
class QTextCursor;
class QTextFormat;
......@@ -110,8 +109,8 @@ public:
void loadOdfChanges(const KoXmlElement& element);
int getLoadedChangeId(const QString &odfId) const;
static QTextDocumentFragment generateDeleteFragment(const QTextCursor &cursor, KoDeleteChangeMarker *marker);
static void insertDeleteFragment(QTextCursor &cursor, KoDeleteChangeMarker *marker);
static QTextDocumentFragment generateDeleteFragment(const QTextCursor& cursor);
static void insertDeleteFragment(QTextCursor &cursor);
static int fragmentLength(const QTextDocumentFragment &fragment);
QString authorName() const;
......
......@@ -37,7 +37,6 @@ public:
QString extraMetaData;
//These two elements are valid for delete changes. Need to move it to a sub-class
QTextDocumentFragment deleteFragment;
KoDeleteChangeMarker *marker;
bool enabled;
bool acceptedRejected;
......@@ -51,7 +50,6 @@ KoChangeTrackerElement::KoChangeTrackerElement(const QString& title, KoGenChange
d->type = type;
d->acceptedRejected = false;
d->valid = true;
d->marker = NULL;
}
KoChangeTrackerElement::KoChangeTrackerElement()
......@@ -208,15 +206,4 @@ void KoChangeTrackerElement::setDeleteData(const QTextDocumentFragment& fragment
QTextDocumentFragment KoChangeTrackerElement::getDeleteData() const
{
return d->deleteFragment;
}
void KoChangeTrackerElement::setDeleteChangeMarker(KoDeleteChangeMarker *marker)
{
d->marker = marker;
}
KoDeleteChangeMarker *KoChangeTrackerElement::getDeleteChangeMarker()
{
return d->marker;
}
}
\ No newline at end of file
......@@ -28,7 +28,6 @@
#include <KoGenChange.h>
#include "kotext_export.h"
#include "KoDeleteChangeMarker.h"
class KOTEXT_EXPORT KoChangeTrackerElement
......@@ -81,8 +80,6 @@ public:
void setDeleteData(const QTextDocumentFragment& fragment);
QTextDocumentFragment getDeleteData() const;
void setDeleteChangeMarker(KoDeleteChangeMarker *marker);
KoDeleteChangeMarker *getDeleteChangeMarker();
private:
class Private;
......
/* This file is part of the KDE project
* Copyright (C) 2009 Pierre Stirnweiss <pstirnweiss@googlemail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "KoDeleteChangeMarker.h"
//Calligra includes
#include <KoTextDocument.h>
#include <KoXmlReader.h>
#include <KoXmlWriter.h>
#include <KoTextShapeSavingContext.h>
#include <KoShapeLoadingContext.h>
#include <opendocument/KoTextSharedSavingData.h>
#include "KoChangeTrackerElement.h"
#include "KoChangeTracker.h"
//KDE includes
#include <kdebug.h>
//Qt includes
#include <QFontMetrics>
#include <QTextDocument>
#include <QTextInlineObject>
#include <QPainter>
/*********************************** ODF Bug Work-around code **********************************************/
const QString KoDeleteChangeMarker::RDFListName("http://www.calligra.org/list#");
const QString KoDeleteChangeMarker::RDFListItemName("http://www.calligra.org/list-item#");
const QString KoDeleteChangeMarker::RDFListValidity("http://www.kofficde.org/list-status#valid");
const QString KoDeleteChangeMarker::RDFListItemValidity("http://www.calligra.org/list-item-status#valid");
const QString KoDeleteChangeMarker::RDFListLevel("http://www.calligra.org/list-status#level");
const QString KoDeleteChangeMarker::RDFDeleteChangeContext("http://www.calligra.org/deleteChangeMetadata");
/***********************************************************************************************************/
class KoDeleteChangeMarker::Private
{
public:
Private() {}
KoChangeTracker *changeTracker;
QTextDocument *document;
QString text;
int id;
int position;
QString deleteChangeXml;
QHash<KoListStyle::ListIdType, KoListStyle *> deletedListStyles;
};
KoDeleteChangeMarker::KoDeleteChangeMarker(KoChangeTracker* changeTracker)
: d(new Private())
{
d->changeTracker = changeTracker;
d->document = 0;
}
KoDeleteChangeMarker::~KoDeleteChangeMarker()
{
delete d;
}
/*
void KoDeleteChangeMarker::setText (const QString& text)
{
d->text = text;
}
QString KoDeleteChangeMarker::text() const
{
return d->text;
}
*/
void KoDeleteChangeMarker::setChangeId (int id)
{
d->id = id;
}
int KoDeleteChangeMarker::changeId() const
{
return d->id;
}
int KoDeleteChangeMarker::position() const
{
return d->position;
}
bool KoDeleteChangeMarker::loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context)
{
Q_UNUSED(element)
Q_UNUSED(context);
return false;
}
void KoDeleteChangeMarker::paint(QPainter& painter, QPaintDevice *pd, const QTextDocument *document, const QRectF &rect, QTextInlineObject object, int posInDocument, const QTextCharFormat &format)
{
Q_UNUSED(painter);
Q_UNUSED(pd);
Q_UNUSED(document);
Q_UNUSED(rect);
Q_UNUSED(posInDocument);
Q_UNUSED(object);
Q_UNUSED(format);
}
void KoDeleteChangeMarker::resize(const QTextDocument *document, QTextInlineObject object, int posInDocument, const QTextCharFormat &format, QPaintDevice *pd)
{
Q_UNUSED(document);
Q_UNUSED(object);
Q_UNUSED(format);
Q_UNUSED(pd);
Q_UNUSED(document);
d->position = posInDocument;
object.setWidth(0);
}
void KoDeleteChangeMarker::updatePosition(const QTextDocument *document, int posInDocument, const QTextCharFormat &format)
{
d->position = posInDocument;
if (document != d->document)
d->document = const_cast<QTextDocument*>(document); //TODO: when we get rid of the current visualization of deleted changes (ie inserting them in the doc), we can get rid of this.
Q_UNUSED(format);
}
QTextDocument* KoDeleteChangeMarker::document() const
{
return d->document;
}
void KoDeleteChangeMarker::saveOdf(KoShapeSavingContext &context)
{
KoGenChange change;
if (d->changeTracker->saveFormat() == KoChangeTracker::ODF_1_2) {
change.setChangeFormat(KoGenChange::ODF_1_2);
} else {
change.setChangeFormat(KoGenChange::DELTAXML);
}
QString changeName;
KoTextSharedSavingData *sharedData = 0;
if (context.sharedData(KOTEXT_SHARED_SAVING_ID)) {
sharedData = dynamic_cast<KoTextSharedSavingData*>(context.sharedData(KOTEXT_SHARED_SAVING_ID));
if (!sharedData) {
kWarning(32500) << "There is no KoTextSharedSavingData in the context. This should not be the case";
return;
}
}
d->changeTracker->saveInlineChange(d->id, change);
change.addChildElement("deleteChangeXml", d->deleteChangeXml);
changeName = sharedData->genChanges().insert(change);
context.xmlWriter().startElement("text:change", false);
context.xmlWriter().addAttribute("text:change-id", changeName);
context.xmlWriter().endElement();
}
void KoDeleteChangeMarker::setDeleteChangeXml(QString &deleteChangeXml)
{
d->deleteChangeXml = deleteChangeXml;
}
void KoDeleteChangeMarker::setDeletedListStyle(KoListStyle::ListIdType id, KoListStyle *style)
{
d->deletedListStyles.insert(id, style);
}
KoListStyle *KoDeleteChangeMarker::getDeletedListStyle(KoListStyle::ListIdType id)
{
return d->deletedListStyles.value(id);
}
/* This file is part of the KDE project
* Copyright (C) 2009 Pierre Stirnweiss <pstirnweiss@googlemail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KODELETECHANGEMARKER_H
#define KODELETECHANGEMARKER_H
#include "kotext_export.h"
#include <KoInlineObject.h>
#include <QTextFormat>
#include <KoListStyle.h>
class KoChangeTracker;
class KoXmlElement;
class QTextDocument;
class KOTEXT_EXPORT KoDeleteChangeMarker : public KoInlineObject
{
Q_OBJECT
public:
typedef enum {
DeletedListItem = QTextFormat::UserProperty + 9999,
DeletedList
} listDeleteStatus;
/************************************ODF Bug (List Delete Changes) Workaround code *****************************/
static const QString RDFListName;
static const QString RDFListItemName;
static const QString RDFListValidity;
static const QString RDFListItemValidity;
static const QString RDFListLevel;
static const QString RDFDeleteChangeContext;
/****************************************************************************************************************/
explicit KoDeleteChangeMarker(KoChangeTracker *changeTracker);
virtual ~KoDeleteChangeMarker();
/**
* Store the deleted text.
* @param text the deleted text
*/
// void setText(const QString &text);
/// return the deleted text
// QString text() const;
/**
* Set the changeTracker id for this change.
* @param id the new id
*/
void setChangeId(int id);
/// return the change id
int changeId() const;
///Return the position of the marker in the document
int position() const;
///Return the document this marker belongs to.
QTextDocument* document() const;
virtual bool loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context);
///reimplemented
virtual void saveOdf(KoShapeSavingContext &context);
void setDeleteChangeXml(QString &deleteChangeXml);
KoListStyle *getDeletedListStyle(KoListStyle::ListIdType id);
void setDeletedListStyle(KoListStyle::ListIdType, KoListStyle *style);
virtual void updatePosition(const QTextDocument *document, int posInDocument, const QTextCharFormat &format);
protected:
virtual void paint(QPainter &painter, QPaintDevice *pd, const QTextDocument *document, const QRectF &rect, QTextInlineObject object, int posInDocument, const QTextCharFormat &format);
virtual void resize(const QTextDocument *document, QTextInlineObject object, int posInDocument, const QTextCharFormat &format, QPaintDevice *pd);
private:
class Private;
Private * const d;
};
#endif // KODELETECHANGEMARKER_H
......@@ -228,8 +228,6 @@ void ChangeTrackedDeleteCommand::deleteSelection(KoTextEditor *editor)
// XXX: don't allow anyone to steal our cursor!
QTextCursor *selection = editor->cursor();
QTextCursor checker = QTextCursor(*editor->cursor());
KoDeleteChangeMarker *deleteChangemarker = 0;
KoDeleteChangeMarker *testMarker;
bool backwards = (checker.anchor() > checker.position());
int selectionBegin = qMin(checker.anchor(), checker.position());
......@@ -247,23 +245,11 @@ void ChangeTrackedDeleteCommand::deleteSelection(KoTextEditor *editor)
QChar charAtPos = m_document.data()->characterAt(checker.position());
checker.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
if (inlineTextObjectManager->inlineTextObject(checker) && charAtPos == QChar::ObjectReplacementCharacter) {
testMarker = dynamic_cast<KoDeleteChangeMarker*>(inlineTextObjectManager->inlineTextObject(checker));
if (testMarker) {
QTextDocumentFragment inter = KoTextDocument(m_document).changeTracker()->elementById(testMarker->changeId())->getDeleteData();
if (!KoTextDocument(m_document).changeTracker()->displayChanges()) {
KoChangeTracker::insertDeleteFragment(checker, testMarker);
selectionEnd = selectionEnd + KoChangeTracker::fragmentLength(inter);
}
checker.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, KoChangeTracker::fragmentLength(inter));
KoTextDocument(m_document).changeTracker()->elementById(testMarker->changeId())->setValid(false);
m_removedElements.push_back(testMarker->changeId());
} else {
/* This has changed but since this entire command is going away - let's not bother
/* This has changed but since this entire command is going away - let's not bother
KoTextAnchor *anchor = dynamic_cast<KoTextAnchor *>(inlineTextObjectManager->inlineTextObject(checker));
if (anchor)
shapesInSelection.push_back(anchor->shape());
*/
}
*/
}
checker.setPosition(checker.position());
}
......@@ -272,15 +258,6 @@ void ChangeTrackedDeleteCommand::deleteSelection(KoTextEditor *editor)
if (!KoTextDocument(m_document).changeTracker()->displayChanges()) {
QChar charAtPos = m_document.data()->characterAt(checker.position() - 1);
if (inlineTextObjectManager->inlineTextObject(checker) && charAtPos == QChar::ObjectReplacementCharacter) {
testMarker = dynamic_cast<KoDeleteChangeMarker*>(inlineTextObjectManager->inlineTextObject(checker));
if (testMarker) {
KoChangeTracker::insertDeleteFragment(checker, testMarker);
QTextDocumentFragment prevFragment = KoTextDocument(checker.document()).changeTracker()->elementById(testMarker->changeId())->getDeleteData();
selectionBegin += KoChangeTracker::fragmentLength(prevFragment);
selectionEnd += KoChangeTracker::fragmentLength(prevFragment);
}
}
}
if (KoTextDocument(m_document).changeTracker()->containsInlineChanges(checker.charFormat())) {
......@@ -297,17 +274,6 @@ void ChangeTrackedDeleteCommand::deleteSelection(KoTextEditor *editor)
if (!checker.atEnd()) {
QChar charAtPos = m_document.data()->characterAt(checker.position());
checker.movePosition(QTextCursor::NextCharacter);
if (inlineTextObjectManager->inlineTextObject(checker) && charAtPos == QChar::ObjectReplacementCharacter) {
testMarker = dynamic_cast<KoDeleteChangeMarker*>(inlineTextObjectManager->inlineTextObject(checker));
if (testMarker) {
QTextDocumentFragment sufix = KoTextDocument(m_document).changeTracker()->elementById(testMarker->changeId())->getDeleteData();
if (!KoTextDocument(m_document).changeTracker()->displayChanges())
KoChangeTracker::insertDeleteFragment(checker, testMarker);
selectionEnd += KoChangeTracker::fragmentLength(sufix) + 1;
KoTextDocument(m_document).changeTracker()->elementById(testMarker->changeId())->setValid(false);
m_removedElements.push_back(testMarker->changeId());
}
}
}
selection->setPosition(selectionBegin);
......@@ -315,15 +281,12 @@ void ChangeTrackedDeleteCommand::deleteSelection(KoTextEditor *editor)
QTextDocumentFragment deletedFragment;
changeId = KoTextDocument(m_document).changeTracker()->getDeleteChangeId(i18n("Delete"), deletedFragment, 0);
KoChangeTrackerElement *element = KoTextDocument(m_document).changeTracker()->elementById(changeId);
deleteChangemarker = new KoDeleteChangeMarker(KoTextDocument(m_document).changeTracker());
deleteChangemarker->setChangeId(changeId);
element->setDeleteChangeMarker(deleteChangemarker);
QTextCharFormat charFormat;
charFormat.setProperty(KoCharacterStyle::ChangeTrackerId, changeId);
selection->mergeCharFormat(charFormat);
deletedFragment = KoChangeTracker::generateDeleteFragment(*selection, deleteChangemarker);
deletedFragment = KoChangeTracker::generateDeleteFragment(*selection);
element->setDeleteData(deletedFragment);
//Store the position and length. Will be used in updateListChanges()
......@@ -331,14 +294,13 @@ void ChangeTrackedDeleteCommand::deleteSelection(KoTextEditor *editor)
m_length = qAbs(selection->anchor() - selection->position());
updateListIds(*editor->cursor());
inlineTextObjectManager->insertInlineObject(*selection, deleteChangemarker);
m_addedChangeElement = changeId;