Commit 10e16ef5 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Move to new libgsf xml interface. Support un-namespaced variant of Name

2005-10-02  Jody Goldberg <jody@gnome.org>

	* src/xml-sax-read.c : Move to new libgsf xml interface.
	  Support un-namespaced variant of Name for compatibility.
	* src/xml-sax-write.c (xml_io_conventions) : Use new gnm_1_0_rangeref_as_string;
	  to improve back compat.  We read using something that can handle the
	  modern format, but we write the old version.
	* src/xml-io.c (xml_io_conventions) : ditto.

	* src/ranges.c (range_intersection) : return FALSE if the ranges do
	  not overlap, but do not generate an error.
	  formula_import_biff8.xls

	* src/gnumeric-pane.c (gnm_pane_init) : Use a realize handler on the
	  canvas to create the object views.  Doing it sooner can break
	  because the canvas has not been attached to a container yet.
	  test-xls/prislistekomplett.xls

	* src/workbook-control-gui.c (wbcg_sheet_add) : only grab focus if we
	  are the current sheet.
	  samples/derivatives.gnumeric

	http://bugzilla.gnome.org/show_bug.cgi?id=317427
	* src/parse-util.c (gnm_1_0_rangeref_as_string) : new stripped down
	  variant of rangeref_as_string.
	* src/xml-sax-write.c (xml_io_conventions) : use it here.
	* src/xml-io.c (xml_io_conventions) : and here.

	* src/style.c (required_updates_for_style) : add super/sub script
