gnumeric r16286 - in trunk: . plugins/excel src



Author: jody
Date: Wed Jan 23 14:02:47 2008
New Revision: 16286
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16286&view=rev

Log:
Merge branch 'comments' of lifebook:/gnome/src/gnumeric


Modified:
   trunk/BUGS
   trunk/plugins/excel/ms-excel-read.c
   trunk/src/xml-io.c
   trunk/src/xml-sax-read.c

Modified: trunk/BUGS
==============================================================================
--- trunk/BUGS	(original)
+++ trunk/BUGS	Wed Jan 23 14:02:47 2008
@@ -29,6 +29,7 @@
 
 Short term goals
 ----------------
+    - .gnumeric I/O for PI:{error_display,comment_placement}
     - replicate win32 print problems
     - Finish the Data -> Table dialog				(DONE)
     - Use go_glade_signal_connect (and friends)
@@ -451,6 +452,7 @@
 
 17) Explicit Page Breaks
     17.1) Store them in PrintInfo				(DONE)
+    17.2) Respect them
     17.3) I/O
 	17.3.1) Gnumeric					(DONE)
 	    17.3.1.1) Extend XSD				(DONE)
@@ -947,6 +949,7 @@
 	37.1.3) Rich text
 	37.1.4) Validation					(DONE)
 	37.1.6) More print settings
+	    37.1.6.1) PI:{error_display,comment_placement}
 	37.1.7) Comments
 	37.1.8) Text direction in styles
     37.2) Export
@@ -955,6 +958,7 @@
 	37.2.3) Rich text
 	37.2.4) Validation					(DONE)
 	37.2.6) More print settings
+	    37.2.6.1) PI:{error_display,comment_placement}
 	37.2.7) Comments
 	37.2.8) Text direction in styles
 
@@ -982,6 +986,10 @@
 	 Lots of juicey warnings.  Although we do seem to handle the sheet
 	 names correctly.
 
+40) Printing
+    40.1) Page Breaks
+    40.2) PI:comment_placement
+    40.3) PI:display_errors
 -------------------------------------------------------------------------------
 Target Features
 ---------------

Modified: trunk/plugins/excel/ms-excel-read.c
==============================================================================
--- trunk/plugins/excel/ms-excel-read.c	(original)
+++ trunk/plugins/excel/ms-excel-read.c	Wed Jan 23 14:02:47 2008
@@ -447,24 +447,32 @@
 	g_return_val_if_fail (container != NULL, TRUE);
 	esheet = (ExcelReadSheet *)container;
 
-	attr = ms_obj_attr_bag_lookup (obj->attrs, MS_OBJ_ATTR_ANCHOR);
-	if (attr == NULL) {
-		fprintf (stderr,"MISSING anchor for obj %p with id %d of type %s\n", (void *)obj, obj->id, obj->excel_type_name);
-		return TRUE;
-	}
-
-	if (ms_sheet_obj_anchor_to_pos (esheet->sheet, container->importer->ver,
-					attr->v.v_ptr, &range, offsets))
-		return TRUE;
-
-	flip_h = ms_obj_attr_bag_lookup (obj->attrs, MS_OBJ_ATTR_FLIP_H);
-	flip_v = ms_obj_attr_bag_lookup (obj->attrs, MS_OBJ_ATTR_FLIP_V);
-	direction =
-		((flip_h == NULL) ? GOD_ANCHOR_DIR_RIGHT : 0) |
-		((flip_v == NULL) ? GOD_ANCHOR_DIR_DOWN : 0);
+	/* our comment object is too weak.  This anchor is for the text box,
+	 * we need to store the indicator */
+	if (obj->excel_type == 0x19 &&
+	    obj->comment_pos.col >= 0 && obj->comment_pos.row >= 0) {
+		cell_comment_set_pos (CELL_COMMENT (obj->gnum_obj),
+			&obj->comment_pos);
+	} else {
+		attr = ms_obj_attr_bag_lookup (obj->attrs, MS_OBJ_ATTR_ANCHOR);
+		if (attr == NULL) {
+			fprintf (stderr,"MISSING anchor for obj %p with id %d of type %s\n", (void *)obj, obj->id, obj->excel_type_name);
+			return TRUE;
+		}
+
+		if (ms_sheet_obj_anchor_to_pos (esheet->sheet, container->importer->ver,
+						attr->v.v_ptr, &range, offsets))
+			return TRUE;
+
+		flip_h = ms_obj_attr_bag_lookup (obj->attrs, MS_OBJ_ATTR_FLIP_H);
+		flip_v = ms_obj_attr_bag_lookup (obj->attrs, MS_OBJ_ATTR_FLIP_V);
+		direction =
+			((flip_h == NULL) ? GOD_ANCHOR_DIR_RIGHT : 0) |
+			((flip_v == NULL) ? GOD_ANCHOR_DIR_DOWN : 0);
 
-	sheet_object_anchor_init (&anchor, &range, offsets, direction);
-	sheet_object_set_anchor (so, &anchor);
+		sheet_object_anchor_init (&anchor, &range, offsets, direction);
+		sheet_object_set_anchor (so, &anchor);
+	}
 	sheet_object_set_sheet (so, esheet->sheet);
 
 	if (ms_obj_attr_get_ptr (obj->attrs, MS_OBJ_ATTR_TEXT, &label, FALSE))
