[gnumeric] don't let objects wander while cycling through ODF



commit 266f8c1f525c5712dad797dc3bf46882e765eff1
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Fri May 18 23:02:03 2012 -0600

    don't let objects wander while cycling through ODF
    
    2012-05-18  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-read.c (odf_adjust_offsets_col): we may not be in
    	column 0
    	(odf_adjust_offsets_row): we may not be in row 0

 plugins/openoffice/ChangeLog         |    6 ++++++
 plugins/openoffice/openoffice-read.c |    8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 2363774..bb5c7d3 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,11 @@
 2012-05-18  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* openoffice-read.c (odf_adjust_offsets_col): we may not be in
+	column 0
+	(odf_adjust_offsets_row): we may not be in row 0
+
+2012-05-18  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* openoffice-read.c (odf_validations_analyze): add argument,
 	change all callers
 	(odf_validations_translate): check for namespaced condition
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index cf63b0f..563a7fd 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -2717,6 +2717,8 @@ odf_adjust_offsets_col (OOParseState *state, int *col, double *x)
 	ColRowInfo const *cr = sheet_col_get_info (state->pos.sheet, 
 						   *col);
 	int last =  gnm_sheet_get_last_col (state->pos.sheet);
+	if (*col > 0)
+		*x -= sheet_col_get_distance_pts (state->pos.sheet, 0, *col);
 	while (cr->size_pts < *x && *col < last) {
 		(*col)++;
 		(*x) -= cr->size_pts;
@@ -2736,6 +2738,8 @@ odf_adjust_offsets_row (OOParseState *state, int *row, double *y)
 	ColRowInfo const *cr = sheet_row_get_info (state->pos.sheet, 
 						   *row);
 	int last =  gnm_sheet_get_last_row (state->pos.sheet);
+	if (*row > 0)
+		*y -= sheet_row_get_distance_pts (state->pos.sheet, 0, *row);
 	while (cr->size_pts < *y && *row < last) {
 		(*row)++;
 		(*y) -= cr->size_pts;
@@ -5960,7 +5964,7 @@ oo_style_map (GsfXMLIn *xin, xmlChar const **attrs)
 	GnmStyleCond cond;
 	GnmStyleConditions *sc;
 	gboolean success = FALSE;
-	OOFormula f_type;
+	/* OOFormula f_type; */
 
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
 		if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_STYLE, "condition"))
@@ -5981,7 +5985,7 @@ oo_style_map (GsfXMLIn *xin, xmlChar const **attrs)
 	cond.texpr[0] = NULL;
 	cond.texpr[1] = NULL;
 
-	f_type = odf_get_formula_type (xin, &condition);
+	/* f_type = */ odf_get_formula_type (xin, &condition);
 
 	if (g_str_has_prefix (condition, "cell-content()")) {
 		condition += strlen ("cell-content()") - 1;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]