void endUndoGroup();
/// end the current undo group and set UndoElement::cur_after if necessary.
void endUndoGroup(CursorData const & cur_after);
+ /// return true if an undo group is open and contains at least one element
+ bool activeUndoGroup() const;
/// The general case: record undo information for an arbitrary range.
/**
*/
class UndoGroupHelper {
public:
- UndoGroupHelper(Buffer * buf) : buffer_(0)
- {
- resetBuffer(buf);
- }
+ UndoGroupHelper(Buffer * buf = 0);
- ~UndoGroupHelper()
- {
- resetBuffer(0);
- }
+ ~UndoGroupHelper();
/** Close the current undo group if necessary and create a new one
* for buffer \c buf.
void resetBuffer(Buffer * buf);
private:
- Buffer * buffer_;
+ class Impl;
+ Impl * const d;
};