Commit ae3caa2a authored by Jody Goldberg's avatar Jody Goldberg

- Adjust row/col size to better match XL.

- Put pictures in the correct place.
- More const for some of the sheet routines.
parent 663f8876
1999-09-17 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_col_get_unit_distance,
sheet_row_get_distance
sheet_row_get_unit_distance
sheet_col_get_unit_distance) : Constification.
(sheet_init_default_styles) : Make the default row/col size
match excel more closely.
1999-09-16 Michael Meeks <michael@nuclecu.unam.mx>
* src/func.c (functions_init): Remove misc_init.
......
......@@ -2,6 +2,7 @@ Gnumeric 0.36
Jody:
* Improve selection to correctly handle overlapping ranges.
* Improve XL import of 'escher' stream for pictures and objects.
Jukka:
* Major clean up to the documentation of functions.
......
1999-09-17 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_col_get_unit_distance,
sheet_row_get_distance
sheet_row_get_unit_distance
sheet_col_get_unit_distance) : Constification.
(sheet_init_default_styles) : Make the default row/col size
match excel more closely.
1999-09-16 Michael Meeks <michael@nuclecu.unam.mx>
* src/func.c (functions_init): Remove misc_init.
......
1999-09-17 Jody Goldberg <jgoldberg@home.com>
* ms-escher.c (ms_escher_read_ClientAnchor) : Yahoo! figured out
object placement !!
1999-09-16 Michael Meeks <michael@nuclecu.unam.mx>
* ms-excel-read.c (ms_excel_read_sheet): add sheet param to _get_drawing
......
......@@ -66,7 +66,7 @@ typedef struct {
} EscherRecord;
static EscherRecord *
escher_record_new_blip (guint8 *data, guint32 len, const char *reproid)
escher_record_new_blip (guint8 const *data, guint32 len, const char *reproid)
{
EscherRecord *er = g_new (EscherRecord, 1);
guint8 *mem;
......@@ -588,23 +588,34 @@ ms_escher_read_ChildAnchor (MSEscherState * state,
MSEscherCommonHeader * containing_header)
{
}
/* TODO : This is a guess that explains the sheets we have. Find some
* documentation. */
static void
ms_escher_read_ClientAnchor (MSEscherState * state,
MSEscherCommonHeader * h)
{
/* FIXME : This is a guess. */
Sheet const * sheet = state->sheet->gnum_sheet;
guint8 const * data = h->data + common_header_len;
int o = 0;
guint32 a = MS_OLE_GET_GUINT32(data+o);
guint32 b = MS_OLE_GET_GUINT32(data+o+4);
guint32 c = MS_OLE_GET_GUINT32(data+o+8);
guint32 d = MS_OLE_GET_GUINT32(data+o+12);
printf ("%10d %10d %10d %10d;\n", a,b,c,d);
printf ("0x%10x 0x%10x 0x%10x 0x%10x;\n", a,b,c,d);
#if 0
dump (h->data+common_header_len, h->len-common_header_len);
#endif
double const zoom = sheet->last_zoom_factor_used;
/* the word at offset 0 always seems to be 2 ?? */
int i;
/* Words 2, 6, 10, 14 : The row/col of the corners */
/* Words 4, 8, 12, 16 : distance from cell edge measured in 1/1440 of an inch */
float margin[4], tmp;
int pos[4];
for (i = 0; i < 4; ++i) {
pos[i] = MS_OLE_GET_GUINT16(data + 4*i + 2);
margin[i] = (MS_OLE_GET_GUINT16(data + 4*i + 4) / 20.);
tmp = (i&1) /* odds are rows */
? sheet_row_get_unit_distance (sheet, 0, pos[i])
: sheet_col_get_unit_distance (sheet, 0, pos[i]);
margin[i] += tmp;
margin[i] *= zoom;
}
#ifdef ENABLE_BONOBO
{ /* In the anals of ugly hacks, this is well up there :-) */
GList *l = state->wb->eschers;
......@@ -620,7 +631,8 @@ ms_escher_read_ClientAnchor (MSEscherState * state,
/* And lo, objects appeared always in the TLC */
so = sheet_object_container_new (state->sheet->gnum_sheet,
10.0, 10.0, 110.0, 110.0,
margin[0], margin[1],
margin[2], margin[3],
er->v.blip.reproid);
if (!sheet_object_container_load (so, er->v.blip.stream, TRUE))
g_warning ("Failed to load '%s' from stream",
......@@ -631,6 +643,7 @@ ms_escher_read_ClientAnchor (MSEscherState * state,
}
#endif
}
static void
ms_escher_read_ClientData (MSEscherState * state,
MSEscherCommonHeader * containing_header)
......
......@@ -366,7 +366,7 @@ checkbox_widget_create (SheetObjectWidget *sow, SheetView *sheet_view)
{
GtkWidget *checkbox;
checkbox = gtk_toggle_button_new();
checkbox = gtk_check_button_new();
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (checkbox), FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), FALSE);
gtk_widget_show (checkbox);
......
......@@ -82,8 +82,8 @@ static void
sheet_init_default_styles (Sheet *sheet)
{
/* Sizes seem to match excel */
col_row_info_init (&sheet->default_col_style, 80.0);
col_row_info_init (&sheet->default_row_style, 18.0);
col_row_info_init (&sheet->default_col_style, 62.0);
col_row_info_init (&sheet->default_row_style, 15.0);
}
/* Initialize some of the columns and rows, to test the display engine */
......@@ -748,7 +748,7 @@ col_row_distance (GList *list, int from, int to, int default_pixels)
* Return the number of pixels between from_col to to_col
*/
int
sheet_col_get_distance (Sheet *sheet, int from_col, int to_col)
sheet_col_get_distance (Sheet const *sheet, int from_col, int to_col)
{
g_assert (from_col <= to_col);
g_assert (sheet != NULL);
......@@ -791,7 +791,7 @@ col_row_unit_distance (GList *list, int from, int to, double default_units, doub
* Return the number of points between from_col to to_col
*/
double
sheet_col_get_unit_distance (Sheet *sheet, int from_col, int to_col)
sheet_col_get_unit_distance (Sheet const *sheet, int from_col, int to_col)
{
g_assert (from_col <= to_col);
g_assert (sheet != NULL);
......@@ -808,7 +808,7 @@ sheet_col_get_unit_distance (Sheet *sheet, int from_col, int to_col)
* Return the number of points between from_row to to_row
*/
double
sheet_row_get_unit_distance (Sheet *sheet, int from_row, int to_row)
sheet_row_get_unit_distance (Sheet const *sheet, int from_row, int to_row)
{
g_assert (from_row <= to_row);
g_assert (sheet != NULL);
......@@ -825,7 +825,7 @@ sheet_row_get_unit_distance (Sheet *sheet, int from_row, int to_row)
* Return the number of pixels between from_row to to_row
*/
int
sheet_row_get_distance (Sheet *sheet, int from_row, int to_row)
sheet_row_get_distance (Sheet const *sheet, int from_row, int to_row)
{
g_assert (from_row <= to_row);
g_assert (sheet != NULL);
......
......@@ -225,10 +225,10 @@ void sheet_col_add (Sheet *sheet, ColRowInfo *cp);
void sheet_row_add (Sheet *sheet, ColRowInfo *cp);
/* Measure distances in pixels from one col/row to another */
int sheet_col_get_distance (Sheet *sheet, int from_col, int to_col);
int sheet_row_get_distance (Sheet *sheet, int from_row, int to_row);
double sheet_row_get_unit_distance (Sheet *sheet, int from_row, int to_row);
double sheet_col_get_unit_distance (Sheet *sheet, int from_col, int to_col);
int sheet_col_get_distance (Sheet const *sheet, int from_col, int to_col);
int sheet_row_get_distance (Sheet const *sheet, int from_row, int to_row);
double sheet_row_get_unit_distance (Sheet const *sheet, int from_row, int to_row);
double sheet_col_get_unit_distance (Sheet const *sheet, int from_col, int to_col);
void sheet_clear_region (Sheet *sheet,
int start_col, int start_row,
......
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