parent fbe09c36
......@@ -8,47 +8,40 @@ release, and longer term bugs.
Release Critical
----------------
* surface plot not using full area
and having unlabeled axis ticks
* Finish Data -> Table
- draw merged
- draw long spans
- print merged & long spans
- check dependencies
* Check dynamic deps. Do they work at all ?
* more condition types
* Check with federico re: recently used list in file selector
Pending Patches
---------------
- Patch for non-gconf gnm-config {bugzilla}
- autopackage patches {rob}
- Patches for Maemo {partially in}
- Meta Data
: Patches for OOo metadata {lucianomw}
: Patches for OOo metadata {lucianomw, jody}
: Patches for metadata dialog {etrunko}
: Patches to use GsfDocMetaData {jody}
Worries
-------
: provide undo for dropped objects from sheet_objects_clear
: undo of pasting copy/cut of objects
: Select graph, Copy, and paste to Emacs: used to crash, but now it
just g_barfs and pastes empty string.
: editing text boxes (do a derived FooCanvasEditableTextItem)
we can steal some of the xim support from item-edit.
: HARMEAN with no arguments (or just strings/booleans) should yield N/A,
not NUM.
: MAXA,MINA with no arguments should yield N/A, not NUM.
: STDEVPA,VARPA with no arguments should yield VALUE, not DIV0.
: STDEVA,VARA with 0-1 arguments should yield DIV0, not VALUE.
: DEVSQ with no arguments should yield #NUM, not zero.
? How did you enter this. xl-2k refuses to parse that
! Import from a .csv file.
: tie the custom ui into action sensitivity pools
: support array evaluation for =LARGE and friends
: TRIMEAN is a list function ?
: ISREF is a list function ?
2.6 TODO
--------
- Finish Data -> Table
- use 2.6 clipboard handling
: gtk_clipboard_set_can_store
: gtk_clipboard_store
Worries
-------
: provide undo for dropped objects from sheet_objects_clear
: undo of pasting copy/cut of objects
: Select graph, Copy, and paste to Emacs: used to crash, but now it
just g_barfs and pastes empty string.
-------------------------------------------------------------------------------
Blocked Patches
---------------
......@@ -64,7 +57,6 @@ Architecture Changes
- repeat (http://bugzilla.gnome.org/show_bug.cgi?id=143244) (DONE)
- ssconvert for non-gnome (DONE)
- Merge wb_control_init_state and wb_control_set_view
- SheetObjectGroup
1) things to move into libgoffice
1.1) plugin-manager dialog
......@@ -77,6 +69,7 @@ Architecture Changes
1.2.2) doc meta data dialog {Trelane and etrunko}
1.3) Insert hyperlink dialog
1.3.1) Integration with evo address book
1.4) move password dialog to goffice
2) Font handling (move to GOFont)
3) Charting Enhancements (DONE)
3.1) SheetObject editing (DONE)
......@@ -100,7 +93,8 @@ Architecture Changes
7.2) Find a better place than SheetControlGUI for dnd code
7.3) More formats, at least html and text
7.4) Advertise SVG for graphs, as the preferred format (DONE)
7.5) Autoscroll for sheet object movement
7.5) Autoscroll for sheet object movement (DONE)
7.6) Autoscroll in 1 dimension and movement in other
8) Rich Text
8.1) font actions valid while editing (DONE)
8.2) accumulate markup from toolbar while editing (DONE)
......@@ -276,6 +270,19 @@ Architecture Changes
1) A registry of named data tables to reference from examples
2) The example text should have the expr in C locale
?? how to reference the sample data ??
: HARMEAN with no arguments (or just strings/booleans) should yield N/A,
not NUM.
: MAXA,MINA with no arguments should yield N/A, not NUM.
: STDEVPA,VARPA with no arguments should yield VALUE, not DIV0.
: STDEVA,VARA with 0-1 arguments should yield DIV0, not VALUE.
: DEVSQ with no arguments should yield #NUM, not zero.
? How did you enter this. xl-2k refuses to parse that
! Import from a .csv file.
: tie the custom ui into action sensitivity pools
: support array evaluation for =LARGE and friends
: TRIMEAN is a list function ?
: ISREF is a list function ?
11) Conditional formats
11.1) Data Structures in the core
......@@ -310,7 +317,10 @@ Architecture Changes
11.7.1) background (DONE)
11.7.2) borders (DONE)
11.7.3) font and font colour
11.7.4) Merged cells (DONE)
11.7.5) Long spans
11.8) UI to modify
12) Input Messages
12.1) Implement
12.1.1) Data Structure to store it (DONE)
......@@ -323,6 +333,16 @@ Architecture Changes
12.7) DOM Import (DONE)
12.8) DOM Export (DONE)
13) Sheet Objects
13.1) SheetObjectGroup
13.2) editing text boxes (do a derived FooCanvasEditableTextItem) we can
steal some of the xim support from item-edit.
13.3) rich text for objects
14) Zoom
14.1) Add a 'global' flag for the zoom dialog
14.2) Zoom to selection
-------------------------------------------------------------------------------
Target Features
---------------
......
2005-10-02 Jody Goldberg <jody@gnome.org>
* src/xml-sax-read.c : Move to new libgsf xml interface.
Support un-namespaced variant of Name for compatibility.
* src/xml-sax-write.c (xml_io_conventions) : Use new gnm_1_0_rangeref_as_string;
to improve back compat. We read using something that can handle the
modern format, but we write the old version.
* src/xml-io.c (xml_io_conventions) : ditto.
* src/ranges.c (range_intersection) : return FALSE if the ranges do
not overlap, but do not generate an error.
formula_import_biff8.xls
* src/gnumeric-pane.c (gnm_pane_init) : Use a realize handler on the
canvas to create the object views. Doing it sooner can break
because the canvas has not been attached to a container yet.
test-xls/prislistekomplett.xls
* src/workbook-control-gui.c (wbcg_sheet_add) : only grab focus if we
are the current sheet.
samples/derivatives.gnumeric
http://bugzilla.gnome.org/show_bug.cgi?id=317427
* src/parse-util.c (gnm_1_0_rangeref_as_string) : new stripped down
variant of rangeref_as_string.
* src/xml-sax-write.c (xml_io_conventions) : use it here.
* src/xml-io.c (xml_io_conventions) : and here.
* src/style.c (required_updates_for_style) : add super/sub script
2005-10-01 Stepan Kasal <kasal@ucw.cz>
* src/Makefile.am (libspreadsheet_la_LDFLAGS): Add a -release flag,
......
......@@ -3,6 +3,9 @@ Gnumeric 1.6.0
Andreas:
* Preload selection in "Define Names" dialog [#316406]
Jean Brefort:
* Fix crash when deleting plot with dynamic deps.
Jody:
* Snap objects right in RTL mode. [#316026]
* Finish Data -> Table evaluation
......
2005-10-02 Jody Goldberg <jody@gnome.org>
* src/xml-sax-read.c : Move to new libgsf xml interface.
Support un-namespaced variant of Name for compatibility.
* src/xml-sax-write.c (xml_io_conventions) : Use new gnm_1_0_rangeref_as_string;
to improve back compat. We read using something that can handle the
modern format, but we write the old version.
* src/xml-io.c (xml_io_conventions) : ditto.
* src/ranges.c (range_intersection) : return FALSE if the ranges do
not overlap, but do not generate an error.
formula_import_biff8.xls
* src/gnumeric-pane.c (gnm_pane_init) : Use a realize handler on the
canvas to create the object views. Doing it sooner can break
because the canvas has not been attached to a container yet.
test-xls/prislistekomplett.xls
* src/workbook-control-gui.c (wbcg_sheet_add) : only grab focus if we
are the current sheet.
samples/derivatives.gnumeric
http://bugzilla.gnome.org/show_bug.cgi?id=317427
* src/parse-util.c (gnm_1_0_rangeref_as_string) : new stripped down
variant of rangeref_as_string.
* src/xml-sax-write.c (xml_io_conventions) : use it here.
* src/xml-io.c (xml_io_conventions) : and here.
* src/style.c (required_updates_for_style) : add super/sub script
2005-10-01 Stepan Kasal <kasal@ucw.cz>
* src/Makefile.am (libspreadsheet_la_LDFLAGS): Add a -release flag,
......
......@@ -115,7 +115,7 @@ gnumeric_reqs="
glib-2.0 >= 2.6.0
gobject-2.0 >= 2.6.0
gmodule-2.0 >= 2.6.0
libgsf-1 >= 1.12.2
libgsf-1 >= 1.13.0
libgoffice-1 >= 0.1.0
libxml-2.0 >= 2.4.12
pango >= 1.8.1
......
......@@ -356,7 +356,7 @@ oleo_conventions (void)
GnmExprConventions *res = gnm_expr_conventions_new ();
res->decimal_sep_dot = TRUE;
res->ref_parser = gnm_1_0_rangeref_parse;
res->ref_parser = rangeref_parse;
res->range_sep_colon = TRUE;
res->sheet_sep_exclamation = TRUE;
res->dots_in_names = TRUE;
......
This diff is collapsed.
......@@ -942,12 +942,12 @@ dynamic_dep_debug_name (GnmDependent const *dep, GString *target)
}
void
dependent_add_dynamic_dep (GnmDependent *dep, GnmValueRange const *v)
dependent_add_dynamic_dep (GnmDependent *dep, GnmRangeRef const *rr)
{
DependentFlags flags;
DynamicDep *dyn;
GnmCellPos const *pos;
DependencyRange range;
DependentFlags flags;
DynamicDep *dyn;
GnmCellPos const *pos;
DependencyRange range;
g_return_if_fail (dep != NULL);
......@@ -967,14 +967,14 @@ dependent_add_dynamic_dep (GnmDependent *dep, GnmValueRange const *v)
g_hash_table_insert (dep->sheet->deps->dynamic_deps, dep, dyn);
}
gnm_cellpos_init_cellref (&range.range.start, &v->cell.a, pos);
gnm_cellpos_init_cellref (&range.range.end, &v->cell.b, pos);
gnm_cellpos_init_cellref (&range.range.start, &rr->a, pos);
gnm_cellpos_init_cellref (&range.range.end, &rr->b, pos);
if (range_is_singleton (&range.range)) {
flags = link_single_dep (&dyn->base, pos, &v->cell.a);
dyn->singles = g_slist_prepend (dyn->singles, value_dup ((GnmValue *)v));
flags = link_single_dep (&dyn->base, pos, &rr->a);
dyn->singles = g_slist_prepend (dyn->singles, gnm_rangeref_dup (rr));
} else {
flags = link_cellrange_dep (&dyn->base, pos, &v->cell.a, &v->cell.b);
dyn->ranges = g_slist_prepend (dyn->ranges, value_dup ((GnmValue *)v));
flags = link_cellrange_dep (&dyn->base, pos, &rr->a, &rr->b);
dyn->ranges = g_slist_prepend (dyn->ranges, gnm_rangeref_dup (rr));
}
if (flags & DEPENDENT_HAS_3D)
workbook_link_3d_dep (dep);
......@@ -2267,21 +2267,21 @@ dynamic_dep_free (DynamicDep *dyn)
{
GnmDependent *dep = dyn->container;
GnmCellPos const *pos = dependent_pos (dep);
GnmValueRange *v;
GnmRangeRef *rr;
GSList *ptr;
for (ptr = dyn->singles ; ptr != NULL ; ptr = ptr->next) {
v = ptr->data;
unlink_single_dep (&dyn->base, pos, &v->cell.a);
value_release ((GnmValue *)v);
rr = ptr->data;
unlink_single_dep (&dyn->base, pos, &rr->a);
g_free (rr);
}
g_slist_free (dyn->singles);
dyn->singles = NULL;
for (ptr = dyn->ranges ; ptr != NULL ; ptr = ptr->next) {
v = ptr->data;
unlink_cellrange_dep (&dyn->base, pos, &v->cell.a, &v->cell.b);
value_release ((GnmValue *)v);
rr = ptr->data;
unlink_cellrange_dep (&dyn->base, pos, &rr->a, &rr->b);
g_free (rr);
}
g_slist_free (dyn->ranges);
dyn->ranges = NULL;
......@@ -2393,16 +2393,14 @@ dump_dynamic_dep (gpointer key, G_GNUC_UNUSED gpointer value,
g_string_append (target, ", s=[");
for (l = dyn->singles; l; l = l->next) {
GnmValueRange const *v = l->data;
rangeref_as_string (target, gnm_expr_conventions_default, &v->cell, &pp);
rangeref_as_string (target, gnm_expr_conventions_default, l->data, &pp);
if (l->next)
g_string_append (target, ", ");
}
g_string_append (target, "], r=[");
for (l = dyn->ranges; l; l = l->next) {
GnmValueRange const *v = l->data;
rangeref_as_string (target, gnm_expr_conventions_default, &v->cell, &pp);
rangeref_as_string (target, gnm_expr_conventions_default, l->data, &pp);
if (l->next)
g_string_append (target, ", ");
}
......
......@@ -90,7 +90,7 @@ void dependent_link (GnmDependent *dep);
void dependent_unlink (GnmDependent *dep);
gboolean dependent_eval (GnmDependent *dep);
void dependent_queue_recalc (GnmDependent *dep);
void dependent_add_dynamic_dep (GnmDependent *dep, GnmValueRange const *v);
void dependent_add_dynamic_dep (GnmDependent *dep, GnmRangeRef const *rr);
GSList *dependents_relocate (GnmExprRelocateInfo const *info);
void dependents_unrelocate (GSList *info);
......
......@@ -1016,7 +1016,7 @@ gnm_expr_range_op (GnmExpr const *expr, GnmEvalPos const *ep,
return value_new_error_NULL (ep);
res = value_new_cellrange_r (a_start, &res_range);
dependent_add_dynamic_dep (ep->dep, &res->v_range);
dependent_add_dynamic_dep (ep->dep, &res->v_range.cell);
if (!(flags & GNM_EXPR_EVAL_PERMIT_NON_SCALAR)) {
res = value_intersection (res, ep);
return (res != NULL)
......@@ -1260,7 +1260,7 @@ gnm_expr_eval (GnmExpr const *expr, GnmEvalPos const *pos,
return (flags & GNM_EXPR_EVAL_PERMIT_EMPTY)
? NULL : value_new_int (0);
if (res->type == VALUE_CELLRANGE) {
dependent_add_dynamic_dep (pos->dep, &res->v_range);
dependent_add_dynamic_dep (pos->dep, &res->v_range.cell);
if (!(flags & GNM_EXPR_EVAL_PERMIT_NON_SCALAR)) {
res = value_intersection (res, pos);
return (res != NULL)
......
......@@ -132,32 +132,18 @@ gnumeric_version (FunctionEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static void
table_make_ref (FunctionEvalInfo const *ei,
GnmRangeRef *top, GnmRangeRef *left)
{
GnmDependent *dep = ei->pos->dep;
top->a.sheet = top->b.sheet = left->a.sheet = left->b.sheet = dep->sheet;
}
static DependentFlags
gnumeric_table_link (FunctionEvalInfo *ei)
{
GnmDependent *dep = ei->pos->dep;
GnmRangeRef top, left;
table_make_ref (ei, &top, &left);
return DEPENDENT_IGNORE_ARGS;
#if 0
|
dependent_add_dep_range (dep, &ei->pos->eval, &top.a, &top.b) |
dependent_add_dep_range (dep, &ei->pos->eval, &left.a, &left.b);
#endif
}
static void
gnumeric_table_unlink (FunctionEvalInfo *ei)
{
GnmRangeRef top, left;
table_make_ref (ei, &top, &left);
#warning remove dep
top.a.sheet = top.b.sheet = left.a.sheet = left.b.sheet = dep->sheet;
dependent_add_dynamic_dep (dep, &top);
dependent_add_dynamic_dep (dep, &left);
return DEPENDENT_IGNORE_ARGS;
}
static GnmValue *
......@@ -169,6 +155,9 @@ gnumeric_table (FunctionEvalInfo *ei, GnmExprList const *args)
GnmCellPos pos;
int x, y;
/* evaluation clears the dynamic deps */
gnumeric_table_link (ei);
if (gnm_expr_list_length (args) != 2 &&
ei->pos->eval.col > 0 && ei->pos->eval.row > 0)
return value_new_error_REF (ei->pos);
......@@ -279,7 +268,7 @@ func_builtin_init (void)
},
{ "table", "", "",
NULL, NULL, gnumeric_table,
gnumeric_table_link, gnumeric_table_unlink,
gnumeric_table_link, NULL,
NULL, GNM_FUNC_SIMPLE + GNM_FUNC_INTERNAL,
GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC,
GNM_FUNC_TEST_STATUS_EXHAUSTIVE
......
......@@ -19,6 +19,7 @@
#include "dependent.h"
#include "expr.h"
#include "expr-impl.h"
#include "expr-name.h"
#include "cell.h"
#include "str.h"
#include "symbol.h"
......@@ -1376,15 +1377,38 @@ function_iterate_argument_values (GnmEvalPos const *ep,
CellIterFlags iter_flags)
{
GnmValue *result = NULL;
GnmExpr const *expr;
GnmValue *val;
for (; result == NULL && expr_node_list;
expr_node_list = expr_node_list->next) {
GnmExpr const *expr = expr_node_list->data;
GnmValue *val;
expr = expr_node_list->data;
if (iter_flags & CELL_ITER_IGNORE_SUBTOTAL &&
gnm_expr_containts_subtotal (expr))
continue;
/* NOT UNTIL 1.7 */
#if 0
/* need to drill down into names to handle things like
* sum(name) with name := (A:A,B:B) */
while (expr->any.oper == GNM_EXPR_OP_NAME) {
expr = expr->name.name->expr;
if (expr == NULL) {
if (strict)
return value_new_error_REF (ep);
continue;
}
}
/* Handle sets as a special case */
if (expr->any.oper == GNM_EXPR_OP_SET) {
result = function_iterate_argument_values (ep, callback,
callback_closure, expr->set.set, strict, iter_flags);
continue;
}
#endif
/* Permit empties and non scalars. We don't know what form the
* function wants its arguments */
val = gnm_expr_eval (expr, ep, GNM_EXPR_EVAL_PERMIT_NON_SCALAR|GNM_EXPR_EVAL_PERMIT_EMPTY);
......
......@@ -60,7 +60,7 @@ static const GtkTargetEntry drag_types_out[] =
};
static void
gnumeric_pane_realized (GtkWidget *widget, gpointer ignored)
gnm_pane_header_realized (GtkWidget *widget)
{
gdk_window_set_back_pixmap (GTK_LAYOUT (widget)->bin_window, NULL, FALSE);
}
......@@ -99,9 +99,8 @@ gnumeric_pane_header_init (GnmPane *pane, SheetControlGUI *scg,
fabs (1. - sheet->last_zoom_factor_used) > 1e-6)
foo_canvas_set_pixels_per_unit (canvas, sheet->last_zoom_factor_used);
g_signal_connect (G_OBJECT (canvas),
"realize",
G_CALLBACK (gnumeric_pane_realized), NULL);
g_signal_connect (G_OBJECT (canvas), "realize",
G_CALLBACK (gnm_pane_header_realized), NULL);
}
static void
......@@ -300,6 +299,19 @@ gnm_pane_drag_dest_init (GnmPane *pane, SheetControlGUI *scg)
NULL);
}
static void
cb_pane_init_objs (GnmPane *pane)
{
/* create views for the sheet objects now that we exist */
Sheet *sheet = sc_sheet (SHEET_CONTROL (pane->gcanvas->simple.scg));
GSList *ptr;
if (sheet != NULL)
for (ptr = sheet->sheet_objects; ptr != NULL ; ptr = ptr->next)
sheet_object_new_view (ptr->data,
(SheetObjectViewContainer *)pane);
}
void
gnm_pane_init (GnmPane *pane, SheetControlGUI *scg,
gboolean col_headers, gboolean row_headers, int index)
......@@ -315,6 +327,8 @@ gnm_pane_init (GnmPane *pane, SheetControlGUI *scg,
g_signal_connect_swapped (pane->gcanvas,
"popup-menu",
G_CALLBACK (cb_pane_popup_menu), pane);
g_signal_connect_swapped (G_OBJECT (pane->gcanvas), "realize",
G_CALLBACK (cb_pane_init_objs), pane);
if (NULL != scg &&
NULL != (sheet = sc_sheet (SHEET_CONTROL (scg))) &&
......@@ -354,16 +368,6 @@ gnm_pane_init (GnmPane *pane, SheetControlGUI *scg,
pane->drag.button = 0;
pane->drag.ctrl_pts = g_hash_table_new_full (g_direct_hash, g_direct_equal,
NULL, (GDestroyNotify) cb_ctrl_pts_free);
/* create views for the sheet objects */
sheet = sc_sheet (SHEET_CONTROL (scg));
if (sheet != NULL) {
GSList *ptr;
for (ptr = sheet->sheet_objects; ptr != NULL ; ptr = ptr->next)
sheet_object_new_view (ptr->data,
(SheetObjectViewContainer *)pane);
}
gnm_pane_drag_dest_init (pane, scg);
pane->mouse_cursor = NULL;
}
......
......@@ -205,6 +205,9 @@ static char *
icg_get_password (GOCmdContext *cc, char const *filename)
{
IOContextGtk *icg = IO_CONTEXT_GTK (cc);
if (gnumeric_no_warnings)
return NULL;
return dialog_get_password (icg->window, filename);
}
......
......@@ -31,6 +31,9 @@
#include "selection.h"
#include "parse-util.h"
#include "mstyle.h"
#include "style-conditions.h"
#include "gnm-style-impl.h" /* cheesy */
#include "position.h" /* to eval conditions */
#include "style-border.h"
#include "style-color.h"
#include "pattern.h"
......@@ -265,6 +268,14 @@ item_grid_draw_merged_range (GdkDrawable *drawable, ItemGrid *ig,
if (l == r || t == b)
return;
if (style->conditions) {
GnmEvalPos ep;
int res;
eval_pos_init (&ep, (Sheet *)sheet, range->start.col, range->start.row);
if ((res = gnm_style_conditions_eval (style->conditions, &ep)) >= 0)
style = g_ptr_array_index (style->cond_styles, res);
}
/* Check for background THEN selection */
if (gnumeric_background_set_gc (style, gc,
ig->canvas_item.canvas, is_selected) ||
......@@ -273,7 +284,7 @@ item_grid_draw_merged_range (GdkDrawable *drawable, ItemGrid *ig,
if (sheet->text_is_rtl)
gdk_draw_rectangle (drawable, gc, TRUE, r, t, l-r+1, b-t+1);
else
gdk_draw_rectangle (drawable, gc, TRUE, l, t, r-l+1, b-t+1);
gdk_draw_rectangle (drawable, gc, TRUE, l, t, r-l+1, b-t+1);
}
if (range->start.col < view->start.col)
......
......@@ -407,6 +407,65 @@ rangeref_as_string (GString *target, GnmExprConventions const *conv,
}
}
/**
* gnm_1_0_rangeref_as_string :
* @ref :
* @pp :
*
* Simplified variant of rangeref_as_string that old version of gnumeric can
* read. It drops support for full col/row references. We can remap them on import.
**/
void
gnm_1_0_rangeref_as_string (GString *target, GnmExprConventions const *conv,
GnmRangeRef const *ref, GnmParsePos const *pp)
{
GnmRange r;
r.start.col = cellref_abs_col (&ref->a, pp);
r.end.col = cellref_abs_col (&ref->b, pp);
r.start.row = cellref_abs_row (&ref->a, pp);
r.end.row = cellref_abs_row (&ref->b, pp);
if (ref->a.sheet) {
if (pp->wb != NULL && ref->a.sheet->workbook != pp->wb) {
g_string_append_c (target, '[');
g_string_append (target, workbook_get_uri (ref->a.sheet->workbook));
g_string_append_c (target, ']');
}
if (pp->wb == NULL && pp->sheet == NULL)
/* For the expression leak printer. */
g_string_append (target, "'?'");
else if (ref->b.sheet == NULL || ref->a.sheet == ref->b.sheet)
g_string_append (target, ref->a.sheet->name_quoted);
else {
g_string_append (target, ref->a.sheet->name_quoted);
g_string_append_c (target, ':');
g_string_append (target, ref->b.sheet->name_quoted);
}
g_string_append (target, conv->output_sheet_name_sep);
}
if (!ref->a.col_relative)
g_string_append_c (target, '$');
col_name_internal (target, r.start.col);
if (!ref->a.row_relative)
g_string_append_c (target, '$');
row_name_internal (target, r.start.row);
if (r.start.col != r.end.col ||
ref->a.col_relative != ref->b.col_relative ||
r.start.row != r.end.row ||
ref->a.row_relative != ref->b.row_relative) {
g_string_append_c (target, ':');
if (!ref->b.col_relative)
g_string_append_c (target, '$');
col_name_internal (target, r.end.col);
if (!ref->b.row_relative)
g_string_append_c (target, '$');
row_name_internal (target, r.end.row);
}
}
static char const *
cellref_a1_get (GnmCellRef *out, char const *in, GnmCellPos const *pos)
{
......@@ -960,7 +1019,8 @@ rangeref_parse (GnmRangeRef *res, char const *start, GnmParsePos const *pp,
return tmp2;
}
#if 0
/* Do we even need this anymore ? */
char const *
gnm_1_0_rangeref_parse (GnmRangeRef *res, char const *start, GnmParsePos const *pp,
G_GNUC_UNUSED GnmExprConventions const *convs)
......@@ -1013,6 +1073,7 @@ gnm_1_0_rangeref_parse (GnmRangeRef *res, char const *start, GnmParsePos const *
res->b.row -= pp->eval.row;
return tmp2;
}
#endif
/* ------------------------------------------------------------------------- */
......
......@@ -33,11 +33,9 @@ char const *sheetref_parse (char const *start, Sheet **sheet,
char const *cell_coord_name (int col, int row);
char const *cell_name (GnmCell const *cell);
/* backwards compatibility versions that will move to a plugin */
char *gnm_1_0_rangeref_as_string (GnmRangeRef const *ref, GnmParsePos const *pp);
char const *gnm_1_0_rangeref_parse (GnmRangeRef *res, char const *in,
GnmParsePos const *pp,
GnmExprConventions const *convs);
/* backwards compatibility version */
void gnm_1_0_rangeref_as_string (GString *target, GnmExprConventions const *conv,
GnmRangeRef const *ref, GnmParsePos const *pp);
typedef enum {
PERR_NONE,
......
......@@ -637,7 +637,8 @@ range_fragment_free (GSList *fragments)
gboolean
range_intersection (GnmRange *r, GnmRange const *a, GnmRange const *b)
{
g_return_val_if_fail (range_overlap (a, b), FALSE);
if (!range_overlap (a, b))
return FALSE;
r->start.col = MAX (a->start.col, b->start.col);
r->start.row = MAX (a->start.row, b->start.row);
......
......@@ -487,22 +487,22 @@ required_updates_for_style (GnmStyle const *style)
SpanCalcFlags res = SPANCALC_SIMPLE;
gboolean const row_height =
gnm_style_is_element_set (style, MSTYLE_FONT_SIZE) ||
gnm_style_is_element_set (style, MSTYLE_WRAP_TEXT) ||
gnm_style_is_element_set (style, MSTYLE_ROTATION);
gnm_style_is_element_set (style, MSTYLE_FONT_SIZE) ||
gnm_style_is_element_set (style, MSTYLE_WRAP_TEXT) ||
gnm_style_is_element_set (style, MSTYLE_ROTATION) ||
gnm_style_is_element_set (style, MSTYLE_FONT_SCRIPT);
gboolean const size_change = row_height ||
gnm_style_is_element_set (style, MSTYLE_FONT_NAME) ||
gnm_style_is_element_set (style, MSTYLE_FONT_BOLD) ||