summaryrefslogtreecommitdiff
path: root/marks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'marks.cpp')
-rw-r--r--marks.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/marks.cpp b/marks.cpp
index 5c4d8f3..e8fb449 100644
--- a/marks.cpp
+++ b/marks.cpp
@@ -111,26 +111,40 @@ clMark *clMarks::Get(int Position)
return mark;
}
-clMark *clMarks::GetPrev(int Position)
+clMark *clMarks::GetPrev(int Position, int Type)
{
if (!first) return NULL; // no elements yet
clMark *mark=first;
while (mark)
{
- if (mark->position>=Position) break;
+ if (Type==0xFF)
+ {
+ if (mark->position>=Position) break;
+ }
+ else
+ {
+ if ((mark->position>=Position) && (mark->type==Type)) break;
+ }
mark=mark->Next();
}
return mark->Prev();
}
-clMark *clMarks::GetNext(int Position)
+clMark *clMarks::GetNext(int Position, int Type)
{
if (!first) return NULL; // no elements yet
clMark *mark=first;
while (mark)
{
- if (mark->position>=Position) break;
+ if (Type==0xFF)
+ {
+ if (mark->position>=Position) break;
+ }
+ else
+ {
+ if ((mark->position>=Position) && (mark->type==Type)) break;
+ }
mark=mark->Next();
}
return mark->Next();