Commit ef266e32 authored by Erik Troan's avatar Erik Troan
Browse files

1) save/load window sizes in spreadsheet file

2) recalc worksheets on load
parent e3e94c92
......@@ -690,6 +690,8 @@ workbook_new (void)
wb->sheets = g_hash_table_new (g_str_hash, g_str_equal);
wb->table = gtk_table_new (0, 0, 0);
gtk_window_set_policy(GTK_WINDOW(wb->toplevel), 1, 1, 0);
wb->max_iterations = 1;
workbook_setup_status_area (wb);
......
......@@ -482,6 +482,7 @@ Workbook *gnumericReadXmlWorkbook(const char *filename) {
ctxt.nameTable = g_hash_table_new(ptrHash, ptrCompare);
ctxt.fontIdx = 1;
wb = readXmlWorkbook(&ctxt, res->root);
workbook_recalc(wb);
g_hash_table_foreach(ctxt.nameTable, nameFree, NULL);
g_hash_table_destroy(ctxt.nameTable);
......@@ -1076,6 +1077,11 @@ static xmlNodePtr writeXmlWorkbook(parseXmlContextPtr ctxt, Workbook *wb) {
child = writeXmlStyle(ctxt, &wb->style);
if (child) xmlAddChild(cur, child);
child = xmlNewNode(ctxt->ns, "Geometry", NULL);
xmlSetIntValue(child, "Width", wb->toplevel->allocation.width);
xmlSetIntValue(child, "Height", wb->toplevel->allocation.height);
xmlAddChild(cur, child);
/*
* Cells informations
*/
......@@ -1102,6 +1108,16 @@ static Workbook *readXmlWorkbook(parseXmlContextPtr ctxt, xmlNodePtr tree) {
ret = workbook_new ();
ctxt->wb = ret;
child = xmlSearchChild(tree, "Geometry");
if (child) {
int width, height;
int true = 1;
xmlGetIntValue(child, "Width", &width);
xmlGetIntValue(child, "Height", &height);
gtk_widget_set_usize(ret->toplevel, width, height);
}
child = xmlSearchChild(tree, "Style");
if (child != NULL)
readXmlStyle(ctxt, child, &ret->style);
......
Supports Markdown
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