[gnumeric] xlsx: beginnings of Combo/List widget import.



commit 58bf6b5900ef7cf2ca74108ab809b77fe6b17e07
Author: Morten Welinder <terra gnome org>
Date:   Tue Feb 24 21:48:28 2015 -0500

    xlsx: beginnings of Combo/List widget import.

 plugins/excel/xlsx-read-drawing.c |    6 +++---
 src/sheet-object-widget.c         |    5 -----
 src/sheet-object-widget.h         |    4 ++++
 3 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index d5f1cf1..b48e951 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -3463,12 +3463,12 @@ xlsx_vml_client_data_start (GsfXMLIn *xin, xmlChar const **attrs)
                gtypes[i++] = GNM_SOW_CHECKBOX_TYPE;
                gtypes[i++] = G_TYPE_NONE;
                gtypes[i++] = G_TYPE_NONE;
+               gtypes[i++] = GNM_SOW_COMBO_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++] = GNM_SOW_LIST_TYPE;
                gtypes[i++] = G_TYPE_NONE;
                gtypes[i++] = G_TYPE_NONE;
                gtypes[i++] = G_TYPE_NONE;
@@ -3645,7 +3645,7 @@ static void
 xlsx_vml_adj (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 {
        XLSXReadState *state = (XLSXReadState *)xin->user_state;
-       if (state->so) {
+       if (GNM_IS_SOW_ADJUSTMENT (state->so)) {
                GtkAdjustment *adj = sheet_widget_adjustment_get_adjustment (state->so);
                double x = g_ascii_strtod (xin->content->str, NULL);
                switch (xin->node->user_data.v_int) {
diff --git a/src/sheet-object-widget.c b/src/sheet-object-widget.c
index 8bcffc8..1855a79 100644
--- a/src/sheet-object-widget.c
+++ b/src/sheet-object-widget.c
@@ -1306,9 +1306,6 @@ SOW_MAKE_TYPE (button, Button,
 
 /****************************************************************************/
 
-#define GNM_SOW_ADJUSTMENT_TYPE   (sheet_widget_adjustment_get_type())
-#define GNM_SOW_ADJUSTMENT(obj)        (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNM_SOW_ADJUSTMENT_TYPE, 
SheetWidgetAdjustment))
-#define GNM_IS_SOW_ADJUSTMENT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_SOW_ADJUSTMENT_TYPE))
 #define DEP_TO_ADJUSTMENT(d_ptr)       (SheetWidgetAdjustment *)(((char *)d_ptr) - 
G_STRUCT_OFFSET(SheetWidgetAdjustment, dep))
 #define GNM_SOW_ADJUSTMENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNM_SOW_ADJUSTMENT_TYPE, 
SheetWidgetAdjustmentClass))
 #define SWA_CLASS(so)               (GNM_SOW_ADJUSTMENT_CLASS (G_OBJECT_GET_CLASS(so)))
@@ -1334,8 +1331,6 @@ enum {
        SWA_PROP_HORIZONTAL
 };
 
-static GType sheet_widget_adjustment_get_type (void);
-
 #ifndef g_signal_handlers_disconnect_by_data
 #define g_signal_handlers_disconnect_by_data(instance, data) \
   g_signal_handlers_disconnect_matched ((instance), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (data))
diff --git a/src/sheet-object-widget.h b/src/sheet-object-widget.h
index 3b25df8..cc49651 100644
--- a/src/sheet-object-widget.h
+++ b/src/sheet-object-widget.h
@@ -16,6 +16,10 @@ GType sheet_object_widget_get_type (void);
 #define GNM_SOW(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), GNM_SOW_TYPE, SheetObjectWidget))
 #define GNM_IS_SOW(o)    (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_SOW_TYPE))
 
+GType sheet_widget_adjustment_get_type (void);
+#define GNM_SOW_ADJUSTMENT_TYPE   (sheet_widget_adjustment_get_type())
+#define GNM_SOW_ADJUSTMENT(obj)        (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNM_SOW_ADJUSTMENT_TYPE, 
SheetWidgetAdjustment))
+#define GNM_IS_SOW_ADJUSTMENT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_SOW_ADJUSTMENT_TYPE))
 
 GType sheet_widget_frame_get_type       (void); /* convert to non-widget */
 #define GNM_SOW_FRAME_TYPE (sheet_widget_frame_get_type ())


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]