summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocument_p.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qtextdocument_p.cpp')
-rw-r--r--src/gui/text/qtextdocument_p.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index 9e410b40af..8ce3ae4ac3 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -531,16 +531,17 @@ int QTextDocumentPrivate::remove_block(int pos, int *blockFormat, int command, Q
Q_ASSERT(b);
if (blocks.size(b) == 1 && command == QTextUndoCommand::BlockAdded) {
- Q_ASSERT((int)blocks.position(b) == pos);
-// qDebug("removing empty block");
- // empty block remove the block itself
+ Q_ASSERT((int)blocks.position(b) == pos);
+ // qDebug("removing empty block");
+ // empty block remove the block itself
} else {
- // non empty block, merge with next one into this block
-// qDebug("merging block with next");
- int n = blocks.next(b);
- Q_ASSERT((int)blocks.position(n) == pos + 1);
- blocks.setSize(b, blocks.size(b) + blocks.size(n) - 1);
- b = n;
+ // non empty block, merge with next one into this block
+ // qDebug("merging block with next");
+ int n = blocks.next(b);
+ Q_ASSERT((int)blocks.position(n) == pos + 1);
+ blocks.setSize(b, blocks.size(b) + blocks.size(n) - 1);
+ blocks.fragment(b)->userState = blocks.fragment(n)->userState;
+ b = n;
}
*blockFormat = blocks.fragment(b)->format;