[gnumeric] Ignore whole sheet print areas when loading xls files
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnumeric] Ignore whole sheet print areas when loading xls files
- Date: Thu, 11 Jun 2009 23:59:07 -0400 (EDT)
commit d359d622aeb1e1df3f19721cf6abaa6caa1f6f16
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date: Thu Jun 11 21:58:25 2009 -0600
Ignore whole sheet print areas when loading xls files
2009-06-11 Andreas J. Guelzow <aguelzow pyrshep ca>
* ms-excel-read.c (excel_parse_name): If it looks like the print area
could have been one of our old "whole sheet" areas, set it to nil.
plugins/excel/ChangeLog | 5 +++++
plugins/excel/ms-excel-read.c | 16 ++++++++++++++++
2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index ee1f0fe..ee1e9af 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-11 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * ms-excel-read.c (excel_parse_name): If it looks like the print area
+ could have been one of our old "whole sheet" areas, set it to nil.
+
2009-06-09 Jody Goldberg <jody gnome org>
* xls-read-pivot.c (xls_read_SXIVD) : ignore magic index of 0xfffe.
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index b6ee2cf..40c05e6 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -3275,6 +3275,22 @@ excel_parse_name (GnmXLImporter *importer, Sheet *sheet, char *name,
});
}
+ if (0 == strcmp (name, "Print_Area")) {
+ GnmValue *val = gnm_expr_get_range (texpr->expr);
+ if (val != NULL && val->type == VALUE_CELLRANGE) {
+ GnmEvalPos ep;
+ int height, width;
+ eval_pos_init_sheet (&ep, sheet);
+ height = value_area_get_height (val, &ep);
+ width = value_area_get_width (val, &ep);
+ value_release (val);
+ if ((height == 65536) && (width == 256)) {
+ gnm_expr_top_unref (texpr);
+ texpr = gnm_expr_top_new_constant (value_new_error_REF (&ep));
+ }
+ }
+ }
+
parse_pos_init (&pp, importer->wb, sheet, 0, 0);
nexpr = expr_name_add (&pp, name,
texpr,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]