[gnumeric] xlsx: export/import scroll bar orientation.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] xlsx: export/import scroll bar orientation.
- Date: Sat, 7 Feb 2015 15:57:41 +0000 (UTC)
commit 8e211016974af74b7a192704195549c9ea8c73be
Author: Morten Welinder <terra gnome org>
Date: Sat Feb 7 10:57:12 2015 -0500
xlsx: export/import scroll bar orientation.
plugins/excel/xlsx-read-drawing.c | 18 ++++++++++++++++++
plugins/excel/xlsx-write-drawing.c | 6 ++++++
2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index ae4e5de..9154c11 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -3286,6 +3286,23 @@ xlsx_vml_fmla_range (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
}
static void
+xlsx_vml_horiz (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
+{
+ XLSXReadState *state = (XLSXReadState *)xin->user_state;
+ if (state->so) {
+ const char *s = xin->content->str;
+ gboolean horiz;
+ if (g_ascii_toupper (s[0]) == 'T')
+ horiz = TRUE;
+ else if (g_ascii_toupper (s[0]) == 'F')
+ horiz = FALSE;
+ else
+ return; /* Blank means default. */
+ //sheet_widget_adjustment_set_horizontal (state->so, horiz);
+ }
+}
+
+static void
xlsx_vml_adj (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
@@ -3332,6 +3349,7 @@ GSF_XML_IN_NODE_FULL (START, SP, XL_NS_LEG_VML, "shape", GSF_XML_NO_CONTENT, FAL
GSF_XML_IN_NODE (CLIENT_DATA, DX, XL_NS_LEG_XL, "Dx", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (CLIENT_DATA, FMLA_LINK, XL_NS_LEG_XL, "FmlaLink", GSF_XML_CONTENT, NULL,
&xlsx_vml_fmla_link),
GSF_XML_IN_NODE (CLIENT_DATA, FMLA_RANGE, XL_NS_LEG_XL, "FmlaRange", GSF_XML_CONTENT, NULL,
&xlsx_vml_fmla_range),
+ GSF_XML_IN_NODE (CLIENT_DATA, HORIZ, XL_NS_LEG_XL, "Horiz", GSF_XML_CONTENT, NULL, &xlsx_vml_horiz),
GSF_XML_IN_NODE_FULL (CLIENT_DATA, INC, XL_NS_LEG_XL, "Inc", GSF_XML_CONTENT, FALSE, TRUE, NULL,
&xlsx_vml_adj, 2),
GSF_XML_IN_NODE (CLIENT_DATA, LCT, XL_NS_LEG_XL, "LCT", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE_FULL (CLIENT_DATA, XMIN, XL_NS_LEG_XL, "Min", GSF_XML_CONTENT, FALSE, TRUE, NULL,
&xlsx_vml_adj, 0),
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index d453f69..31b1ba3 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -1115,6 +1115,8 @@ xlsx_write_legacy_drawing_objects (XLSXWriteState *state, GsfOutput *sheet_part,
GnmExprTop const *tlink = NULL;
double res_pts[4] = {0.,0.,0.,0.};
GtkAdjustment *adj = NULL;
+ int horiz = -1;
+
sheet_object_position_pts_get (so, res_pts);
gsf_xml_out_start_element (xml, "v:shape");
@@ -1134,6 +1136,7 @@ xlsx_write_legacy_drawing_objects (XLSXWriteState *state, GsfOutput *sheet_part,
otype = "Scroll";
tlink = sheet_widget_adjustment_get_link (so);
adj = sheet_widget_adjustment_get_adjustment (so);
+ horiz = sheet_widget_adjustment_get_horizontal (so);
} else if (GNM_IS_SOW_SPINBUTTON (so)) {
otype = "Spin";
tlink = sheet_widget_adjustment_get_link (so);
@@ -1173,6 +1176,9 @@ xlsx_write_legacy_drawing_objects (XLSXWriteState *state, GsfOutput *sheet_part,
gsf_xml_out_simple_float_element (xml, "x:Page",
gtk_adjustment_get_page_increment (adj), -1);
}
+ if (horiz >= 0)
+ gsf_xml_out_simple_element (xml, "x:Horiz", horiz ? "t" : "f");
+
gsf_xml_out_end_element (xml); /* </x:ClientData> */
gsf_xml_out_end_element (xml); /* </v:shape> */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]