Commit 9a54ce84 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Handle "protected" attribute. Ditto. Ditto. Patch from Klokan Petr Pridal.

2006-03-13  Morten Welinder  <terra@gnome.org>

	* src/xml-io.c (xml_sheet_read): Handle "protected" attribute.
	* src/xml-sax-read.c (xml_sax_sheet_start): Ditto.
	* src/xml-sax-write.c (xml_write_sheet): Ditto.
	Patch from Klokan Petr Pridal.  [#334257]
parent 8ca3cd70
2006-03-13 Morten Welinder <terra@gnome.org>
* src/xml-io.c (xml_sheet_read): Handle "protected" attribute.
* src/xml-sax-read.c (xml_sax_sheet_start): Ditto.
* src/xml-sax-write.c (xml_write_sheet): Ditto.
Patch from Klokan Petr Pridal. [#334257]
2006-03-11 Morten Welinder <terra@gnome.org>
* src/xml-sax-write.c (xml_write_cell_and_position): Wow. Botched
......
......@@ -19,6 +19,9 @@ Jody:
* AREAS handles error conditions better.
* Make Array formulas use less memory
Klokan Pridal:
* Implement xml saving/loading of "protected" attribute. [#334257]
Luciano Miguel Wolf:
* ODS import improvements.
......
2006-03-13 Morten Welinder <terra@gnome.org>
* src/xml-io.c (xml_sheet_read): Handle "protected" attribute.
* src/xml-sax-read.c (xml_sax_sheet_start): Ditto.
* src/xml-sax-write.c (xml_write_sheet): Ditto.
Patch from Klokan Petr Pridal. [#334257]
2006-03-11 Morten Welinder <terra@gnome.org>
* src/xml-sax-write.c (xml_write_cell_and_position): Wow. Botched
......
......@@ -226,6 +226,7 @@
<xsd:attribute name="OutlineSymbolsBelow" type="xsd:boolean" use="required"/>
<xsd:attribute name="OutlineSymbolsRight" type="xsd:boolean" use="required"/>
<xsd:attribute name="RTL_Layout" type="xsd:boolean" use="optional"/>
<xsd:attribute name="Protected" type="xsd:boolean" use="optional"/>
<xsd:attribute name="TabColor" type="gmr:color" use="optional"/>
<xsd:attribute name="TabTextColor" type="gmr:color" use="optional"/>
</xsd:complexType>
......
2006-03-13 Morten Welinder <terra@gnome.org>
* dialog-cell-format.c (fmt_dialog_init_protection_page): Refer to
sheet protection, not workbook protection.
(cb_fmt_dialog_dialog_buttons): Ditto.
Patch from Klokan Petr Pridal. [#334257]
2006-03-07 Luciano Wolf <luciano.wolf@indt.org.br>
* dialog-doc-metadata.c: Fixed compile errors.
......
......@@ -1516,7 +1516,7 @@ fmt_dialog_init_protection_page (FormatState *state)
G_CALLBACK (cb_protection_hidden_toggle), state);
state->protection.sheet_protected_changed = FALSE;
flag = wb_control_view (WORKBOOK_CONTROL (state->wbcg))->is_protected;
flag = state->sheet->is_protected;
w = glade_xml_get_widget (state->gui, "protection_sheet_protected");
state->protection.sheet_protected = GTK_CHECK_BUTTON (w);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), flag);
......@@ -1983,8 +1983,7 @@ cb_fmt_dialog_dialog_buttons (GtkWidget *btn, FormatState *state)
}
if (state->protection.sheet_protected_changed) {
WorkbookView *wbv = wb_control_view (WORKBOOK_CONTROL (state->wbcg));
wbv->is_protected = state->protection.sheet_protected_value;
state->sheet->is_protected = state->protection.sheet_protected_value;
state->protection.sheet_protected_changed = FALSE;
}
......
......@@ -1956,6 +1956,8 @@ xml_sheet_read (XmlParseContext *ctxt, xmlNodePtr tree)
g_object_set (sheet, "display-outlines-right", tmp, NULL);
if (xml_node_get_bool (tree, "RTL_Layout", &tmp))
g_object_set (sheet, "text-is-rtl", tmp, NULL);
if (xml_node_get_bool (tree, "Protected", &tmp))
g_object_set (sheet, "protected", tmp, NULL);
if (xml_node_get_enum (tree, "Visibility", GNM_SHEET_VISIBILITY_TYPE, &tmpi))
g_object_set (sheet, "visibility", tmpi, NULL);
sheet->tab_color = xml_node_get_color (tree, "TabColor");
......
......@@ -290,6 +290,7 @@ typedef struct {
int outline_symbols_below;
int outline_symbols_right;
int text_is_rtl;
int is_protected;
GnmSheetVisibility visibility;
GnmColor *tab_color;
......@@ -466,9 +467,10 @@ xml_sax_sheet_start (GsfXMLIn *gsf_state, xmlChar const **attrs)
GnmColor *color = NULL;
state->hide_col_header = state->hide_row_header =
state->display_formulas = state->hide_zero =
state->hide_grid = state->display_outlines =
state->outline_symbols_below = state->outline_symbols_right = state->text_is_rtl = -1;
state->display_formulas = state->hide_zero =
state->hide_grid = state->display_outlines =
state->outline_symbols_below = state->outline_symbols_right =
state->text_is_rtl = state->is_protected = -1;
state->visibility = GNM_SHEET_VISIBILITY_VISIBLE;
state->tab_color = NULL;
state->sheet_zoom = 1.; /* default */
......@@ -494,6 +496,8 @@ xml_sax_sheet_start (GsfXMLIn *gsf_state, xmlChar const **attrs)
state->visibility = tmpi;
else if (xml_sax_attr_bool (attrs, "RTL_Layout", &tmp))
state->text_is_rtl = tmp;
else if (xml_sax_attr_bool (attrs, "Protected", &tmp))
state->is_protected = tmp;
else if (xml_sax_attr_color (attrs, "TabColor", &color))
state->tab_color = color;
else
......
......@@ -1068,6 +1068,9 @@ xml_write_sheet (GnmOutputXML *state, Sheet const *sheet)
if (sheet->text_is_rtl)
gsf_xml_out_add_bool (state->output,
"RTL_Layout", sheet->text_is_rtl);
if (sheet->is_protected)
gsf_xml_out_add_bool (state->output,
"Protected", sheet->is_protected);
gsf_xml_out_add_enum (state->output,
"Visibility", GNM_SHEET_VISIBILITY_TYPE, sheet->visibility);
......
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