Commit 88c273ae authored by Morten Welinder's avatar Morten Welinder

xlsx: export combos and lists.

parent 58bf6b59
2015-02-25 Morten Welinder <terra@gnome.org>
* src/sheet-object-widget.c (sheet_widget_list_base_set_sheet):
Also evaluate here.
(SOW_MAKE_TYPE): Don't evaluate unless we have a sheet for the
contents.
2015-02-23 Morten Welinder <terra@gnome.org>
* src/sheet-object-widget.c (sheet_widget_radio_button_get_value):
......
......@@ -16,14 +16,14 @@ Andreas:
* Fix ODF style import of secondary plots. [#744930]
Morten:
* Initial xlsx import of sheet widgets.
* Initial xlsx export of sheet widgets.
* xlsx import/export of patterns.
* Implement xlsx import of sheet widgets.
* Implement xlsx export of sheet widgets.
* Fix xlsx import/export of patterns.
* Plug leaks.
* Arrow properties editor. [#158327]
* Fix xlsx export of line style None.
* Fix search-and-replace problem with text format.
* xlsx import/export of gradients.
* Fix xlsx import/export of gradients.
* Fix undo problems with scrollbars.
--------------------------------------------------------------------------
......
2015-02-25 Morten Welinder <terra@gnome.org>
* xlsx-write.c (xlsx_write_sheet): Also write combos and lists.
* xlsx-write-drawing.c (xlsx_write_legacy_object): Ditto.
2015-02-24 Morten Welinder <terra@gnome.org>
* xlsx-read.c (xlsx_parse_rel_by_id): Debug code.
......
......@@ -1466,10 +1466,13 @@ xlsx_write_legacy_object (XLSXWriteState *state, GsfXMLOut *xml, SheetObject *so
{
const char *otype = NULL;
GnmExprTop const *tlink = NULL;
GnmExprTop const *trange = NULL;
double res_pts[4] = {0.,0.,0.,0.};
GtkAdjustment *adj = NULL;
int horiz = -1;
int checked = -1;
int selected = -1;
const char *seltype = NULL;
gboolean has_text_prop =
g_object_class_find_property (G_OBJECT_GET_CLASS (so), "text") != NULL;
char *text = NULL;
......@@ -1512,11 +1515,13 @@ xlsx_write_legacy_object (XLSXWriteState *state, GsfXMLOut *xml, SheetObject *so
otype = "Scroll";
tlink = sheet_widget_adjustment_get_link (so);
adj = sheet_widget_adjustment_get_adjustment (so);
g_object_ref (adj);
horiz = sheet_widget_adjustment_get_horizontal (so);
} else if (GNM_IS_SOW_SPINBUTTON (so)) {
otype = "Spin";
tlink = sheet_widget_adjustment_get_link (so);
adj = sheet_widget_adjustment_get_adjustment (so);
g_object_ref (adj);
} else if (GNM_IS_SOW_BUTTON (so)) {
otype = "Button";
tlink = sheet_widget_button_get_link (so);
......@@ -1535,6 +1540,19 @@ xlsx_write_legacy_object (XLSXWriteState *state, GsfXMLOut *xml, SheetObject *so
tlink = sheet_widget_checkbox_get_link (so);
g_object_get (so, "active", &c, NULL);
checked = c;
} else if (GNM_IS_SOW_COMBO (so)) {
otype = "Drop";
tlink = sheet_widget_list_base_get_result_link (so);
trange = sheet_widget_list_base_get_content_link (so);
adj = sheet_widget_list_base_get_adjustment (so);
// selected = ;
} else if (GNM_IS_SOW_LIST (so)) {
otype = "List";
tlink = sheet_widget_list_base_get_result_link (so);
trange = sheet_widget_list_base_get_content_link (so);
adj = sheet_widget_list_base_get_adjustment (so);
// selected = ;
seltype = "Single";
} else {
g_assert_not_reached ();
}
......@@ -1564,7 +1582,18 @@ xlsx_write_legacy_object (XLSXWriteState *state, GsfXMLOut *xml, SheetObject *so
gtk_adjustment_get_step_increment (adj), -1);
gsf_xml_out_simple_float_element (xml, "x:Page",
gtk_adjustment_get_page_increment (adj), -1);
g_object_unref (adj);
}
if (trange) {
char *s = gnm_expr_top_as_string (trange, &pp0, state->convs);
gsf_xml_out_simple_element (xml, "x:FmlaRange", s);
g_free (s);
gnm_expr_top_unref (trange);
}
if (selected >= 1)
gsf_xml_out_simple_int_element (xml, "x:Sel", selected);
if (seltype)
gsf_xml_out_simple_element (xml, "x:SelType", seltype);
if (horiz >= 0)
gsf_xml_out_simple_element (xml, "x:Horiz", horiz ? "t" : "f");
......
......@@ -2730,7 +2730,9 @@ xlsx_write_sheet (XLSXWriteState *state, GsfOutfile *dir, GsfOutfile *wb_part, u
GNM_IS_SOW_SPINBUTTON (so) ||
GNM_IS_SOW_BUTTON (so) ||
GNM_IS_SOW_RADIO_BUTTON (so) ||
GNM_IS_SOW_CHECKBOX (so))
GNM_IS_SOW_CHECKBOX (so) ||
GNM_IS_SOW_COMBO (so) ||
GNM_IS_SOW_LIST (so))
legacy_drawing_objs = g_slist_prepend (legacy_drawing_objs, so);
else if (IS_GNM_FILTER_COMBO (so))
; /* Nothing here */
......
......@@ -3650,6 +3650,8 @@ sheet_widget_list_base_set_sheet (SheetObject *so, Sheet *sheet)
dependent_set_sheet (&swl->content_dep, sheet);
dependent_set_sheet (&swl->output_dep, sheet);
list_content_eval (&swl->content_dep); /* populate the list */
return FALSE;
}
......@@ -3731,9 +3733,10 @@ sheet_widget_list_base_set_links (SheetObject *so,
if (output && swl->output_dep.sheet)
dependent_link (&swl->output_dep);
dependent_set_expr (&swl->content_dep, content);
if (content && swl->content_dep.sheet)
if (content && swl->content_dep.sheet) {
dependent_link (&swl->content_dep);
list_content_eval (&swl->content_dep); /* populate the list */
list_content_eval (&swl->content_dep); /* populate the list */
}
}
GnmExprTop const *
......
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