Commit 8fabf3c2 authored by Jody Goldberg's avatar Jody Goldberg

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

svn path=/trunk/; revision=16286
parent 91698375
......@@ -29,6 +29,7 @@ Review
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 @@ Architecture Changes
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 @@ Architecture Changes
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 @@ Architecture Changes
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 @@ Architecture Changes
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
---------------
......
......@@ -447,24 +447,32 @@ ms_sheet_realize_obj (MSContainer *container, MSObj *obj)
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;
}
/* 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;
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);
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_sheet_realize_obj (MSContainer *container, MSObj *obj)
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:
......
......@@ -1709,8 +1709,14 @@ xml_read_sheet_object (XmlParseContext const *ctxt, xmlNodePtr tree)
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 @@ xml_read_sheet_object (XmlParseContext const *ctxt, xmlNodePtr tree)
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;
......
......@@ -2058,6 +2058,13 @@ xml_sax_read_obj (GsfXMLIn *xin, gboolean needs_cleanup,
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment