Commit 9dd1d67b authored by Heath Martin's avatar Heath Martin Committed by Arturo Espinosa

Small cut and paste fix. Use row here instead of col.

1999-05-15  Heath Martin <martinh@pegasus.cc.ucf.edu>

	* src/gnumeric-sheet.c (gnumeric_sheet_compute_visible_ranges):
	Small cut and paste fix.  Use row here instead of col.

1999-05-13  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* configure.in (ALL_LINGUAS): Added slovak language.

1999-05-09  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/sheet.c (sheet_selection_to_string): New routine.  Returns a
	string representation of the current selection.

	* src/workbook.c (workbook_selection_to_string): New routine.
	Retunrs a string representation of the current selection.

1999-05-08  Miguel de Icaza  <miguel@nuclecu.unam.mx>
parent 4b767f08
1999-05-15 Heath Martin <martinh@pegasus.cc.ucf.edu>
* src/gnumeric-sheet.c (gnumeric_sheet_compute_visible_ranges):
Small cut and paste fix. Use row here instead of col.
1999-05-13 Miguel de Icaza <miguel@nuclecu.unam.mx>
* configure.in (ALL_LINGUAS): Added slovak language.
1999-05-09 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet.c (sheet_selection_to_string): New routine. Returns a
string representation of the current selection.
* src/workbook.c (workbook_selection_to_string): New routine.
Retunrs a string representation of the current selection.
1999-05-08 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/corba-workbook.c (corba_sheet): Fix.
1999-05-16 Michael Meeks <michael@imaginator.com>
* CHANGES: Added to ease burdern of creating accurate descriptions
......
1999-05-15 Heath Martin <martinh@pegasus.cc.ucf.edu>
* src/gnumeric-sheet.c (gnumeric_sheet_compute_visible_ranges):
Small cut and paste fix. Use row here instead of col.
1999-05-13 Miguel de Icaza <miguel@nuclecu.unam.mx>
* configure.in (ALL_LINGUAS): Added slovak language.
1999-05-09 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet.c (sheet_selection_to_string): New routine. Returns a
string representation of the current selection.
* src/workbook.c (workbook_selection_to_string): New routine.
Retunrs a string representation of the current selection.
1999-05-08 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/corba-workbook.c (corba_sheet): Fix.
1999-05-16 Michael Meeks <michael@imaginator.com>
* CHANGES: Added to ease burdern of creating accurate descriptions
......
1999-05-15 Heath Martin <martinh@pegasus.cc.ucf.edu>
* src/gnumeric-sheet.c (gnumeric_sheet_compute_visible_ranges):
Small cut and paste fix. Use row here instead of col.
1999-05-13 Miguel de Icaza <miguel@nuclecu.unam.mx>
* configure.in (ALL_LINGUAS): Added slovak language.
1999-05-09 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet.c (sheet_selection_to_string): New routine. Returns a
string representation of the current selection.
* src/workbook.c (workbook_selection_to_string): New routine.
Retunrs a string representation of the current selection.
1999-05-08 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/corba-workbook.c (corba_sheet): Fix.
1999-05-16 Michael Meeks <michael@imaginator.com>
* CHANGES: Added to ease burdern of creating accurate descriptions
......
1999-05-15 Heath Martin <martinh@pegasus.cc.ucf.edu>
* src/gnumeric-sheet.c (gnumeric_sheet_compute_visible_ranges):
Small cut and paste fix. Use row here instead of col.
1999-05-13 Miguel de Icaza <miguel@nuclecu.unam.mx>
* configure.in (ALL_LINGUAS): Added slovak language.
1999-05-09 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet.c (sheet_selection_to_string): New routine. Returns a
string representation of the current selection.
* src/workbook.c (workbook_selection_to_string): New routine.
Retunrs a string representation of the current selection.
1999-05-08 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/corba-workbook.c (corba_sheet): Fix.
1999-05-16 Michael Meeks <michael@imaginator.com>
* CHANGES: Added to ease burdern of creating accurate descriptions
......
......@@ -38,7 +38,7 @@ dnl
dnl Check doc/translating.sgml for a description of how to translate
dnl and why we have so many translations.
dnl
ALL_LINGUAS="cs de en_GB es es_DO es_GT es_HN es_MX es_PA es_PE es_SV fr hu it ja ko no pt ru pl"
ALL_LINGUAS="cs de en_GB es es_DO es_GT es_HN es_MX es_PA es_PE es_SV fr hu it ja ko no pt ru pl sk"
AM_GNU_GETTEXT
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
......
This diff is collapsed.
......@@ -1022,6 +1022,12 @@ format_value (StyleFormat *format, Value *value, StyleColor **color)
case VALUE_STRING:
return g_strdup (value->v.str->str);
case VALUE_CELLRANGE:
return g_strdup (_("CELLRANGE"));
case VALUE_ARRAY:
return g_strdup (_("ARRAY"));
default:
return g_strdup ("Internal error");
}
......
......@@ -996,7 +996,7 @@ gnumeric_sheet_compute_visible_ranges (GnumericSheet *gsheet)
gsheet->last_full_row = row;
} if (cb > height){
gsheet->last_visible_row = row;
if (col == gsheet->top_row)
if (row == gsheet->top_row)
gsheet->last_full_row = gsheet->top_row;
else
gsheet->last_full_row = row - 1;
......
......@@ -996,7 +996,7 @@ gnumeric_sheet_compute_visible_ranges (GnumericSheet *gsheet)
gsheet->last_full_row = row;
} if (cb > height){
gsheet->last_visible_row = row;
if (col == gsheet->top_row)
if (row == gsheet->top_row)
gsheet->last_full_row = gsheet->top_row;
else
gsheet->last_full_row = row - 1;
......
......@@ -1688,6 +1688,57 @@ sheet_selection_to_list (Sheet *sheet)
return list;
}
static void
reference_append (GString *result_str, int col, int row)
{
char *row_string = g_strdup_printf ("%d", row);
g_string_append_c (result_str, "$");
g_string_append (result_str, col_name (col));
g_string_append_c (result_str, "$");
g_string_append (result_str, row_string);
g_free (row_string);
}
char *
sheet_selection_to_string (Sheet *sheet, gboolean include_sheet_name_prefix)
{
GString *result_str;
char *result;
sheet_cell_foreach_callback assembler;
g_return_val_if_fail (sheet != NULL, NULL);
g_return_val_if_fail (IS_SHEET (sheet), NULL);
g_return_val_if_fail (sheet->selections, NULL);
result_str = g_string_new ("");
for (selections = sheet->selections; selections; selections = selections->next){
SheetSelection *ss = selections->data;
if (*result_str->str)
g_string_append_c (result_str, ',');
if (include_sheet_name_prefix){
g_string_append_c (result_str, '\'');
g_string_append (result_str, sheet->name);
g_string_append (result_str, "'!");
}
if ((ss->start_col != ss->end_col) ||
(ss->start_row != ss->end_row)){
reference_append (result_str, ss->start_col, ss->end_row);
g_string_append_c (result_str, ":");
reference_append (result_str, ss->end_col, ss->end_row);
} else
reference_append (result_str, ss->start_col, ss->start_row);
}
result = result_str->str;
g_string_free (result_str, FALSE);
return result;
}
/**
* sheet_col_get:
*
......
......@@ -218,6 +218,7 @@ int sheet_selection_first_range (Sheet *sheet,
int *start_col, int *start_row,
int *end_col, int *end_row);
CellList *sheet_selection_to_list (Sheet *sheet);
char *sheet_selection_to_string (Sheet *sheet, gboolean include_sheet_name_prefix);
/* Operations on the selection */
void sheet_selection_clear (Sheet *sheet);
......@@ -238,7 +239,6 @@ int sheet_selection_walk_step (Sheet *sheet,
void sheet_selection_extend_horizontal (Sheet *sheet, int count);
void sheet_selection_extend_vertical (Sheet *sheet, int count);
int sheet_selection_is_cell_selected (Sheet *sheet, int col, int row);
gboolean sheet_verify_selection_simple (Sheet *sheet, const char *command_name);
/* Cell management */
......@@ -426,6 +426,7 @@ gboolean workbook_rename_sheet (Workbook *wb,
int workbook_sheet_count (Workbook *wb);
gboolean workbook_can_detach_sheet (Workbook *wb, Sheet *sheet);
GList *workbook_sheets (Workbook *wb);
char *workbook_selection_to_string (Workbook *wb, Sheet *base_sheet);
/*
* Does any pending recalculations
......
......@@ -2291,3 +2291,54 @@ workbook_sheets (Workbook *wb)
g_hash_table_foreach (wb->sheets, cb_workbook_sheets, &sheets);
return sheets;
}
typedef struct {
Sheet *base_sheet;
GString *result;
} selection_assemble_closure_t;
static void
cb_assemble_selection (gpointer key, gpointer value, gpointer user_data)
{
selection_assemble_closure_t *info = (selection_assemble_closure_t *) user_data;
Sheet *sheet = value;
gboolean include_prefix;
if (*info->result->str)
g_string_append_c (info->result, ",");
/*
* If a base sheet is specified, use this to avoid prepending
* the full path to the cell region.
*/
if (info->base_sheet && (info->base_sheet != value))
include_prefix = TRUE;
else
include_prefix = FALSE;
sel = sheet_selection_to_string (sheet, include_prefix);
g_string_append (res, sel);
g_free (sel);
}
char *
workbook_selection_to_string (Workbook *wb, Sheet *base_sheet)
{
selection_assemble_closure_t info;
char *str;
g_return_val_if_fail (wb != NULL, NULL);
if (base_sheet == NULL){
g_return_val_if_fail (IS_SHEET (base_sheet), NULL);
}
info.result = g_string_new ("");
info.base_sheet = base_sheet;
g_hash_table_foreach (wb->sheets, cb_assemble_selection, &info);
result = info->result->str;
g_string_free (info->result, FALSE);
return result;
}
......@@ -138,4 +138,67 @@ graphic_context_data_range_remove (GraphicContext *gc, const char *range_name)
}
}
void
graphics_context_data_range_clear (GraphicContext *gc)
{
GList *l;
g_return_if_fail (gc != NULL);
for (l = gc->data_range_list; l; l = l->next){
DataRange *data_range = l->data;
data_range_destroy (data_range);
}
g_list_free (gc->data_range_list);
gc->data_range_list = NULL;
}
/**
* graphic_context_set_data_range:
* @gc: the graphics context
* @data_range_spec: a string description of the cell ranges
* @vertical: whether we need to create the data ranges in vertical mode
*
* This routine defines the data ranges based on the @data_range_spec, and
* it guesses the series values using @vertical
*/
void
graphic_context_set_data_range (GraphicContext *gc, const char *data_range_spec, gboolean vertical)
{
ExprTree *tree;
char *p;
char *error;
g_return_if_fail (gc != NULL);
g_return_if_fail (data_range_spec != NULL);
graphics_context_data_range_clear (gc);
/* Hack:
* Create a valid expression, parse as expression, and pull the
* parsed arguments.
*/
expr = g_strconcat ("=SELECTION(", data_range_spec, ")", NULL);
tree = expr_parse_string (expr, NULL, 0, 0, 0, &error);
g_free (expr);
if (tree == NULL)
return;
assert (tree->oper == OPER_FUNCALL);
args = tree->u.function.arg_list;
/*
* Guess the data ranges. From the selected ranges. Simple
* case is just a region selected, so we can guess a number
* of parameters from this.
*/
g_warning ("Should do something more interesting with disjoint selections");
expr_tree_unref (tree);
}
......@@ -41,7 +41,7 @@ typedef struct {
GnomeObjectClient *guppi;
GnomeClientSite *client_site;
GnomeContainer *container;
} GraphicContext;
} WizardGraphicContext;
#define GC_SIGNATURE ((('G' << 8) | ('C' << 8)) | 'o')
#define IS_GRAPHIC_CONTEXT(gc) (gc->signature == GC_SIGNATURE)
......
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