[gnumeric] xlsx: add more object types, even those we cannot handle.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] xlsx: add more object types, even those we cannot handle.
- Date: Mon, 23 Feb 2015 02:04:45 +0000 (UTC)
commit d7cebd90f6c67d92172ef4bf75435656b1605534
Author: Morten Welinder <terra gnome org>
Date: Sun Feb 22 21:03:56 2015 -0500
xlsx: add more object types, even those we cannot handle.
plugins/excel/xlsx-read-drawing.c | 50 +++++++++++++++++++++++++++++++------
1 files changed, 42 insertions(+), 8 deletions(-)
---
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index bbc46bd..7f27946 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -3440,6 +3440,7 @@ xlsx_vml_client_data_start (GsfXMLIn *xin, xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
GType typ = G_TYPE_NONE;
+ const char *tname = NULL;
static EnumVal const types[] = {
{ "Scroll", 0 },
@@ -3447,26 +3448,59 @@ xlsx_vml_client_data_start (GsfXMLIn *xin, xmlChar const **attrs)
{ "Spin", 2 },
{ "Button", 3 },
{ "Checkbox", 4 },
+ { "Note", 5 },
+ { "Dialog", 6 },
+ { "Drop", 7 },
+ { "Edit", 8 },
+ { "GBox", 9 },
+ { "Label", 10 },
+ { "LineA", 11 },
+ { "List", 12 },
+ { "Movie", 13 },
+ { "Pict", 14 },
+ { "RectA", 15 },
+ { "Shape", 16 },
+ { "Group", 17 },
+ { "Rect", 18 },
{ NULL, 0 }
};
static GType gtypes[G_N_ELEMENTS(types) - 1];
if (!gtypes[0]) {
- gtypes[0] = GNM_SOW_SCROLLBAR_TYPE;
- gtypes[1] = GNM_SOW_RADIO_BUTTON_TYPE;
- gtypes[2] = GNM_SOW_SPIN_BUTTON_TYPE;
- gtypes[3] = GNM_SOW_BUTTON_TYPE;
- gtypes[4] = GNM_SOW_CHECKBOX_TYPE;
+ int i = 0;
+ gtypes[i++] = GNM_SOW_SCROLLBAR_TYPE;
+ gtypes[i++] = GNM_SOW_RADIO_BUTTON_TYPE;
+ gtypes[i++] = GNM_SOW_SPIN_BUTTON_TYPE;
+ gtypes[i++] = GNM_SOW_BUTTON_TYPE;
+ gtypes[i++] = GNM_SOW_CHECKBOX_TYPE;
+ gtypes[i++] = G_TYPE_NONE;
+ gtypes[i++] = G_TYPE_NONE;
+ gtypes[i++] = G_TYPE_NONE;
+ gtypes[i++] = G_TYPE_NONE;
+ gtypes[i++] = G_TYPE_NONE;
+ gtypes[i++] = G_TYPE_NONE;
+ gtypes[i++] = G_TYPE_NONE;
+ gtypes[i++] = G_TYPE_NONE;
+ gtypes[i++] = G_TYPE_NONE;
+ gtypes[i++] = G_TYPE_NONE;
+ gtypes[i++] = G_TYPE_NONE;
+ gtypes[i++] = G_TYPE_NONE;
+ gtypes[i++] = G_TYPE_NONE;
}
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) {
int tmp;
-
- if (attr_enum (xin, attrs, "ObjectType", types, &tmp))
+ if (attr_enum (xin, attrs, "ObjectType", types, &tmp)) {
typ = gtypes[tmp];
+ tname = attrs[1];
+ }
}
- if (typ != G_TYPE_NONE && !state->so) {
+ if (state->so) {
+ g_warning ("New object when one is in progress.");
+ } else if (typ == G_TYPE_NONE) {
+ g_printerr ("Unhandled object of type %s\n", tname);
+ } else {
state->so = SHEET_OBJECT (g_object_new (typ, NULL));
state->so_direction = GOD_ANCHOR_DIR_DOWN_RIGHT;
state->pending_objects = g_slist_prepend (state->pending_objects, state->so);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]