1759
* Create a ColRowInfo equivalent to the XML subtree of doc.
1762
1759
xml_read_colrow_info (XmlParseContext *ctxt, xmlNodePtr tree,
1763
ColRowInfo *info, double *size_pts)
1767
info->size_pts = -1;
1768
xml_node_get_int (tree, "No", &info->pos);
1769
xml_node_get_double (tree, "Unit", size_pts);
1770
if (xml_node_get_int (tree, "MarginA", &val))
1771
info->margin_a = val;
1772
if (xml_node_get_int (tree, "MarginB", &val))
1773
info->margin_b = val;
1766
if (!xml_node_get_int (tree, "No", &pos) ||
1767
NULL == (cri = sheet_colrow_fetch (ctxt->sheet, pos, is_cols)))
1774
1770
if (xml_node_get_int (tree, "HardSize", &val))
1775
info->hard_size = val;
1771
cri->hard_size = val;
1772
if (xml_node_get_double (tree, "Unit", &size_pts)) {
1774
sheet_col_set_size_pts (ctxt->sheet,
1775
pos, size_pts, cri->hard_size);
1777
sheet_row_set_size_pts (ctxt->sheet,
1778
pos, size_pts, cri->hard_size);
1776
1781
if (xml_node_get_int (tree, "Hidden", &val) && val)
1777
info->visible = FALSE;
1782
cri->visible = FALSE;
1778
1783
if (xml_node_get_int (tree, "Collapsed", &val) && val)
1779
info->is_collapsed = TRUE;
1784
cri->is_collapsed = TRUE;
1780
1785
if (xml_node_get_int (tree, "OutlineLevel", &val) && val > 0)
1781
info->outline_level = val;
1782
if (xml_node_get_int (tree, "Count", &count))
1786
cri->outline_level = val;
1788
if (xml_node_get_int (tree, "Count", &val)) {
1789
/* resize flags are already set only need to copy the sizes */
1790
for ( ; --val > 0 ; )
1791
colrow_copy (sheet_colrow_fetch (ctxt->sheet, ++pos, is_cols), cri);
1788
1796
xml_read_cols_info (XmlParseContext *ctxt, xmlNodePtr tree)
1790
1798
xmlNodePtr cols, col;
1791
double size_pts, tmp;
1794
Sheet *sheet = ctxt->sheet;
1796
1801
cols = e_xml_get_child_by_name (tree, CC2XML ("Cols"));
1797
1802
if (cols == NULL)
1800
1805
if (xml_node_get_double (cols, "DefaultSizePts", &tmp))
1801
sheet_col_set_default_size_pts (sheet, tmp);
1806
sheet_col_set_default_size_pts (ctxt->sheet, tmp);
1803
1808
for (col = cols->xmlChildrenNode; col; col = col->next)
1804
if (!xmlIsBlankNode (col)) {
1805
info = sheet_col_new (sheet);
1806
count = xml_read_colrow_info (ctxt, col, info, &size_pts);
1807
sheet_col_add (sheet, info);
1808
sheet_col_set_size_pts (ctxt->sheet, info->pos, size_pts, info->hard_size);
1810
/* resize flags are already set only need to copy the sizes */
1811
for (pos = info->pos ; --count > 0 ; )
1812
colrow_copy (sheet_col_fetch (ctxt->sheet, ++pos), info);
1809
if (!xmlIsBlankNode (col))
1810
xml_read_colrow_info (ctxt, col, TRUE);
1817
1814
xml_read_rows_info (XmlParseContext *ctxt, xmlNodePtr tree)
1819
1816
xmlNodePtr rows, row;
1820
double size_pts, tmp;
1823
Sheet *sheet = ctxt->sheet;
1825
1819
rows = e_xml_get_child_by_name (tree, CC2XML ("Rows"));
1826
1820
if (rows == NULL)
1829
1823
if (xml_node_get_double (rows, "DefaultSizePts", &tmp))
1830
sheet_row_set_default_size_pts (sheet, tmp);
1824
sheet_row_set_default_size_pts (ctxt->sheet, tmp);
1832
1826
for (row = rows->xmlChildrenNode; row; row = row->next)
1833
if (!xmlIsBlankNode (row)) {
1834
info = sheet_row_new (sheet);
1835
count = xml_read_colrow_info (ctxt, row, info, &size_pts);
1836
sheet_row_add (sheet, info);
1837
sheet_row_set_size_pts (ctxt->sheet, info->pos, size_pts, info->hard_size);
1839
/* resize flags are already set only need to copy the sizes */
1840
for (pos = info->pos ; --count > 0 ; )
1841
colrow_copy (sheet_row_fetch (ctxt->sheet, ++pos), info);
1827
if (!xmlIsBlankNode (row))
1828
xml_read_colrow_info (ctxt, row, FALSE);