summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocument_p.h
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2009-08-20 16:04:22 (GMT)
committermae <qt-info@nokia.com>2009-08-20 16:10:55 (GMT)
commit735bed15d94c441c0d071bfbe26bc088791275b9 (patch)
tree75e0b5f3d01ffcc00a92d8a88c3cbd36f8b2e7db /src/gui/text/qtextdocument_p.h
parent9933000d86bd9560769cb900b9e22083a073d837 (diff)
downloadQt-735bed15d94c441c0d071bfbe26bc088791275b9.zip
Qt-735bed15d94c441c0d071bfbe26bc088791275b9.tar.gz
Qt-735bed15d94c441c0d071bfbe26bc088791275b9.tar.bz2
Fix undo/redo of single-command edit blocks
(with QTextCursor::beginEditBlock() and QTextCursor::endEditBlock()) Previously QTextDocument would treat single command blocks as if there was no block, i.e. command compression would occur, causing tst_QTextDocument::testUndoBlocks() to fail. The patch completes the insufficient block-flag of QTextUndoCommand with an addition flag block_end. The block-flag itself is renamed to block_part. Reviewed-by: con
Diffstat (limited to 'src/gui/text/qtextdocument_p.h')
-rw-r--r--src/gui/text/qtextdocument_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h
index 55aa17e..363309c 100644
--- a/src/gui/text/qtextdocument_p.h
+++ b/src/gui/text/qtextdocument_p.h
@@ -139,7 +139,9 @@ public:
MoveCursor = 1
};
quint16 command;
- quint8 block; ///< All undo commands that have this set to true are combined with the preceding command on undo/redo.
+ uint block_part : 1; // all commands that are part of an undo block (including the first and the last one) have this set to 1
+ uint block_end : 1; // the last command in an undo block has this set to 1.
+ uint block_padding : 6; // padding since block used to be a quint8
quint8 operation;
int format;
quint32 strPos;