[gnumeric] xlsx: fix import/export of default column width.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] xlsx: fix import/export of default column width.
- Date: Thu, 17 Mar 2022 23:10:24 +0000 (UTC)
commit b5ad82838cd36f120012df3f5fccf314289596a0
Author: Morten Welinder <terra gnome org>
Date: Thu Mar 17 19:09:58 2022 -0400
xlsx: fix import/export of default column width.
NEWS | 1 +
plugins/excel/xlsx-read.c | 6 ++++--
plugins/excel/xlsx-write.c | 2 ++
3 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index d0311b676..f40979b31 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Morten:
* Set default number of sheets to 1.
* Fix edge error case for SMALL and LARGE. [#620]
* Increase the default column width a bit.
+ * Fix xlsx import/export of default column width.
--------------------------------------------------------------------------
Gnumeric 1.12.51
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index 29681300b..439625441 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -1778,11 +1778,13 @@ static void
xlsx_CT_SheetFormatPr (GsfXMLIn *xin, xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
- gnm_float h;
+ gnm_float h, w;
int i;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) {
- if (attr_float (xin, attrs, "defaultRowHeight", &h))
+ if (attr_float (xin, attrs, "defaultColWidth", &w))
+ sheet_col_set_default_size_pts (state->sheet, w);
+ else if (attr_float (xin, attrs, "defaultRowHeight", &h))
sheet_row_set_default_size_pts (state->sheet, h);
else if (attr_int (xin, attrs, "outlineLevelRow", &i)) {
if (i > 0)
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index e3071e518..351793a45 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -2941,6 +2941,8 @@ xlsx_write_sheet (XLSXWriteState *state, GsfOutfile *wb_part, Sheet *sheet)
gsf_xml_out_end_element (xml); /* </sheetViews> */
/* element sheetFormatPr { CT_SheetFormatPr }?, */
gsf_xml_out_start_element (xml, "sheetFormatPr");
+ go_xml_out_add_double (xml, "defaultColWidth",
+ sheet_col_get_default_size_pts (state->sheet));
go_xml_out_add_double (xml, "defaultRowHeight",
sheet_row_get_default_size_pts (state->sheet));
if (state->sheet->rows.max_outline_level > 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]