[gnumeric] xls: fix reading of scrollbar orientation.



commit 6444f217beab4e9e1dd106e639c7a7ab0c3d5f6f
Author: Morten Welinder <terra gnome org>
Date:   Fri Jan 30 18:03:28 2015 -0500

    xls: fix reading of scrollbar orientation.

 ChangeLog                     |    5 +++++
 NEWS                          |    1 +
 plugins/excel/ChangeLog       |    6 ++++++
 plugins/excel/ms-excel-read.c |    2 ++
 plugins/excel/ms-obj.c        |    6 ++++++
 plugins/excel/ms-obj.h        |    1 +
 src/sheet-object-widget.c     |    8 ++++----
 src/sheet-object-widget.h     |    1 +
 8 files changed, 26 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3f03f5e..28ef488 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-30  Morten Welinder  <terra gnome org>
+
+       * src/sheet-object-widget.c
+       (sheet_widget_adjustment_set_horizontal): Make this public.
+
 2015-01-23  Morten Welinder <terra gnome org>
 
        * configure.ac: Post-release bump.
diff --git a/NEWS b/NEWS
index 96e5d24..ea7f6cd 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Morten:
        * Export xlsx chart axis tick marks.
        * Fix xlsx problem with inverted axis.
        * Export sliders as scrollbars for xls.
+       * Fix xls loading of horizontal scrollbars.  [#743754]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.19
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 08877c4..32778c5 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-30  Morten Welinder  <terra gnome org>
+
+       * ms-obj.c (ms_obj_read_biff8_obj): Gather orientation.
+
+       * ms-excel-read.c (ms_sheet_realize_obj): Set orientation.
+
 2015-01-28  Morten Welinder  <terra gnome org>
 
        * ms-excel-write.c (excel_write_other_v8): Export sliders as-if
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index 4952f55..68f1b3e 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -741,6 +741,8 @@ ms_sheet_realize_obj (MSContainer *container, MSObj *obj)
                                                     ms_obj_attr_get_int (obj->attrs, 
MS_OBJ_ATTR_SCROLLBAR_MAX, 100) - 1,
                                                     ms_obj_attr_get_int (obj->attrs, 
MS_OBJ_ATTR_SCROLLBAR_INC, 1),
                                                     ms_obj_attr_get_int (obj->attrs, 
MS_OBJ_ATTR_SCROLLBAR_PAGE, 10));
+               sheet_widget_adjustment_set_horizontal (obj->gnum_obj,
+                                                       ms_obj_attr_get_uint (obj->attrs, 
MS_OBJ_ATTR_SCROLLBAR_HORIZ, FALSE));
                break;
 
        case MSOT_LIST:
diff --git a/plugins/excel/ms-obj.c b/plugins/excel/ms-obj.c
index 349cdab..a2d7a58 100644
--- a/plugins/excel/ms-obj.c
+++ b/plugins/excel/ms-obj.c
@@ -838,6 +838,9 @@ ms_obj_read_pre_biff8_obj (BiffQuery *q, MSContainer *c, MSObj *obj)
                ms_obj_attr_bag_insert (obj->attrs,
                        ms_obj_attr_new_uint (MS_OBJ_ATTR_SCROLLBAR_PAGE,
                                GSF_LE_GET_GUINT16 (q->data+56)));
+               ms_obj_attr_bag_insert (obj->attrs,
+                       ms_obj_attr_new_uint (MS_OBJ_ATTR_SCROLLBAR_HORIZ,
+                               GSF_LE_GET_GUINT16 (q->data+58)));
 
                {
                        guint8 const *last = q->data + q->length;
@@ -1068,6 +1071,9 @@ ms_obj_read_biff8_obj (BiffQuery *q, MSContainer *c, MSObj *obj)
                        ms_obj_attr_bag_insert (obj->attrs,
                                ms_obj_attr_new_uint (MS_OBJ_ATTR_SCROLLBAR_PAGE,
                                        GSF_LE_GET_GUINT16 (data+16)));
+                       ms_obj_attr_bag_insert (obj->attrs,
+                               ms_obj_attr_new_uint (MS_OBJ_ATTR_SCROLLBAR_HORIZ,
+                                       GSF_LE_GET_GUINT16 (data+18)));
                        ms_obj_dump (data, len, data_len_left, "ScrollBar");
                        break;
 
diff --git a/plugins/excel/ms-obj.h b/plugins/excel/ms-obj.h
index 07a0a37..043d612 100644
--- a/plugins/excel/ms-obj.h
+++ b/plugins/excel/ms-obj.h
@@ -73,6 +73,7 @@ typedef enum {
        MS_OBJ_ATTR_SCROLLBAR_MAX,
        MS_OBJ_ATTR_SCROLLBAR_INC,
        MS_OBJ_ATTR_SCROLLBAR_PAGE,
+       MS_OBJ_ATTR_SCROLLBAR_HORIZ,
        MS_OBJ_ATTR_BLIP_CROP_TOP,
        MS_OBJ_ATTR_BLIP_CROP_BOTTOM,
        MS_OBJ_ATTR_BLIP_CROP_LEFT,
diff --git a/src/sheet-object-widget.c b/src/sheet-object-widget.c
index c50fdb7..be285df 100644
--- a/src/sheet-object-widget.c
+++ b/src/sheet-object-widget.c
@@ -1449,10 +1449,11 @@ cb_adjustment_widget_value_changed (GtkWidget *widget,
        }
 }
 
-static void
-sheet_widget_adjustment_set_horizontal (SheetWidgetAdjustment *swa,
+void
+sheet_widget_adjustment_set_horizontal (SheetObject *so,
                                        gboolean horizontal)
 {
+       SheetWidgetAdjustment *swa = (SheetWidgetAdjustment *)so;
        GList *ptr;
 
        if (!SWA_CLASS (swa)->has_orientation)
@@ -1497,8 +1498,7 @@ sheet_widget_adjustment_set_property (GObject *obj, guint param_id,
 
        switch (param_id) {
        case SWA_PROP_HORIZONTAL:
-               sheet_widget_adjustment_set_horizontal (swa, g_value_get_boolean (value));
-               /* FIXME */
+               sheet_widget_adjustment_set_horizontal (SHEET_OBJECT (swa), g_value_get_boolean (value));
                break;
        default:
                G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, param_id, pspec);
diff --git a/src/sheet-object-widget.h b/src/sheet-object-widget.h
index b785f76..39a923f 100644
--- a/src/sheet-object-widget.h
+++ b/src/sheet-object-widget.h
@@ -70,6 +70,7 @@ void sheet_widget_adjustment_set_link  (SheetObject *so,
                                          GnmExprTop const *result_link);
 GtkAdjustment *sheet_widget_adjustment_get_adjustment (SheetObject *so);
 gboolean sheet_widget_adjustment_get_horizontal (SheetObject *so);
+void sheet_widget_adjustment_set_horizontal (SheetObject *so, gboolean horizontal);
 
 void sheet_widget_checkbox_set_link     (SheetObject *so,
                                          GnmExprTop const *result_link);


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