summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextdocument_p.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index 9e410b40af..47d99a07de 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -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;