Commit 7a466923 authored by Andrew Hodgkinson's avatar Andrew Hodgkinson
Browse files

Updated Hotlists - USNA HTML resources and 6025 TV room pages had moved,

MIDI themes is unreachable, Hensa has been restructured.

For table cells where the line or chunk data totals less than Flex_256_Point
bytes (see top of Memory.c, current value is 8192) there would be an over-
allocation of 1 byte per cell due to a (now fixed) bug in the granular
allocator. This would translate into 4 bytes wastage of course, and may
represent a small speed penalty depending on how flex works out block
word alignment.

Several entries in the Choices file were missing from save_save_choices in
its new form (see last check-in). Added back in. Ursula and Phoenix Res
files contained an incorrect component ID in pane 3 that was stopping the
'no scroll bars' option in pane 7 working correctly (duplicate component
ID). Res files corrected; TRACE builds will now spot such errors and give
a warning when they occur (in choices_find_component).

Table widthing code fixes:

 * Very wide table cell specifiers (e.g. TD WIDTH="2000") were ignored,
   but this isn't what Navigator / MSIE 4 do. This code was present
   because of other bugs in the widther, long since fixed. The code has
   been commented out - if the problem reappears the use of the code can
   be re-investigated, but as far as I can tell it isn't needed.

 * If two pixel specified cells appear one above the other, the first
   would always have been taken for use in the final width calculation
   even if it specified a smaller width than the second. The check was
   made to ensure that pixel specifiers were chosen in preference to
   other cells, which is OK, but it didn't notice if the current cell
   was also a pixel specifier! Fixed; you now get the widest.

 * The TRACE build 'Colspan cell xxx would have been width yyy, below
   minimum width of zzz' error should no longer happen. In a manner similar
   to the bug mentioned above, two cells above each other spanning the
   same columns with the lower cell narrower than the upper would end up
   with the narrower width. The code that trapped and corrected the error
   was not compiled out of release builds, even though the error message
   generation was, because the rendering would fail otherwise. The widther
   has now been fixed not to make this mistake and the final check is now
   strictly TRACE build only, thereby speeding up table widthing for
   non-TRACE builds.

 * Another use of MSIE4StyleTables option, for cellspacing; it's based
   on the actual used cells, rather than the maximum cell width caused
   by COLSPAN etc. So if you've a cell with a big COLSPAN but as a
   heading but the rest of the table only uses, say, 4 columns, you won't
   get a gap to the right which adds up to the spacing for all of the
   cells that the COLSPAN attribute in the heading implied. The option
   was actually intended as 'bad things when switched on', and though in
   this case it makes for a better rendering, it does hide an error in
   the HTML. Note Navigator 4 acts as Browse with MSIE4StyleTables off
   in this particular case. Oh, it works in both ways of course, so
   the table height routine had to be updated too. A new function,
   tables_find_actual_size, exists to support the feature in general.