@@ -605,12 +613,7 @@
 			ms_obj_attr_get_expr (obj->attrs, MS_OBJ_ATTR_INPUT_FROM, NULL, FALSE));
 		break;
 
-	case 0x19:
-		/* our comment object is too weak.  This anchor is for the text box,
-		 * we need to store the indicator */
-		if (obj->comment_pos.col >= 0 && obj->comment_pos.row >= 0)
-			cell_comment_set_pos (CELL_COMMENT (obj->gnum_obj),
-				&obj->comment_pos);
+	case 0x19: /* cell comment text box */
 		break;
 
 	default:

Modified: trunk/src/xml-io.c
==============================================================================
--- trunk/src/xml-io.c	(original)
+++ trunk/src/xml-io.c	Wed Jan 23 14:02:47 2008
@@ -1709,8 +1709,14 @@
 	tmp = (char *) xmlGetProp (tree, (xmlChar *)"ObjectBound");
 	if (tmp != NULL) {
 		GnmRange r;
-		if (range_parse (&r, tmp))
+		if (range_parse (&r, tmp)) {
+			/* Patch problems introduced in some 1.7.x versions that stored
+			 * comments in merged cells with the full rectangle of the merged cell
+			 * rather than just the top left corner */
+			if (G_OBJECT_TYPE (so) != CELL_COMMENT_TYPE)
+				r.end = r.start;
 			so->anchor.cell_bound = r;
+		}
 		xmlFree (tmp);
 	}
 
@@ -1722,8 +1728,8 @@
 		xmlFree (tmp);
 	}
 
-	/* DEPRECATED : There was once an 'AnchorType' but it is now ignored */
 #if 0
+	/* Deprecated in 1.7.7 */
 	tmp = (char *) xmlGetProp (tree, (xmlChar *)"ObjectAnchorType");
 	if (tmp != NULL) {
 		int i[4], count;

Modified: trunk/src/xml-sax-read.c
==============================================================================
--- trunk/src/xml-sax-read.c	(original)
+++ trunk/src/xml-sax-read.c	Wed Jan 23 14:02:47 2008
@@ -2058,6 +2058,13 @@
 			unknown_attr (xin, attrs+i);
 #endif
 	}
+
+	/* Patch problems introduced in some 1.7.x versions that stored
+	 * comments in merged cells with the full rectangle of the merged cell
+	 * rather than just the top left corner */
+	if (G_OBJECT_TYPE (so) != CELL_COMMENT_TYPE)
+		anchor_r.end = anchor_r.start;
+
 	sheet_object_anchor_init (&anchor, &anchor_r, anchor_offset, anchor_dir);
 	sheet_object_set_anchor (so, &anchor);
 



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