Bugfix: For non-empty left box sides, spaces belonging to "empty" shape

lines were not properly removed in some cases
This commit is contained in:
Thomas Jensen 1999-11-08 10:51:41 +00:00
parent 3f2f687128
commit 85d76ebb6a

View File

@ -4,7 +4,7 @@
* Date created: June 23, 1999 (Wednesday, 20:59h)
* Author: Copyright (C) 1999 Thomas Jensen
* tsjensen@stud.informatik.uni-erlangen.de
* Version: $Id: remove.c,v 1.4 1999/08/21 16:03:31 tsjensen Exp tsjensen $
* Version: $Id: remove.c,v 1.5 1999/11/07 17:46:26 tsjensen Exp tsjensen $
* Language: ANSI C
* World Wide Web: http://home.pages.de/~jensen/boxes/
* Purpose: Box removal, i.e. the deletion of boxes
@ -25,6 +25,11 @@
* Revision History:
*
* $Log: remove.c,v $
* Revision 1.5 1999/11/07 17:46:26 tsjensen
* Bugfix: Horizontal box parts were not correctly detected if the west box
* side was empty (reported: Tobias Buchal)
* Bugfix: boxes could hang in detect_horiz() due to goeast/west confusion
*
* Revision 1.4 1999/08/21 16:03:31 tsjensen
* Bugfix: When matching vertical side shape lines, ignore empty shape lines
*
@ -53,7 +58,8 @@
#include "remove.h"
static const char rcsid_remove_c[] =
"$Id: remove.c,v 1.4 1999/08/21 16:03:31 tsjensen Exp tsjensen $";
"$Id: remove.c,v 1.5 1999/11/07 17:46:26 tsjensen Exp tsjensen $";
@ -101,8 +107,9 @@ static int best_match (const line_t *line,
#endif
/*
* Find match for WEST side (TODO: nicht wenn BLEF leer)
* Find match for WEST side
*/
if (!empty_side (opt.design->shape, BLEF)) {
quality = 0;
cs = opt.design->shape + WNW;
for (j=0,k=0,w=3; j<numw; ++j,++k) {
@ -113,7 +120,7 @@ static int best_match (const line_t *line,
chkline.text = cs->chars[k];
chkline.len = cs->width;
if (empty_line (&chkline))
if (empty_line (&chkline) && !(quality==0 && j==numw-1))
continue;
s = (char *) strdup (cs->chars[k]);
@ -164,10 +171,12 @@ static int best_match (const line_t *line,
BFREE (s);
}
}
/*
* Find match for EAST side
*/
if (!empty_side (opt.design->shape, BRIG)) {
quality = 0;
cs = opt.design->shape + ENE;
for (j=0,k=0,w=1; j<nume; ++j,++k) {
@ -233,6 +242,7 @@ static int best_match (const line_t *line,
BFREE (s);
}
}
return *ws || *es ? 1:0;
}