Messages files updated to v2.05 (21-Apr-98). Help menu items renamed a
bit in Ursula, Phoenix and Customer Res files, but entries still point
to the same URLs. Phoenix button bar markers have been brought closer
together to stop them being visible when only the URL bar is meant to
be present.
parent c55f6452
......@@ -35,3 +35,4 @@ ahodgkin_202release First release to include Customer multiuser
capability (SINGLE_USER not defined at compile
time). 19/02/98 (v2.02).
ahodgkin_204release Internal release, 14/04/98 (v2.04).
ahodgkin_205release Internal and Customer release, 21/04/98 (v2.05).
......@@ -3,7 +3,7 @@
_TaskName:Browse
_SpriName:!browse
Version:2.04 (14-Apr-98)
Version:2.05 (21-Apr-98)
# Errors
# ======
......
No preview for this file type
......@@ -28,7 +28,6 @@
<h4>FTP archives</h4>
<ul>
<li><a href="http://www.acorn.co.uk/ftp/">Acorn (WWW interface)</a>
<li><a href="ftp://micros.hensa.ac.uk/micros/arch/riscos/">Hensa Acorn archive</a>
<li><a href="ftp://ftp.uni-stuttgart.de/pub/systems/acorn/">Stuttgart Acorn archive</a>
</ul>
</ul>
......@@ -52,7 +51,7 @@
<ul>
<li><a href="http://www.w3.org/">World Wide Web consortium</a>
<li><a href="http://www.earth.com/bad-style/">HTML Bad Style Page</a>
<li><a href="http://www.nadn.navy.mil/html.html">HTML Resources</a>
<li><a href="http://www.nadn.navy.mil/Masters/Resources/resources.htm">USNA HTML Resources</a>
<li><a href="http://www.it.kth.se/docs/rfc/">List of RFCs</a>
<li><a href="http://www.cdrom.com/pub/png/">PNG (Portable Network Graphics) Home Page</a>
</ul>
......@@ -76,15 +75,14 @@
<ul>
<h4>Film and television</h4>
<ul>
<li><a href="http://mrdata.simplenet.com/midi.htm">The Ultimate Theme Song MIDI Page</a>
<li><a href="http://www.like.it/vertigo/cliches.html">The Movie Cliches List</a>
<li><a href="http://www.users.dircon.co.uk/~bandc/a.wiseman/625/index.htm">6025 Television Room</a>
<li><a href="http://625.simplenet.com/">6025 Television Room</a>
<li><a href="http://www.scifi.com/">Sci-Fi Channel: The Dominion</a>
<li><a href="http://www.tangh.demon.co.uk/tubbytoast/index.html">Teletubbies come to play!</a>
</ul>
<h4>Miscellaneous</h4>
<ul>
<li><a href="http://www.fibblesnork.com/lego/guide/">Fibblesnork</a>
<li><a href="http://database.lugnet.com/fibblesnork/lego/guide/">Fibblesnork</a>
<li><a href="http://www.planetquake.com/">Planet Quake</a>
<li><a href="http://www.netaxs.com/~cparker/front/hub.html">Charley Parker's virtual comic book - ARGON ZARK!</a>
<li><a href="http://animeonline.org/">AnimeOnline - Everything Anime</a>
......
......@@ -3,7 +3,7 @@
_TaskName:Phoenix
_SpriName:!phoenix
Version:2.04 (14-Apr-98)
Version:2.05 (21-Apr-98)
# Errors
# ======
......
No preview for this file type
......@@ -28,7 +28,6 @@
<h4>FTP archives</h4>
<ul>
<li><a href="http://www.acorn.co.uk/ftp/">Acorn (WWW interface)</a>
<li><a href="ftp://micros.hensa.ac.uk/micros/arch/riscos/">Hensa Acorn archive</a>
<li><a href="ftp://ftp.uni-stuttgart.de/pub/systems/acorn/">Stuttgart Acorn archive</a>
</ul>
</ul>
......@@ -52,7 +51,7 @@
<ul>
<li><a href="http://www.w3.org/">World Wide Web consortium</a>
<li><a href="http://www.earth.com/bad-style/">HTML Bad Style Page</a>
<li><a href="http://www.nadn.navy.mil/html.html">HTML Resources</a>
<li><a href="http://www.nadn.navy.mil/Masters/Resources/resources.htm">USNA HTML Resources</a>
<li><a href="http://www.it.kth.se/docs/rfc/">List of RFCs</a>
<li><a href="http://www.cdrom.com/pub/png/">PNG (Portable Network Graphics) Home Page</a>
</ul>
......@@ -76,15 +75,14 @@
<ul>
<h4>Film and television</h4>
<ul>
<li><a href="http://mrdata.simplenet.com/midi.htm">The Ultimate Theme Song MIDI Page</a>
<li><a href="http://www.like.it/vertigo/cliches.html">The Movie Cliches List</a>
<li><a href="http://www.users.dircon.co.uk/~bandc/a.wiseman/625/index.htm">6025 Television Room</a>
<li><a href="http://625.simplenet.com/">6025 Television Room</a>
<li><a href="http://www.scifi.com/">Sci-Fi Channel: The Dominion</a>
<li><a href="http://www.tangh.demon.co.uk/tubbytoast/index.html">Teletubbies come to play!</a>
</ul>
<h4>Miscellaneous</h4>
<ul>
<li><a href="http://www.fibblesnork.com/lego/guide/">Fibblesnork</a>
<li><a href="http://database.lugnet.com/fibblesnork/lego/guide/">Fibblesnork</a>
<li><a href="http://www.planetquake.com/">Planet Quake</a>
<li><a href="http://www.netaxs.com/~cparker/front/hub.html">Charley Parker's virtual comic book - ARGON ZARK!</a>
<li><a href="http://animeonline.org/">AnimeOnline - Everything Anime</a>
......
......@@ -3,7 +3,7 @@
_TaskName:Browse
_SpriName:!browse
Version:2.04 (14-Apr-98)
Version:2.05 (21-Apr-98)
# Errors
# ======
......
No preview for this file type
......@@ -35,7 +35,6 @@
<h4>FTP archives</h4>
<ul>
<li><a href="http://www.acorn.co.uk/ftp/">Acorn (WWW interface)</a>
<li><a href="ftp://micros.hensa.ac.uk/micros/arch/riscos/">Hensa Acorn archive</a>
<li><a href="ftp://ftp.uni-stuttgart.de/pub/systems/acorn/">Stuttgart Acorn archive</a>
</ul>
</ul>
......@@ -59,7 +58,7 @@
<ul>
<li><a href="http://www.w3.org/">World Wide Web consortium</a>
<li><a href="http://www.earth.com/bad-style/">HTML Bad Style Page</a>
<li><a href="http://www.nadn.navy.mil/html.html">HTML Resources</a>
<li><a href="http://www.nadn.navy.mil/Masters/Resources/resources.htm">USNA HTML Resources</a>
<li><a href="http://www.it.kth.se/docs/rfc/">List of RFCs</a>
<li><a href="http://www.cdrom.com/pub/png/">PNG (Portable Network Graphics) Home Page</a>
</ul>
......@@ -83,16 +82,15 @@
<ul>
<h4>Film and television</h4>
<ul>
<li><a href="http://mrdata.simplenet.com/midi.htm">The Ultimate Theme Song MIDI Page</a>
<li><a href="http://www.like.it/vertigo/cliches.html">The Movie Cliches List</a>
<li><a href="http://www.users.dircon.co.uk/~bandc/a.wiseman/625/index.htm">6025 Television Room</a>
<li><a href="http://625.simplenet.com/">6025 Television Room</a>
<li><a href="http://www.scifi.com/">Sci-Fi Channel: The Dominion</a>
<li><a href="http://www.tangh.demon.co.uk/tubbytoast/index.html">Teletubbies come to play!</a>
</ul>
<h4>Miscellaneous</h4>
<ul>
<li><a href="http://www.unitedmedia.com/comics/dilbert/">Dilbert</a>
<li><a href="http://www.fibblesnork.com/lego/guide/">Fibblesnork</a>
<li><a href="http://database.lugnet.com/fibblesnork/lego/guide/">Fibblesnork</a>
<li><a href="http://www.planetquake.com/">Planet Quake</a>
<li><a href="http://www.netaxs.com/~cparker/front/hub.html">Charley Parker's virtual comic book - ARGON ZARK!</a>
<li><a href="http://animeonline.org/">AnimeOnline - Everything Anime</a>
......
......@@ -22,6 +22,10 @@
/* Author : D.T.A.Brown */
/* */
/* History: 23-Sep-97: Created. */
/* 18-Apr-98: choices_find_component will */
/* complain if the same thing */
/* is found more than once in */
/* TRACE builds (ADH). */
/***************************************************/
#include <stdlib.h>
......@@ -2443,11 +2447,73 @@ static ObjectId choices_find_component(ComponentId component)
int findwindow;
unsigned int flags;
/* Uses lazy evaluation to not call gadget_get_flags unless */
/* subwindows[findwindow] contains an objectid. */
#ifndef TRACE
for(findwindow = 0; findwindow < CDNoSubwindows; findwindow++)
if (subwindows[findwindow] && !gadget_get_flags(0, subwindows[findwindow], component, &flags)) return subwindows[findwindow];
/* Uses lazy evaluation to not call gadget_get_flags unless */
/* subwindows[findwindow] contains an objectid. */
for (findwindow = 0; findwindow < CDNoSubwindows; findwindow++)
{
if (
subwindows[findwindow] &&
!gadget_get_flags(0,
subwindows[findwindow],
component,
&flags)
)
return subwindows[findwindow];
}
#else
/* TRACE builds will check for multiple same component IDs, */
/* and complain. Would have saved at least one time consuming */
/* error in Phoenix if I'd thought to do this a week earlier! */
{
ObjectId found = NULL_ObjectId;
int pane = 0;
for (findwindow = 0; findwindow < CDNoSubwindows; findwindow++)
{
if (
subwindows[findwindow] &&
!gadget_get_flags(0,
subwindows[findwindow],
component,
&flags)
)
{
if (found == NULL_ObjectId)
{
found = subwindows[findwindow];
pane = findwindow;
}
else
{
erb.errnum = Utils_Error_Custom_Normal;
sprintf(erb.errmess,
"Duplicate component ID 0x%x in Choices dialogue box panes %d and %d.",
component,
pane,
findwindow);
show_error_ret(&erb);
found = subwindows[findwindow];
}
/* Closure of 'if' with code above running if the gadget is found */
}
/* Closure of 'for' loop */
}
if (found != NULL_ObjectId) return found;
}
#endif
return 0;
}
......
......@@ -734,13 +734,13 @@ _kernel_oserror * memory_set_chunk_size(browser_data * b, reformat_cell * cell,
case CK_LINV:
{
int gshift = 0;
int gshift = 3; /* Start with 8 byte granularity */
if (cell->ldata) oldsize = flex_size((flex_ptr) &cell->ldata);
else if (size == 0) return NULL;
if (oldsize > Flex_256_Point) gshift = 8; /* 256 byte granularity */
if (oldsize > Flex_4K_Point) gshift = 12; /* 4K granularity */
if (oldsize > Flex_256_Point) gshift = 8; /* 256 byte granularity */
if (oldsize > Flex_4K_Point) gshift = 12; /* 4K granularity */
if (((oldsize >> gshift) != ((size >> gshift) + 1)) || !size)
{
......@@ -773,13 +773,13 @@ _kernel_oserror * memory_set_chunk_size(browser_data * b, reformat_cell * cell,
case CK_LDAV:
{
int gshift = 0;
int gshift = 3; /* Start with 8 byte granularity */
if (cell->cdata) oldsize = flex_size((flex_ptr) &cell->cdata);
else if (size == 0) return NULL;
if (oldsize > Flex_256_Point) gshift = 8; /* 256 byte granularity */
if (oldsize > Flex_4K_Point) gshift = 12; /* 4K granularity */
if (oldsize > Flex_256_Point) gshift = 8; /* 256 byte granularity */
if (oldsize > Flex_4K_Point) gshift = 12; /* 4K granularity */
if (((oldsize >> gshift) != ((size >> gshift) + 1)) || !size)
{
......
......@@ -1159,7 +1159,11 @@ static _kernel_oserror * reformat_format_from_now(browser_data * b, int lastline
{
WimpGetWindowStateBlock state;
if (b->ancestor) windows_check_tools(b, NULL);
if (b->ancestor)
{
// windows_set_tools(b, NULL, 0, 0, 0, 0);
windows_check_tools(b, NULL);
}
state.window_handle = b->window_handle;
......
......@@ -1804,6 +1804,7 @@ _kernel_oserror * save_save_choices(char * path)
SaveSimple("AutoScrollMargin", auto_scroll_margin, int, Save_SaveNumber);
SaveSimple("MSIE4StyleTables", msie4_style_tables, int, Save_SaveYesNo);
{
static const save_pair ns[] = { { "never", Choices_SaveImageHistory_Never },
{ "once", Choices_SaveImageHistory_Once },
......@@ -1914,6 +1915,15 @@ _kernel_oserror * save_save_choices(char * path)
SaveSimple("BackColour", background_colour, int, Save_SaveColour);
SaveSimple("ClientPull", client_pull, int, Save_SaveYesNo);
SaveSimple("FollColour", followed_colour, int, Save_SaveColour);
SaveSimple("FullScreen", full_screen, int, Save_SaveYesNo);
SaveSimple("LeftIndent", left_indent, int, Save_SaveNumber);
SaveSimple("LeftMargin", left_margin, int, Save_SaveNumber);
SaveSimple("LinkColour", link_colour, int, Save_SaveColour);
SaveSimple("SeeFetches", see_fetches, int, Save_SaveYesNo);
SaveSimple("SeleColour", selected_colour, int, Save_SaveColour);
SaveSimple("StartProxy", start_proxy, int, Save_SaveYesNo);
SaveSimple("SystemFont", system_font, int, Save_SaveYesNo);
{
static const save_pair ns[] = { { "2d", Choices_TableInner_Always2D },
......
......@@ -73,7 +73,8 @@ static int width_table_leds = 1;
/* Static function prototypes */
static void tables_align_contents(browser_data * b, HStream * streambase, table_stream * table, reformat_cell * cellarray, int Row, int Column);
static void tables_find_actual_size (table_stream * p, int * actual_colspan, int * actual_rowspan);
static void tables_align_contents (browser_data * b, HStream * streambase, table_stream * table, reformat_cell * cellarray, int Row, int Column);
/*************************************************/
/* tables_count_table() */
......@@ -491,6 +492,81 @@ void tables_init_table(browser_data * b, table_stream * table, reformat_cell * c
return;
}
/*************************************************/
/* tables_find_actual_size() */
/* */
/* Find the number of actual used rows and cols */
/* in a table, ignoring whatever colspan and */
/* rowspan attributes might say. */
/* */
/* Expects each cell's RowOffs and ColOffs */
/* fields to hold the row/column offset of that */
/* cell within the table (tables_position_table */
/* must have been called beforehand). */
/* */
/* Parameters: Pointer to a table_stream struct */
/* for the table; */
/* */
/* Pointer to an int, in which the */
/* number of columns is written; */
/* */
/* Pointer to an int, in which the */
/* number of rows is written. */
/* */
/* Assumes: The int pointers may be NULL. */
/*************************************************/
static void tables_find_actual_size(table_stream * p, int * actual_colspan, int * actual_rowspan)
{
table_row * R;
table_headdata * D;
int cellmax = p->ColSpan * p->RowSpan;
int cs = 0;
int rs = 0;;
if (cellmax)
{
R = p->List;
while (R)
{
int row, col;
D = R->List;
while (D && D->ColOffs < p->ColSpan)
{
col = D->ColOffs;
row = D->RowOffs;
switch (D->Tag)
{
case TagTableData:
case TagTableHead:
{
int cellnumber = D->RowOffs * p->ColSpan + D->ColOffs;
if (cellnumber < cellmax && col < p->ColSpan)
{
if (col + 1 > cs) cs = col + 1;
if (row + 1 > rs) rs = row + 1;
}
}
}
D = D->Next;
}
R = R->Next;
}
}
if (actual_colspan) *actual_colspan = cs;
if (actual_rowspan) *actual_rowspan = rs;
return;
}
/*************************************************/
/* tables_width_table() */
/* */
......@@ -552,7 +628,7 @@ int tables_width_table(int toplevel, browser_data * b, table_stream * p,
{
table_row * R;
table_headdata * D;
int I; // S, T; // For code commented out below
int I;
int * ColOffs;
int finding_widest;
......@@ -573,17 +649,13 @@ int tables_width_table(int toplevel, browser_data * b, table_stream * p,
int have_pixels = 0;
int have_checked = 0;
int subtract = 0;
int cellspacingos = p->cellspacing * 2; /* 1 'web pixel' = 2 OS units */
int cellspacingmp;
int tbordmp;
// Trying to work out why the final 'are we underwidth' pass is needed,
// but due to code freeze (29/01/1998) have to put this on hold... :-(
//
// Printf("Table %p, aw %d, flags %x\n",p,available_width/400,flags);
#ifdef TRACE
if (tl & (1u<<20)) Printf("tables_width_table entered: 0x%x %d (%d OS) 0x%x\n", (int) P, available_width, available_width / 400, cellarray);
#endif
......@@ -730,15 +802,63 @@ int tables_width_table(int toplevel, browser_data * b, table_stream * p,
return 0;
}
if (finding_widest != 1)
{
/* Decrease available width according to cell spacing constraints */
/* Decrease available width according to cell spacing constraints */
/* and account for the overall table border. */
if (p->ColSpan) available_width -= cellspacingmp * (p->ColSpan + 1);
subtract = tbordmp * 2;
/* Decrease available width according to overall table border */
if (!choices.msie4_style_tables)
{
/* First case - Navigator / Browse behaviour. Here, we just subtract */
/* spacing for enough columns as there appear to be. However, if */
/* there is a large colspan cell which effectively 'drops off' the */
/* right hand edge of the notionally used cells, we could end up */
/* with excess space allocated on the edge of the table: */
/* */
/* +===============================================================+ */
/* H H */
/* H +-----------------------------------------------------------+ H */
/* H | Cell with colspan value of, say, 7 | H */
/* H +-----------------------------------------------------------+ H */
/* H H */
/* H +--------+ +--------+ +--------+ +--------+ +--------+ H */
/* H | There | | only | | actual | | really | | use... | Gap at H */
/* H | are | | five | | cells | | in | | So --> | right H */
/* H | | | | | | | | | | edge. H */
/* H +--------+ +--------+ +--------+ +--------+ +--------+ H */
/* H H */
/* +===============================================================+ */
subtract += cellspacingmp * (p->ColSpan + 1);
}
else
{
int number_used;
/* Second case - MSIE 4 style behaviour. Here, MSIE seems to count */
/* up and see which cells are actually in use, and only account for */
/* spacing between them. This eliminates the spurious gap at the */
/* right hand edge as above. */
/* */
/* Whilst choices.msie4_style_tables is generally only used to */
/* switch on daft features for compatibility's sake, this seems at */
/* first glance a sensible thing to have. However, the feature hides */
/* an error in the HTML - the top cell had too big a colspan value. */
/* So really, to write better HTML, it's more sensible to not have */
/* the browser hide such an error. */
tables_find_actual_size(p, &number_used, NULL);
if (number_used) subtract += cellspacingmp * (number_used + 1);
}
/* Subtract the value from available_width, if the latter is a */
/* valid constraint (i.e. we're not trying to find the widest */
/* the table can be). */
available_width -= tbordmp * 2;
if (finding_widest != 1)
{
available_width -= subtract;
}
/* This can get s l o w... */
......@@ -855,22 +975,25 @@ int tables_width_table(int toplevel, browser_data * b, table_stream * p,
break;
}
if (finding_widest != 1)
{
/* Deal with garbage like 'TD WIDTH="2000"' - if a cell */
/* wants to be wider than the table can be, ignore the */
/* width specifier completely. */
if (width > available_width) width = -1;
}
else
{
/* Because this is a scan to find the widest limit of a table, */
/* we can't use available_width to limit the item; so instead */
/* use the browser's display width as a second best option. */
if (width > display_width) width = -1;
}
// Um... Improvements to other widthing code mean this doesn't seem to be
// needed anymore. It was only causing problems in fact.
//
// if (finding_widest != 1)
// {
// /* Deal with garbage like 'TD WIDTH="2000"' - if a cell */
// /* wants to be wider than the table can be, ignore it */
// /* completely. */
//
// if (width > available_width) width = -1;
// }
// else
// {
// /* Because this is a scan to find the widest limit of a table, */
// /* we can't use available_width to limit the item; so instead */
// /* use the browser's display width as a second best option. */
//
// if (width > display_width) width = -1;
// }
}
/* Unfortunately, still need to find the minimum size. So bang */
......@@ -1345,12 +1468,22 @@ int tables_width_table(int toplevel, browser_data * b, table_stream * p,
table_headdata * lc = usedcells[p->ColSpan + col];
/* Only use the maximum value if the cell isn't 'locked' by one */
/* already in use that specifies a pixel size */
if (TD_HAS_WIDTH(lc) && TD_WIDTH_UNITS(lc) == UNITS_PIXELS)
/* already in use that specifies a pixel size (provided this */
/* one doesn't itself specify a greater pixel size). */
if (
(
!TD_HAS_WIDTH(D) ||
TD_WIDTH_UNITS(D) != UNITS_PIXELS
)
&& lc
&& TD_HAS_WIDTH(lc)
&& TD_WIDTH_UNITS(lc) == UNITS_PIXELS
)
{
/* May be forced to use this cell if the *minimum* value */
/* ends up greater than the maximum! */
/* May be forced to use this cell anyway, if the *minimum* value */
/* of this cell is greater the maximum set from the one already */
/* marked for use in usedcells[]! */
if (mins[cellnumber] > overmaxs[col])
{
......@@ -1722,8 +1855,15 @@ tables_width_table_assign_finals: /* (The colspan code below this section may ju
/* columns it spans. Using minimums ensures that when rewidthing */
/* the table, we won't need to check colspan cells again in case */
/* they are still undersize...! */
if (spanned_total < mins[cellnumber])
/* */
/* mins_total is checked because a colspan cell in a row above may */
/* have already redistributed its width in overmins. If in total it */
/* was wider than this cell, mins[cellnumber] - mins_total would be */
/* negative. We'd then go and *reduce* the spanned width to this */
/* cell's value, meaning the cell above ended up underwidth. Oops! */
/* So, do this extra check to avoid making that error. */
if (spanned_total < mins[cellnumber] && mins_total < mins[cellnumber])
{
int min_diff = mins[cellnumber] - mins_total;
int basic = min_diff / (D->ColSpan ? D->ColSpan : 1);
......@@ -1792,13 +1932,18 @@ tables_width_table_assign_finals: /* (The colspan code below this section may ju
/* Closure of 'if (have_colspans)' */
}
// #ifdef TRACE
#ifdef TRACE
/* Final sanity check - the algorithms above should ensure that */
/* by this stage, no cell whether spanning multiple columns or */
/* not should be below its minimum size. In TRACE builds, this */
/* check warns if this is not the case (this indicates a bug in */
/* the widthing code above). */
/* */
/* A single cell being underwidth is really quite serious; */
/* there is much more room for colspan to go wrong, really, so */
/* the error this check raises is rather more urgent sounding */
/* than the similar check for colspan cells. */
R = p->List;
rowcount = 0;
......@@ -1824,15 +1969,23 @@ tables_width_table_assign_finals: /* (The colspan code below this section may ju
ColOffs[currcol] < mins[cellnumber]
)
{
/* This ifdef is left here so that in the event the widther is */
/* changed so that this final 'emergency' check may be needed in */
/* non-trace builds, it can be brought back by just removing the */
/* outer ifdef checks. Be aware that any widther which does this */
/* *is* broken in some way! */
#ifdef TRACE
erb.errnum = Utils_Error_Custom_Normal;
sprintf(erb.errmess,
"Non-colspan cell %d would have ended up at %d OS units, below minimum width of %d",
"Warning! NON-colspan cell %d would have ended up at %d OS units (%d mp), below minimum width of %d OS units (%d mp).",
cellnumber,
ColOffs[currcol] / 400,
mins[cellnumber] / 400);
ColOffs[currcol],
mins[cellnumber] / 400,
mins[cellnumber]);
show_error_ret(&erb);
......@@ -1902,15 +2055,23 @@ tables_width_table_assign_finals: /* (The colspan code below this section may ju
int basic = min_diff / (D->ColSpan ? D->ColSpan : 1);
int remainder = min_diff - (basic * D->ColSpan);
/* This ifdef is left here so that in the event the widther is */
/* changed so that this final 'emergency' check may be needed in */
/* non-trace builds, it can be brought back by just removing the */
/* outer ifdef checks. Be aware that any widther which does this */
/* *is* broken in some way! */
#ifdef TRACE
erb.errnum = Utils_Error_Custom_Normal;
sprintf(erb.errmess,
"Colspan cell %d would have ended up at %d OS units, below minimum width of %d",
"Colspan cell %d would have ended up at %d OS units (%d mp), below minimum width of %d OS units (%d mp).",
cellnumber,
spanned_total / 400,
mins[cellnumber] / 400);
spanned_total,
mins[cellnumber] / 400,
mins[cellnumber]);
show_error_ret(&erb);
......@@ -1961,7 +2122,7 @@ tables_width_table_assign_finals: /* (The colspan code below this section may ju
/* Closure of 'if (have_colspans)' */
}
// #endif
#endif
/* Add up the widths */
......@@ -2151,7 +2312,7 @@ tables_width_table_assign_finals: /* (The colspan code below this section may ju
/* width to allow for cellspacing to the returned table width, */
/* and allow for the outer table border. */
if (p->ColSpan) max_table_width += cellspacingmp * (p->ColSpan + 1) + tbordmp * 2;
max_table_width += subtract;
return max_table_width;
}
......@@ -2286,7 +2447,6 @@ int tables_height_table(int toplevel, browser_data * b, table_stream * p, reform
case UNITS_PERCENT:
{
convert_to_points(redraw_display_height(b, NULL), &height);
height = (TABLE_HEIGHT(p) * height) / 100;
}
break;
......@@ -2543,7 +2703,18 @@ int tables_height_table(int toplevel, browser_data * b, table_stream * p, reform
/* Add in cell spacings and the table outer border */
if (p->RowSpan) ReturnHeight += cellspacingmp * (p->RowSpan + 1) + tbordmp * 2;
if (choices.msie4_style_tables)
{
int actual_rowspan;
tables_find_actual_size(p, NULL, &actual_rowspan);
ReturnHeight += cellspacingmp * (actual_rowspan + 1) + tbordmp * 2;
}
else
{
ReturnHeight += cellspacingmp * (p->RowSpan + 1) + tbordmp * 2;
}
/* Return the height */
......@@ -2650,15 +2821,27 @@ void tables_fix_table(browser_data * b, table_stream * p, reformat_cell * cellar
int * ColOffs;
int * RowOffs;
int CurX, CurY;
int cellcount = 0;
int cellmax = p->ColSpan * p->RowSpan;
int cellspacingos = p->cellspacing * 2; /* 1 'web pixel' = 2 OS units */
int cellcount = 0;
int cellmax = p->ColSpan * p->RowSpan;
int cellspacingos = p->cellspacing * 2; /* 1 'web pixel' = 2 OS units */
int cellspacingmp;
int tbordmp;
int actual_colspan = p->ColSpan;
int actual_rowspan = p->RowSpan;
convert_to_points(cellspacingos, &cellspacingmp);
convert_to_points(TABLE_BORDER(p) * 2, &tbordmp); /* 1 'web pixel' = 2 OS units */
/* First thing - for MSIE4 compatibility regarding cell spacing, */
/* work out the number of actually used rows and columsn in the */
/* table. For more, see comments around code calculating the */
/* value of 'subtract' in tables_width_table. */
if (choices.msie4_style_tables)
{
tables_find_actual_size(p, &actual_colspan, &actual_rowspan);
}
/* Have ColOffs and RowOffs as the arrays holding millipoint */
/* offsets from the top left of the table. */
......@@ -2710,6 +2893,8 @@ void tables_fix_table(browser_data * b, table_stream * p, reformat_cell * cellar
if (D->ColSpan > 1)
{
int spanned, available;
for (I = 1; I < D->ColSpan; I++)
{
Width += abs(ColOffs[D->ColOffs + I]);
......@@ -2717,7 +2902,12 @@ void tables_fix_table(browser_data * b, table_stream * p, reformat_cell * cellar
/* Account for cell spacing */
Width += cellspacingmp * (D->ColSpan - 1);
spanned = D->ColSpan;
available = actual_colspan - D->ColOffs;
if (spanned > available ) spanned = available;
Width += cellspacingmp * (spanned - 1);
}
/* Do the same for the height */
......@@ -2726,14 +2916,21 @@ void tables_fix_table(browser_data * b, table_stream * p, reformat_cell * cellar
if (D->RowSpan > 1)
{
int spanned, available;
for (I = 1; I < CorrectRowSpan(D, p); I++)
{
Height += abs(RowOffs[D->RowOffs + I]);
}
spanned = D->RowSpan;
available = actual_rowspan - D->RowOffs;
if (spanned > available ) spanned = available;
/* Account for cell spacing */
Height += cellspacingmp * (D->RowSpan - 1);
Height += cellspacingmp * (spanned - 1);
}
/* We now know the X and Y millipoint offsets of the cell and */
......
......@@ -1830,10 +1830,16 @@ void windows_close_browser(browser_data * handle)
if (handle->may_scroll != NULL_ObjectId)
{
show_error_ret(toolbox_delete_object(0, handle->may_scroll));
_kernel_oserror * e = toolbox_delete_object(0, handle->may_scroll);
#ifdef TRACE
if (tl & (1u<<3)) Printf("\nDeleted object ID %p\n",(void *) handle->may_scroll);
if (tl & (1u<<3))
{
Printf("\nDeleted object ID %p\n",(void *) handle->may_scroll);
if (e) Printf("Call returned error! '%s'\n",e->errmess);
}
#else
e = e; /* Avoid 'declared but not used' or similar warnings */
#endif
handle->may_scroll = NULL_ObjectId;;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment