X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FUndo.h;h=6f6cca6e90e968ee46c87d591a27fe97f82fd0a4;hb=a41d589e851a956ff27235841e6330bab552c0fe;hp=1bd6450d7c3a03749952c322961a87c6d51e1099;hpb=b63421b7dc65e0c721f8928d1330b9bb2cff43d8;p=lyx.git diff --git a/src/Undo.h b/src/Undo.h index 1bd6450d7c..6f6cca6e90 100644 --- a/src/Undo.h +++ b/src/Undo.h @@ -47,6 +47,9 @@ enum UndoKind { class Undo { + /// noncopyable + Undo(Undo const &); + void operator=(Undo const &); public: Undo(Buffer &); @@ -85,7 +88,7 @@ public: /** * This cursor takes precedence over what is passed to recordUndo. * In the case of nested groups, only the first cur_before is - * taken in account. The cursor is reset at the end of the + * taken into account. The cursor is reset at the end of the * top-level group. */ void beginUndoGroup(CursorData const & cur_before); @@ -93,6 +96,8 @@ public: 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. /** @@ -132,15 +137,9 @@ private: */ 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. @@ -148,7 +147,8 @@ public: void resetBuffer(Buffer * buf); private: - Buffer * buffer_; + class Impl; + Impl * const d; };