Sort PSFILE and PS reminders with same priority (Ticket #17581)

This commit is contained in:
David F. Skoll
2010-04-19 13:17:00 -04:00
parent b1063b0a9e
commit bd9a3761a6
5 changed files with 24 additions and 3 deletions

View File

@@ -32,6 +32,17 @@
#define SPECIAL_WEEK 5
#define SPECIAL_SHADE 6
/* Array holding how specials sort */
static int SpecialSortOrder[] = {
0, /* NORMAL */
1, /* POSTSCRIPT */
1, /* PSFILE */
2, /* MOON */
0, /* COLOR */
4, /* WEEK */
5 /* SHADE */
};
typedef struct calentry {
struct calentry *next;
int special;
@@ -338,11 +349,11 @@ void DoPsCal(void)
d = PsEntries[DayNum];
p = NULL;
/* Slot it into the right place */
while (d->next && (c->special <= d->special)) {
while (d->next && (SpecialSortOrder[c->special] <= SpecialSortOrder[d->special])) {
p = d;
d = d->next;
}
if (c->special <= d->special) {
if (SpecialSortOrder[c->special] <= SpecialSortOrder[d->special]) {
c->next = d->next;
d->next = c;
} else {

1
tests/file.ps Normal file
View File

@@ -0,0 +1 @@
(Second-Bit-Of-PS)

1
tests/file2.ps Normal file
View File

@@ -0,0 +1 @@
(Fourth-Bit-Of-PS)

View File

@@ -15,6 +15,11 @@ IF $PSCAL
[trigger(moondate(3))] SPECIAL MOON 3 -1 -1 [moontime(3)]
ENDIF
REM 4 PS (First-Bit-Of-PS)
REM 4 PSFILE file.ps
REM 4 PS (Third-Bit-Of-PS)
REM 4 PSFILE file2.ps
REM Mon SPECIAL SHADE 255 255 255
REM Tue SPECIAL SHADE 255 255 204
REM Wed SPECIAL SHADE 255 204 255

View File

@@ -2527,7 +2527,10 @@ _A BoxHeight _A sub lineto closepath
BoxWidth _A sub _A lineto BoxWidth _A sub BoxHeight _A sub lineto
_A BoxHeight _A sub lineto closepath
1 1 0.8 setrgbcolor fill 0.0 setgray
(First-Bit-Of-PS)
(Second-Bit-Of-PS)
(Third-Bit-Of-PS)
(Fourth-Bit-Of-PS)
SAVESTATE restore
/SAVESTATE save def
3 xincr mul MinX add ytop translate