This aloows to se the the `before' cursor of the undo group.
Not used for now.
+UndoGroupHelper::UndoGroupHelper(CursorData & cur) : d(new UndoGroupHelper::Impl)
+{
+ resetBuffer(cur);
+}
+
+
UndoGroupHelper::~UndoGroupHelper()
{
for (Buffer * buf : d->buffers_)
UndoGroupHelper::~UndoGroupHelper()
{
for (Buffer * buf : d->buffers_)
void UndoGroupHelper::resetBuffer(Buffer * buf)
{
if (buf && d->buffers_.count(buf) == 0) {
void UndoGroupHelper::resetBuffer(Buffer * buf)
{
if (buf && d->buffers_.count(buf) == 0) {
+void UndoGroupHelper::resetBuffer(CursorData & cur)
+{
+ if (!cur.empty() && d->buffers_.count(cur.buffer()) == 0) {
+ d->buffers_.insert(cur.buffer());
+ cur.buffer()->undo().beginUndoGroup(cur);
+ }
+}
+
+
public:
// Begin a new undo group for buffer \c buf.
UndoGroupHelper(Buffer * buf);
public:
// Begin a new undo group for buffer \c buf.
UndoGroupHelper(Buffer * buf);
+ // Begin an undo group for the buffer of \c cur with the the
+ // `before' cursor set to \c cur.
+ UndoGroupHelper(CursorData & cur);
// End all active undo groups.
~UndoGroupHelper();
// Begin if needed an undo group for buffer \c buf.
void resetBuffer(Buffer * buf);
// End all active undo groups.
~UndoGroupHelper();
// Begin if needed an undo group for buffer \c buf.
void resetBuffer(Buffer * buf);
+ // Begin if needed an undo group for the buffer of \c cur with the
+ // the `before' cursor set to \c cur.
+ void resetBuffer(CursorData & cur);
private:
class Impl;
Impl * const d;
private:
class Impl;
Impl * const d;