Commit 897e9ed1 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

add some fun.

2002-11-24  Jody Goldberg <jody@gnome.org>

	* ms-obj.c (ms_obj_read_pre_biff8_obj) : add some fun.

2002-11-24  Jody Goldberg <jody@gnome.org>

	* src/sheet-object-graphic.c (sheet_object_text_set_text) : new.

	* src/cut-n-paste-code/foocanvas/libfoocanvas/foo-canvas-text.c
	(foo_canvas_text_set_property) : enable line wrapping.
parent 3005900e
......@@ -10,7 +10,7 @@ Release Critical
- XL crashes importing our xls95 exports with names
- referencing freed named expr from undo clipboard
- height calculation in render value is hosed for embedded new lines
- maptable freeze crash
- maptable scrolling oddity
Pending Patches
---------------
......
2002-11-24 Jody Goldberg <jody@gnome.org>
* src/sheet-object-graphic.c (sheet_object_text_set_text) : new.
* src/cut-n-paste-code/foocanvas/libfoocanvas/foo-canvas-text.c
(foo_canvas_text_set_property) : enable line wrapping.
2002-11-23 Jody Goldberg <jody@gnome.org>
* src/sheet-view.c (sv_freeze_panes) : Be more robust about handling
h/v only freezing that have initial positions > A1
* src/sheet-object-graphic.c : Move the label widget here. Inherit it
from SheetObjectFilled, and use canvas text. Still needs some love
to handle the outline width nicely but on the whole it works.
......
......@@ -13,6 +13,8 @@ Jody:
* Support the global outline buttons
* Optional outline markers at the begining rather than end
* Make the label object more useful
* Fix XL import for h/v only freeze with non origin start
* More attributes for excel97 objects
Jon Kåre:
* Separate GUI for showing progress and messages before first
......
2002-11-24 Jody Goldberg <jody@gnome.org>
* src/sheet-object-graphic.c (sheet_object_text_set_text) : new.
* src/cut-n-paste-code/foocanvas/libfoocanvas/foo-canvas-text.c
(foo_canvas_text_set_property) : enable line wrapping.
2002-11-23 Jody Goldberg <jody@gnome.org>
* src/sheet-view.c (sv_freeze_panes) : Be more robust about handling
h/v only freezing that have initial positions > A1
* src/sheet-object-graphic.c : Move the label widget here. Inherit it
from SheetObjectFilled, and use canvas text. Still needs some love
to handle the outline width nicely but on the whole it works.
......
2002-11-24 Jody Goldberg <jody@gnome.org>
* src/sheet-object-graphic.c (sheet_object_text_set_text) : new.
* src/cut-n-paste-code/foocanvas/libfoocanvas/foo-canvas-text.c
(foo_canvas_text_set_property) : enable line wrapping.
2002-11-23 Jody Goldberg <jody@gnome.org>
* src/sheet-view.c (sv_freeze_panes) : Be more robust about handling
h/v only freezing that have initial positions > A1
* src/sheet-object-graphic.c : Move the label widget here. Inherit it
from SheetObjectFilled, and use canvas text. Still needs some love
to handle the outline width nicely but on the whole it works.
......
2002-11-24 Jody Goldberg <jody@gnome.org>
* ms-obj.c (ms_obj_read_pre_biff8_obj) : add some fun.
2002-11-20 Jody Goldberg <jody@gnome.org>
* ms-formula-write.c (excel_formula_write_NAME_v7) : support qualified
......
......@@ -48,7 +48,7 @@ GNUMERIC_MODULE_PLUGIN_INFO_DECL;
/* Enables debugging mesgs while reading excel workbooks */
gint ms_excel_read_debug = 0;
/* Enables debugging mesgs while reading parsing escher streams */
gint ms_excel_escher_debug = 0;
gint ms_excel_escher_debug = 10;
/* Enables debugging mesgs while reading excel functions */
gint ms_excel_formula_debug = 0;
/* Enables debugging mesgs while reading excel charts */
......
......@@ -433,8 +433,24 @@ ms_sheet_create_obj (MSContainer *container, MSObj *obj)
}
/* TextBox */
case 0x06: so = g_object_new (sheet_object_text_get_type (), NULL);
break;
case 0x06: {
StyleColor *fill_color = NULL;
StyleColor *outline_color;
so = g_object_new (sheet_object_text_get_type (), NULL);
if (ms_obj_attr_bag_lookup (obj->attrs, MS_OBJ_ATTR_FILLED))
fill_color = ms_sheet_map_color (esheet, obj,
MS_OBJ_ATTR_FILL_COLOR);
outline_color = ms_sheet_map_color (esheet, obj,
MS_OBJ_ATTR_OUTLINE_COLOR);
sheet_object_graphic_fill_color_set (so, fill_color);
if (outline_color)
sheet_object_filled_outline_color_set (so, outline_color);
sheet_object_text_set_text (so,
ms_obj_attr_get_ptr (obj, MS_OBJ_ATTR_TEXT, (char *)""));
break;
}
/* Button */
case 0x07: so = g_object_new (sheet_widget_button_get_type (), NULL);
break;
......
......@@ -401,7 +401,8 @@ ms_obj_dump_impl (guint8 const *data, int len, int data_left, char const *name)
static gboolean
ms_obj_read_pre_biff8_obj (BiffQuery *q, MSContainer *container, MSObj *obj)
{
guint16 peek_op;
guint16 peek_op, tmp;
guint8 const *data;
/* TODO : Lots of docs for these things. Write the parser. */
#if 0
......@@ -417,7 +418,59 @@ ms_obj_read_pre_biff8_obj (BiffQuery *q, MSContainer *container, MSObj *obj)
obj->id = GSF_LE_GET_GUINT32(q->data + 6);
switch (obj->excel_type) {
case 9: /* polygon */
case 0: /* group */
break;
case 1: { /* line */
if (GSF_LE_GET_GUINT8 (q->data+38))
ms_obj_attr_bag_insert (obj->attrs,
ms_obj_attr_new_flag (MS_OBJ_ATTR_ARROW_END));
ms_obj_attr_bag_insert (obj->attrs,
ms_obj_attr_new_uint (MS_OBJ_ATTR_FILL_COLOR,
0x80000000 | GSF_LE_GET_GUINT8 (q->data+34)));
tmp = GSF_LE_GET_GUINT8 (q->data+40);
if (tmp & 0x1)
ms_obj_attr_bag_insert (obj->attrs,
ms_obj_attr_new_flag (MS_OBJ_ATTR_FLIP_H));
if (tmp & 0x2)
ms_obj_attr_bag_insert (obj->attrs,
ms_obj_attr_new_flag (MS_OBJ_ATTR_FLIP_V));
break;
}
case 2: /* rectangle */
break;
case 3: /* oval */
break;
case 4: /* arc */
break;
case 5: /* chart */
break;
case 6: /* textbox */
if (GSF_LE_GET_GUINT8 (q->data+36) > 0) {
ms_obj_attr_bag_insert (obj->attrs,
ms_obj_attr_new_flag (MS_OBJ_ATTR_FILLED));
ms_obj_attr_bag_insert (obj->attrs,
ms_obj_attr_new_uint (MS_OBJ_ATTR_FILL_COLOR,
0x80000000 | GSF_LE_GET_GUINT8 (q->data+35)));
}
ms_obj_attr_bag_insert (obj->attrs,
ms_obj_attr_new_uint (MS_OBJ_ATTR_OUTLINE_COLOR,
0x80000000 | GSF_LE_GET_GUINT8 (q->data+38)));
data = q->data + 70;
g_return_val_if_fail ((unsigned)(data - q->data) < q->length, TRUE);
data += *data + ((*data & 0x1) ? 1 : 2); /* padding byte */
g_return_val_if_fail ((unsigned)(data - q->data) < q->length, TRUE);
/* docs lie, there is no fmla structure */
ms_obj_attr_bag_insert (obj->attrs,
ms_obj_attr_new_ptr (MS_OBJ_ATTR_TEXT,
g_strndup (data, GSF_LE_GET_GUINT16 (q->data + 44))));
break;
case 7: /* button */
break;
case 8: /* picture */
break;
case 9: /* polygon */
ms_obj_attr_bag_insert (obj->attrs,
ms_obj_attr_new_uint (MS_OBJ_ATTR_FILL_COLOR,
......@@ -426,28 +479,48 @@ ms_obj_read_pre_biff8_obj (BiffQuery *q, MSContainer *container, MSObj *obj)
ms_obj_attr_new_uint (MS_OBJ_ATTR_OUTLINE_COLOR,
0x80000000 | GSF_LE_GET_GUINT8 (q->data+38)));
if (ms_biff_query_peek_next (q, &peek_op) &&
peek_op == BIFF_COORDLIST) {
unsigned i, n;
guint tmp;
GArray *array;
if (ms_biff_query_peek_next (q, &peek_op) &&
peek_op == BIFF_COORDLIST) {
unsigned i, n;
guint tmp;
GArray *array;
ms_biff_query_next (q);
n = q->length / 2;
array = g_array_set_size (
g_array_new (FALSE, FALSE, sizeof (double)), n + 2);
ms_biff_query_next (q);
n = q->length / 2;
array = g_array_set_size (
g_array_new (FALSE, FALSE, sizeof (double)), n + 2);
for (i = 0; i < n ; i++) {
tmp = GSF_LE_GET_GUINT16 (q->data + 2*i);
g_array_index (array, double, i) = (double)tmp/ 16384.;
for (i = 0; i < n ; i++) {
tmp = GSF_LE_GET_GUINT16 (q->data + 2*i);
g_array_index (array, double, i) = (double)tmp/ 16384.;
}
g_array_index (array, double, i) = g_array_index (array, double, 0);
g_array_index (array, double, i+1) = g_array_index (array, double, 1);
ms_obj_attr_bag_insert (obj->attrs,
ms_obj_attr_new_array (MS_OBJ_ATTR_POLYGON_COORDS, array));
}
g_array_index (array, double, i) = g_array_index (array, double, 0);
g_array_index (array, double, i+1) = g_array_index (array, double, 1);
ms_obj_attr_bag_insert (obj->attrs,
ms_obj_attr_new_array (MS_OBJ_ATTR_POLYGON_COORDS, array));
}
break;
break;
case 0xB : /* check box */
break;
case 0xC : /* option button */
break;
case 0xD : /* edit box */
break;
case 0xE : /* label */
break;
case 0xF : /* dialog frame */
break;
case 0x10 : /* spinner */
break;
case 0x11 : /* scrollbar */
break;
case 0x12 : /* list box */
break;
case 0x13 : /* group box */
break;
case 0x14 : /* drop down */
break;
default :
;
}
......
......@@ -45,6 +45,7 @@ typedef enum {
/* Ptrs */
MS_OBJ_ATTR_IS_PTR_MASK = 0x2000,
MS_OBJ_ATTR_ANCHOR,
MS_OBJ_ATTR_TEXT,
/* GArrays */
MS_OBJ_ATTR_IS_GARRAY_MASK = 0x4000,
......
......@@ -155,6 +155,8 @@ GNUMERIC_BASE = \
parse-util.h \
pattern.h \
pattern.c \
pivottable.h \
pivottable.c \
plugin-loader-module.c \
plugin-loader-module.h \
plugin-loader.c \
......
......@@ -957,6 +957,8 @@ foo_canvas_text_set_property (GObject *object,
case PROP_CLIP_WIDTH:
text->clip_width = fabs (g_value_get_double (value));
pango_layout_set_width (text->layout,
text->clip_width * PANGO_SCALE);
break;
case PROP_CLIP_HEIGHT:
......
......@@ -1424,6 +1424,27 @@ typedef struct {
} SheetObjectTextClass;
static SheetObjectFilledClass *sheet_object_text_parent_class;
void
sheet_object_text_set_text (SheetObject *so, char const *str)
{
SheetObjectText *sot = SHEET_OBJECT_TEXT (so);
g_return_if_fail (sot != NULL);
g_return_if_fail (str != NULL);
if (sot->label != str) {
GList *l;
g_free (sot->label);
sot->label = g_strdup (str);
for (l = so->realized_list; l; l = l->next) {
FooCanvasGroup *group = FOO_CANVAS_GROUP (l->data);
foo_canvas_item_set (FOO_CANVAS_ITEM (group->item_list->next->data),
"text", sot->label,
NULL);
}
}
}
static void
sheet_object_text_init_full (SheetObjectText *sot, char const *text)
{
......
......@@ -32,5 +32,6 @@ void sheet_object_polygon_outline_color_set (SheetObject *so, StyleColor *color)
#define SHEET_OBJECT_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SHEET_OBJECT_TEXT_TYPE, SheetObjectText))
GType sheet_object_text_get_type (void);
void sheet_object_text_set_text (SheetObject *so, char const *str);
#endif /* GNUMERIC_SHEET_OBJECT_GRAPHIC_H */
......@@ -627,6 +627,10 @@ sv_freeze_panes (SheetView *sv,
unfrozen->row != (SHEET_MAX_ROWS-1)) {
sv->frozen_top_left = *frozen;
sv->unfrozen_top_left = *unfrozen;
if (sv->frozen_top_left.col == sv->unfrozen_top_left.col)
sv->frozen_top_left.col = sv->unfrozen_top_left.col = 0;
if (sv->frozen_top_left.row == sv->unfrozen_top_left.row)
sv->frozen_top_left.row = sv->unfrozen_top_left.row = 0;
} else
frozen = unfrozen = NULL;
}
......
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