diff options
Diffstat (limited to 'command/marks.cpp')
-rw-r--r-- | command/marks.cpp | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/command/marks.cpp b/command/marks.cpp index 67358fc..929589b 100644 --- a/command/marks.cpp +++ b/command/marks.cpp @@ -32,7 +32,7 @@ clMark::~clMark() clMarks::~clMarks() { - Clear(); + DelAll(); } int clMarks::Count(int Type) @@ -64,25 +64,50 @@ void clMarks::Del(int Type) } } -void clMarks::Clear(int Before) +void clMarks::DelTill(int Position, bool FromStart) { clMark *next,*mark=first; + if (!FromStart) + { + while (mark) + { + if (mark->position>Position) break; + mark=mark->Next(); + } + } + while (mark) { next=mark->Next(); - if (mark->position<Before) + if (FromStart) + { + if (mark->position<Position) + { + Del(mark); + } + } + else { Del(mark); } mark=next; } - if (Before==0x7FFFFFFF) +} + +void clMarks::DelAll() +{ + clMark *next,*mark=first; + while (mark) { - first=NULL; - last=NULL; + next=mark->Next(); + Del(mark); + mark=next; } + first=NULL; + last=NULL; } + void clMarks::Del(clMark *Mark) { if (!Mark) return; |