Memory leak in Input_ #716
This commit is contained in:
parent
7e2defc10d
commit
afd3fde5de
@ -384,9 +384,15 @@ public:
|
||||
/* Undo previous changes to the text buffer. */
|
||||
int undo();
|
||||
|
||||
/* Return true if the last operation can be undone. */
|
||||
bool can_undo();
|
||||
|
||||
/* Redo previous undo operations. */
|
||||
int redo();
|
||||
|
||||
/* Return true if there is a redo action in the list. */
|
||||
bool can_redo();
|
||||
|
||||
/* Copy the yank buffer to the clipboard. */
|
||||
int copy_cuts();
|
||||
|
||||
|
@ -88,6 +88,10 @@ public:
|
||||
clear();
|
||||
}
|
||||
|
||||
int size() const {
|
||||
return list_size_;
|
||||
}
|
||||
|
||||
void push(Fl_Input_Undo_Action* action) {
|
||||
if (list_size_ == list_capacity_) {
|
||||
list_capacity_ += 25;
|
||||
@ -1066,6 +1070,15 @@ int Fl_Input_::undo() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
Check if the last operation can be undone.
|
||||
|
||||
\return true if the widget can unod the last change
|
||||
*/
|
||||
bool Fl_Input_::can_undo() {
|
||||
return (undo_->undocut || undo_->undoinsert);
|
||||
}
|
||||
|
||||
/**
|
||||
Redo previous undo operation.
|
||||
|
||||
@ -1080,6 +1093,8 @@ int Fl_Input_::redo() {
|
||||
|
||||
if (undo_->undocut || undo_->undoinsert)
|
||||
undo_list_->push(undo_);
|
||||
else
|
||||
delete undo_;
|
||||
undo_ = redo_action;
|
||||
|
||||
int ret = apply_undo();
|
||||
@ -1088,6 +1103,15 @@ int Fl_Input_::redo() {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
Check if there is a redo action available.
|
||||
|
||||
\return true if the widget can redo the last undo action
|
||||
*/
|
||||
bool Fl_Input_::can_redo() {
|
||||
return (redo_list_->size() > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
Copies the \e yank buffer to the clipboard.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user