a few fixes related to box removal (as expected)

This commit is contained in:
Thomas Jensen 1999-06-03 19:24:14 +00:00
parent 4a01a9254b
commit c0b7322493

View File

@ -3,7 +3,7 @@
* Date created: March 18, 1999 (Thursday, 15:09h) * Date created: March 18, 1999 (Thursday, 15:09h)
* Author: Thomas Jensen * Author: Thomas Jensen
* tsjensen@stud.informatik.uni-erlangen.de * tsjensen@stud.informatik.uni-erlangen.de
* Version: $Id: boxes.c,v 1.9 1999/04/09 13:33:24 tsjensen Exp tsjensen $ * Version: $Id: boxes.c,v 1.10 1999/06/03 18:54:05 tsjensen Exp tsjensen $
* Language: ANSI C * Language: ANSI C
* Platforms: sunos5/sparc, for now * Platforms: sunos5/sparc, for now
* World Wide Web: http://home.pages.de/~jensen/boxes/ * World Wide Web: http://home.pages.de/~jensen/boxes/
@ -18,6 +18,10 @@
* Revision History: * Revision History:
* *
* $Log: boxes.c,v $ * $Log: boxes.c,v $
* Revision 1.10 1999/06/03 18:54:05 tsjensen
* lots of fixes
* Added remove box functionality, which remains to be tested
*
* Revision 1.9 1999/04/09 13:33:24 tsjensen * Revision 1.9 1999/04/09 13:33:24 tsjensen
* Removed code related to OFFSET blocks (obsolete) * Removed code related to OFFSET blocks (obsolete)
* *
@ -79,7 +83,7 @@ extern int optind, opterr, optopt; /* for getopt() */
static const char rcsid_boxes_c[] = static const char rcsid_boxes_c[] =
"$Id: boxes.c,v 1.9 1999/04/09 13:33:24 tsjensen Exp tsjensen $"; "$Id: boxes.c,v 1.10 1999/06/03 18:54:05 tsjensen Exp tsjensen $";
extern FILE *yyin; /* lex input file */ extern FILE *yyin; /* lex input file */
@ -2399,6 +2403,7 @@ int detect_horiz (const int aside, size_t *hstart, size_t *hend)
/* /*
* Look for east corner shape * Look for east corner shape
*/ */
if (wcs) {
cs = opt.design->shape + sides[aside][aside==BTOP?SHAPES_PER_SIDE-1:0]; cs = opt.design->shape + sides[aside][aside==BTOP?SHAPES_PER_SIDE-1:0];
ecs_save = ecs; ecs_save = ecs;
ecs = strrstr (p, cs->chars[follow], cs->width, goeast); ecs = strrstr (p, cs->chars[follow], cs->width, goeast);
@ -2415,6 +2420,7 @@ int detect_horiz (const int aside, size_t *hstart, size_t *hend)
goeast = 0; goeast = 0;
ecs = ecs_save; ecs = ecs_save;
} }
}
#ifdef DEBUG #ifdef DEBUG
if (ecs) if (ecs)
fprintf (stderr, "East corner shape matched at position %d.\n", fprintf (stderr, "East corner shape matched at position %d.\n",
@ -2551,6 +2557,10 @@ int remove_box()
textend = 0; textend = 0;
boxend = 0; boxend = 0;
detect_horiz (BBOT, &textend, &boxend); detect_horiz (BBOT, &textend, &boxend);
if (textend == 0 && boxend == 0) {
textend = input.anz_lines;
boxend = input.anz_lines;
}
#ifdef DEBUG #ifdef DEBUG
fprintf (stderr, "----> Last line of box body (text) is %d, ", textend-1); fprintf (stderr, "----> Last line of box body (text) is %d, ", textend-1);
fprintf (stderr, "last line of box is %d.\n", boxend-1); fprintf (stderr, "last line of box is %d.\n", boxend-1);
@ -2569,7 +2579,7 @@ int remove_box()
return 1; /* internal error */ return 1; /* internal error */
if (m == 0) { if (m == 0) {
#ifdef DEBUG #ifdef DEBUG
fprintf (stderr, "line %d: no side match\n", j); fprintf (stderr, "line %2d: no side match\n", j);
#endif #endif
} }
if (m > 0) { if (m > 0) {