src/gui/text/qtextdocument_p.h
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   210     inline bool isUndoRedoEnabled() const { return undoEnabled; }
   210     inline bool isUndoRedoEnabled() const { return undoEnabled; }
   211 
   211 
   212     inline bool isUndoAvailable() const { return undoEnabled && undoState > 0; }
   212     inline bool isUndoAvailable() const { return undoEnabled && undoState > 0; }
   213     inline bool isRedoAvailable() const { return undoEnabled && undoState < undoStack.size(); }
   213     inline bool isRedoAvailable() const { return undoEnabled && undoState < undoStack.size(); }
   214 
   214 
       
   215     inline int availableUndoSteps() const { return undoEnabled ? undoState : 0; }
       
   216     inline int availableRedoSteps() const { return undoEnabled ? qMax(undoStack.size() - undoState - 1, 0) : 0; }
       
   217 
   215     inline QString buffer() const { return text; }
   218     inline QString buffer() const { return text; }
   216     QString plainText() const;
   219     QString plainText() const;
   217     inline int length() const { return fragments.length(); }
   220     inline int length() const { return fragments.length(); }
   218 
   221 
   219     inline QTextFormatCollection *formatCollection() { return &formats; }
   222     inline QTextFormatCollection *formatCollection() { return &formats; }