[gnumeric] When reading an ODF file make all sheets of equal size. [#505]
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] When reading an ODF file make all sheets of equal size. [#505]
- Date: Mon, 6 Jul 2020 02:59:07 +0000 (UTC)
commit 37c1f98afcd7c0557c13c70642ade852692ce043
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date: Sun Jul 5 20:58:12 2020 -0600
When reading an ODF file make all sheets of equal size. [#505]
2020-07-05 Andreas J. Guelzow <aguelzow pyrshep ca>
* openoffice-read.c (openoffice_file_open): Make all read sheets the same size
NEWS | 1 +
plugins/openoffice/ChangeLog | 4 ++++
plugins/openoffice/openoffice-read.c | 25 +++++++++++++++++++++++++
3 files changed, 30 insertions(+)
---
diff --git a/NEWS b/NEWS
index 878eefc8b..5787ad2b9 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Andreas:
* Improve export of line markers to ODF for interoperability
* Improve line marker handling on import
* Fix LaTeX export. [#489]
+ * When reading an ODF file make all sheets of equal size. [#505]
Jean:
* Fix xlsx object non-import crash.
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 00cf3fea3..e2cf857d3 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,7 @@
+2020-07-05 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * openoffice-read.c (openoffice_file_open): Make all read sheets the same size
+
2020-07-04 Andreas J. Guelzow <aguelzow pyrshep ca>
* openoffice-read.c: Add draw_control to draw:g
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index af88fce3b..87431825d 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -13920,6 +13920,9 @@ openoffice_file_open (G_GNUC_UNUSED GOFileOpener const *fo, GOIOContext *io_cont
GError *err = NULL;
int i;
gboolean content_malformed = FALSE;
+ GSList *l;
+ int max_rows = 0;
+ int max_cols = 0;
zip = gsf_infile_zip_new (input, &err);
if (zip == NULL) {
@@ -14114,6 +14117,28 @@ openoffice_file_open (G_GNUC_UNUSED GOFileOpener const *fo, GOIOContext *io_cont
odf_clear_conventions (&state); /* contain references to xin */
state.sheet_order = g_slist_reverse (state.sheet_order);
+ /* We want to make all sheets the same size (see bug 505 on gitlab) */
+ l = state.sheet_order;
+ while (l != NULL) {
+ sheet_order_t *sot;
+ sot = (sheet_order_t *)(l->data);
+ if (sot->cols > max_cols)
+ max_cols = sot->cols;
+ if (sot->rows > max_rows)
+ max_rows = sot->rows;
+ l = l->next;
+ }
+ l = state.sheet_order;
+ while (l != NULL) {
+ sheet_order_t *sot;
+ gboolean perr = FALSE;
+ sot = (sheet_order_t *)(l->data);
+ if ((sot->cols < max_cols) || (sot->rows < max_rows))
+ g_object_unref (gnm_sheet_resize (sot->sheet, max_cols, max_rows,
+ NULL, &perr));
+ l = l->next;
+ }
+
if (NULL != styles) {
GsfXMLInDoc *doc = gsf_xml_in_doc_new (styles_dtd,
gsf_odf_get_ns ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]