Commit ee2689c8 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

http://bugzilla.gnome.org/show_bug.cgi?id=125045 clip correctly and space

2003-10-23  Jody Goldberg <jody@gnome.org>

	http://bugzilla.gnome.org/show_bug.cgi?id=125045
	* graph/gog-axis.c (gog_axis_view_render) : clip correctly and space
	  the ticks based on the actual tick values, not just their index.
	(gog_axis_num_markers) : return a step fraction too.

2003-10-23  Jody Goldberg <jody@gnome.org>

	* src/workbook-control-gui.c : Ensure that all actions with
	  accelerators attempt to finish any edits in progress.

2003-10-22  Jody Goldberg <jody@gnome.org>

	http://bugzilla.gnome.org/show_bug.cgi?id=77303
	* src/sheet-control-gui.c (scg_cursor_move) : don't scroll the other
	  panes unless we absolutely have to.
parent 1a52587a
......@@ -8,20 +8,16 @@ release, and longer term bugs.
Release Critical
----------------
http://bugzilla.gnome.org/show_bug.cgi?id=125044 [chart label printing]
http://bugzilla.gnome.org/show_bug.cgi?id=121337 [negative time]
http://bugzilla.gnome.org/show_bug.cgi?id=124930 [warn about xml parse errors]
http://bugzilla.gnome.org/show_bug.cgi?id=125230 [second rounding]
http://bugzilla.gnome.org/show_bug.cgi?id=124315 [line plot ignores axis]
- Verify histogram tool. Feels fubar.
: text in boxes for text-xls/pivot.xls is white ??
: guia.xls complains of problems importing autofilter
Worries
http://bugzilla.gnome.org/show_bug.cgi?id=124271 [crash on undo free ?]
: can not replicate
http://bugzilla.gnome.org/show_bug.cgi?id=123567 [1.0 file]
: needinfo
http://bugzilla.gnome.org/show_bug.cgi?id=123781
: non reproducible
: non reproducible, possibly hp specific
http://bugzilla.gnome.org/show_bug.cgi?id=123403
: loading in XL corrupts. xbat is being lost when xl modifies it ??
Likely some libgsf issue
......
2003-10-23 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c : Ensure that all actions with
accelerators attempt to finish any edits in progress.
2003-10-22 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=77303
* src/sheet-control-gui.c (scg_cursor_move) : don't scroll the other
panes unless we absolutely have to.
2003-10-21 Morten Welinder <terra@gnome.org>
* src/format.c (append_hour_elapsed): Get sign right, even when
......
......@@ -19,6 +19,12 @@ Jody:
* Fix in 1.2.1 was spewing pointless warnings
http://bugzilla.gnome.org/show_bug.cgi?id=124975
* Handle undoing a paste from a deleted external sheet
http://bugzilla.gnome.org/show_bug.cgi?id=77303
* Don't scroll the other panes unless we absolutely have to.
http://bugzilla.gnome.org/show_bug.cgi?id=125269
* Try to save a current edit before an action
http://bugzilla.gnome.org/show_bug.cgi?id=125045
* Fix tick spacing with manual axis bounds
Morten:
* Fix crash with STF import and gazillions of columns.
......
2003-10-23 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c : Ensure that all actions with
accelerators attempt to finish any edits in progress.
2003-10-22 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=77303
* src/sheet-control-gui.c (scg_cursor_move) : don't scroll the other
panes unless we absolutely have to.
2003-10-21 Morten Welinder <terra@gnome.org>
* src/format.c (append_hour_elapsed): Get sign right, even when
......
2003-10-23 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c : Ensure that all actions with
accelerators attempt to finish any edits in progress.
2003-10-22 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=77303
* src/sheet-control-gui.c (scg_cursor_move) : don't scroll the other
panes unless we absolutely have to.
2003-10-21 Morten Welinder <terra@gnome.org>
* src/format.c (append_hour_elapsed): Get sign right, even when
......
......@@ -12,7 +12,7 @@ Description Difficulty Integration
from the toolbar for background or font.
- Have the pattern buttons in the format dialog Medium Low
reflect colour changes.
reflect colour changes. Reuse the code in goffice
- Audit the help text for all the functions. Some are Low Low
missing or do not conform to the style guides,
......
......@@ -2922,7 +2922,7 @@ excel_prepare_autofilter (ExcelWorkbook *ewb, GnmNamedExpr *nexpr)
}
static void
excel_read_NAME (BiffQuery *q, ExcelWorkbook *ewb)
excel_read_NAME (BiffQuery *q, ExcelWorkbook *ewb, gboolean global)
{
GPtrArray *a;
GnmNamedExpr *nexpr = NULL;
......@@ -3022,6 +3022,7 @@ excel_read_NAME (BiffQuery *q, ExcelWorkbook *ewb)
* XL stores a hidden name with the details of an autofilter */
if (nexpr->is_hidden && !strcmp (nexpr->name->str, "_FilterDatabase"))
excel_prepare_autofilter (ewb, nexpr);
g_warning ("flags = %hx, state = %s\n", flags, global ? "global" : "sheet");
}
}
......@@ -5037,7 +5038,7 @@ excel_read_sheet (BiffQuery *q, ExcelWorkbook *ewb,
case BIFF_XF_OLD:
excel_read_XF_OLD (q, ewb, esheet->container.ver);
break;
case BIFF_NAME: excel_read_NAME (q, ewb); break;
case BIFF_NAME: excel_read_NAME (q, ewb, FALSE); break;
case BIFF_FONT: excel_read_FONT (q, ewb); break;
case BIFF_FORMAT: excel_read_FORMAT (q, ewb); break;
case BIFF_STYLE: break;
......@@ -5436,7 +5437,7 @@ excel_read_workbook (IOContext *context, WorkbookView *wb_view,
break;
case BIFF_EXTERNNAME: excel_read_EXTERNNAME (q, &ewb->container); break;
case BIFF_NAME: excel_read_NAME (q, ewb); break;
case BIFF_NAME: excel_read_NAME (q, ewb, TRUE); break;
case BIFF_XCT: excel_read_XCT (q, ewb); break;
case BIFF_WRITEACCESS:
......
......@@ -43,13 +43,13 @@
#include <gtk/gtk.h>
/**
* cmd_select_cur_row:
* sv_select_cur_row:
* @sv: The sheet
*
* Selects an entire row
*/
void
cmd_select_cur_row (SheetView *sv)
sv_select_cur_row (SheetView *sv)
{
GnmRange const *sel = selection_first_range (sv, NULL, NULL);
if (sel != NULL) {
......@@ -63,13 +63,13 @@ cmd_select_cur_row (SheetView *sv)
}
/**
* cmd_select_cur_col:
* sv_select_cur_col:
* @sv: The sheet
*
* Selects an entire column
*/
void
cmd_select_cur_col (SheetView *sv)
sv_select_cur_col (SheetView *sv)
{
GnmRange const *sel = selection_first_range (sv, NULL, NULL);
if (sel != NULL) {
......@@ -83,14 +83,14 @@ cmd_select_cur_col (SheetView *sv)
}
/**
* cmd_select_cur_array :
* sv_select_cur_array :
* @sv: The sheet
*
* if the current cell is part of an array select
* the entire array.
*/
void
cmd_select_cur_array (SheetView *sv)
sv_select_cur_array (SheetView *sv)
{
GnmExprArray const *array;
int col, row;
......@@ -138,13 +138,13 @@ cb_collect_deps (GnmDependent *dep, gpointer user)
}
/**
* cmd_select_cur_depends :
* sv_select_cur_depends :
* @sv: The sheet
*
* Select all cells that depend on the expression in the current cell.
*/
void
cmd_select_cur_depends (SheetView *sv)
sv_select_cur_depends (SheetView *sv)
{
GnmCell *cur_cell;
GList *deps = NULL, *ptr = NULL;
......@@ -229,14 +229,14 @@ cmd_select_cur_depends (SheetView *sv)
}
/**
* cmd_select_cur_inputs :
* sv_select_cur_inputs :
* @sv: The sheet
*
* Select all cells that are direct potential inputs to the
* current cell.
*/
void
cmd_select_cur_inputs (SheetView *sv)
sv_select_cur_inputs (SheetView *sv)
{
GnmCell *cell;
......
......@@ -3,11 +3,12 @@
#include "gnumeric.h"
void cmd_select_cur_row (SheetView *sv);
void cmd_select_cur_col (SheetView *sv);
void cmd_select_cur_array (SheetView *sv);
void cmd_select_cur_depends (SheetView *sv);
void cmd_select_cur_inputs (SheetView *sv);
/* TODO : move these to selection */
void sv_select_cur_row (SheetView *sv);
void sv_select_cur_col (SheetView *sv);
void sv_select_cur_array (SheetView *sv);
void sv_select_cur_depends (SheetView *sv);
void sv_select_cur_inputs (SheetView *sv);
void cmd_paste_to_selection (WorkbookControl *wbc, SheetView *sv, int flags);
void cmd_paste (WorkbookControl *wbc, PasteTarget const *pt);
......
2003-10-23 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=125045
* graph/gog-axis.c (gog_axis_view_render) : clip correctly and space
the ticks based on the actual tick values, not just their index.
(gog_axis_num_markers) : return a step fraction too.
2003-10-21 Jody Goldberg <jody@gnome.org>
* graph/gog-renderer.c (gog_renderer_init) : init zoom to 1.
......
......@@ -850,21 +850,31 @@ gog_axis_bound_changed (GogAxis *axis, GogObject *contrib)
}
static unsigned
gog_axis_num_markers (GogAxis *axis)
gog_axis_num_markers (GogAxis *axis, double *step)
{
double minima, maxima;
if (axis->is_discrete) {
int n = 0;
if (axis->labels != NULL)
return go_data_vector_get_len (axis->labels);
if (axis->max_val >= axis->min_val) /* case there is no data */
return gnumeric_fake_trunc (axis->max_val);
return 0;
n = go_data_vector_get_len (axis->labels);
else if (axis->max_val >= axis->min_val) /* case there is no data */
n = gnumeric_fake_trunc (axis->max_val);
if (n < 0)
n = 0;
if (step != NULL)
*step = 1. / (n + 1);
return n;
} else {
double major_tick = axis_get_entry (axis, AXIS_ELEM_MAJOR_TICK, NULL);
if (major_tick <= 0. ||
!gog_axis_get_bounds (axis, &minima, &maxima))
!gog_axis_get_bounds (axis, &minima, &maxima)) {
if (step != NULL)
*step = 1.;
return 0;
}
if (step != NULL)
*step = major_tick / fabs (maxima - minima);
return 1.5 + fabs (maxima - minima) / major_tick;
}
}
......@@ -916,7 +926,7 @@ gog_axis_view_size_request (GogView *v, GogViewRequisition *req)
* things are too big */
if (axis->major_tick_labeled) {
gog_renderer_push_style (v->renderer, axis->base.style);
for (i = gog_axis_num_markers (axis) ; i-- > 0 ; ) {
for (i = gog_axis_num_markers (axis, NULL) ; i-- > 0 ; ) {
label = gog_axis_get_marker (axis, i);
gog_renderer_measure_text (v->renderer, label, &tmp);
g_free (label);
......@@ -974,7 +984,7 @@ gog_axis_view_render (GogView *v, GogViewAllocation const *bbox)
char *label;
gboolean draw_major, draw_minor;
double pre, post, bound, tick_len, label_pad, dir, center, start;
double step = 0, line_width = gog_renderer_line_size (
double step, line_width = gog_renderer_line_size (
v->renderer, axis->base.style->line.width) / 2;
(aview_parent_klass->render) (v, bbox);
......@@ -988,7 +998,7 @@ gog_axis_view_render (GogView *v, GogViewAllocation const *bbox)
draw_major = axis->major.tick_out || axis->major.tick_in;
draw_minor = axis->minor.tick_out || axis->minor.tick_in;
n = gog_axis_num_markers (axis);
n = gog_axis_num_markers (axis, &step);
if (axis->is_discrete)
n++;
switch (axis->type) {
......@@ -1008,8 +1018,7 @@ gog_axis_view_render (GogView *v, GogViewAllocation const *bbox)
break;
default : break;
}
if (n > 1)
step = (area->w - pre - post) / (n - 1);
step *= (area->w - pre - post);
axis_path[0].y = axis_path[1].y = center;
axis_path[0].x = start = area->x + pre;
......@@ -1036,6 +1045,8 @@ gog_axis_view_render (GogView *v, GogViewAllocation const *bbox)
}
for (bound = -1, i = 0 ; i < n ; i++) {
if (i*step > (area->w - pre - post)) /* clip */
continue;
if (draw_major) {
major_path[1].x = major_path[0].x = axis_path[0].x + i * step;
gog_renderer_draw_path (v->renderer, major_path);
......@@ -1073,8 +1084,7 @@ gog_axis_view_render (GogView *v, GogViewAllocation const *bbox)
break;
default : break;
}
if (n > 1)
step = area->h / (n - 1);
step *= area->h;
axis_path[0].x = axis_path[1].x = center;
axis_path[0].y = start = area->y + area->h;
......@@ -1101,6 +1111,8 @@ gog_axis_view_render (GogView *v, GogViewAllocation const *bbox)
}
for (bound = DBL_MAX, i = 0 ; i < n ; i++) {
if (i*step > area->h) /* clip */
continue;
if (draw_major) {
major_path[1].y = major_path[0].y = axis_path[0].y - i * step;
gog_renderer_draw_path (v->renderer, major_path);
......
......@@ -1207,7 +1207,7 @@ sv_selection_walk_step (SheetView *sv,
destination.col, destination.row,
destination.col, destination.row);
sv_make_cell_visible (sv, sv->edit_pos.col,
sv->edit_pos.row, TRUE);
sv->edit_pos.row, FALSE);
}
return;
}
......@@ -1238,7 +1238,7 @@ sv_selection_walk_step (SheetView *sv,
}
sv_set_edit_pos (sv, &destination);
sv_make_cell_visible (sv, destination.col, destination.row, TRUE);
sv_make_cell_visible (sv, destination.col, destination.row, FALSE);
}
#include <goffice/graph/gog-series.h>
......
......@@ -2410,7 +2410,7 @@ scg_cursor_move (SheetControlGUI *scg, int n,
sv_selection_reset (sv);
sv_cursor_set (sv, &tmp,
tmp.col, tmp.row, tmp.col, tmp.row, NULL);
sv_make_cell_visible (sv, tmp.col, tmp.row, TRUE);
sv_make_cell_visible (sv, tmp.col, tmp.row, FALSE);
sv_selection_add_pos (sv, tmp.col, tmp.row);
}
......
......@@ -1946,6 +1946,8 @@ static void
cb_file_print_preview (GtkWidget *widget, WorkbookControlGUI *wbcg)
{
Sheet *sheet = wb_control_cur_sheet (WORKBOOK_CONTROL (wbcg));
if (!wbcg_edit_finish (wbcg, TRUE, NULL))
return;
sheet_print (wbcg, sheet, TRUE, PRINT_ACTIVE_SHEET);
}
......@@ -2080,27 +2082,35 @@ cb_edit_clear_content (GtkWidget *widget, WorkbookControlGUI *wbcg)
static void
cb_edit_select_all (GtkWidget *widget, WorkbookControlGUI *wbcg)
{
if (!wbcg_edit_finish (wbcg, TRUE, NULL))
return;
scg_select_all (wbcg_cur_scg (wbcg));
}
static void
cb_edit_select_row (GtkWidget *widget, WorkbookControlGUI *wbcg)
{
cmd_select_cur_row (wb_control_cur_sheet_view (WORKBOOK_CONTROL (wbcg)));
if (!wbcg_edit_finish (wbcg, TRUE, NULL))
return;
sv_select_cur_row (wb_control_cur_sheet_view (WORKBOOK_CONTROL (wbcg)));
}
static void
cb_edit_select_col (GtkWidget *widget, WorkbookControlGUI *wbcg)
{
cmd_select_cur_col (wb_control_cur_sheet_view (WORKBOOK_CONTROL (wbcg)));
if (!wbcg_edit_finish (wbcg, TRUE, NULL))
return;
sv_select_cur_col (wb_control_cur_sheet_view (WORKBOOK_CONTROL (wbcg)));
}
static void
cb_edit_select_array (GtkWidget *widget, WorkbookControlGUI *wbcg)
{
cmd_select_cur_array (wb_control_cur_sheet_view (WORKBOOK_CONTROL (wbcg)));
if (!wbcg_edit_finish (wbcg, TRUE, NULL))
return;
sv_select_cur_array (wb_control_cur_sheet_view (WORKBOOK_CONTROL (wbcg)));
}
static void
cb_edit_select_depend (GtkWidget *widget, WorkbookControlGUI *wbcg)
{
cmd_select_cur_depends (wb_control_cur_sheet_view (WORKBOOK_CONTROL (wbcg)));
sv_select_cur_depends (wb_control_cur_sheet_view (WORKBOOK_CONTROL (wbcg)));
}
static void
......@@ -2300,6 +2310,8 @@ cb_edit_search_replace_action (WorkbookControlGUI *wbcg,
static void
cb_edit_search_replace (GtkWidget *unused, WorkbookControlGUI *wbcg)
{
if (!wbcg_edit_finish (wbcg, TRUE, NULL))
return;
dialog_search_replace (wbcg, cb_edit_search_replace_action);
}
......@@ -2307,6 +2319,8 @@ cb_edit_search_replace (GtkWidget *unused, WorkbookControlGUI *wbcg)
static void
cb_edit_search (GtkWidget *unused, WorkbookControlGUI *wbcg)
{
if (!wbcg_edit_finish (wbcg, TRUE, NULL))
return;
dialog_search (wbcg);
}
......@@ -2370,12 +2384,16 @@ cb_edit_fill_series (GtkWidget *unused, WorkbookControlGUI *wbcg)
static void
cb_edit_goto (GtkWidget *unused, WorkbookControlGUI *wbcg)
{
if (!wbcg_edit_finish (wbcg, TRUE, NULL))
return;
dialog_goto_cell (wbcg);
}
static void
cb_edit_recalc (GtkWidget *widget, WorkbookControlGUI *wbcg)
{
if (!wbcg_edit_finish (wbcg, TRUE, NULL))
return;
/* TODO :
* f9 - do any necessary calculations across all sheets
* shift-f9 - do any necessary calcs on current sheet only
......@@ -2471,6 +2489,8 @@ cb_insert_current_time (GtkWidget *widget, WorkbookControlGUI *wbcg)
static void
cb_define_name (GtkWidget *unused, WorkbookControlGUI *wbcg)
{
if (!wbcg_edit_finish (wbcg, TRUE, NULL))
return;
dialog_define_names (wbcg);
}
......@@ -2657,6 +2677,8 @@ TOGGLE_HANDLER (outline_symbols_right,{
static void
cb_format_cells (GtkWidget *unused, WorkbookControlGUI *wbcg)
{
if (!wbcg_edit_finish (wbcg, TRUE, NULL))
return;
dialog_cell_format (wbcg, FD_CURRENT);
}
......@@ -3135,6 +3157,8 @@ cb_insert_image (GtkWidget *widget, WorkbookControlGUI *wbcg)
static void
cb_insert_hyperlink (GtkWidget *widget, WorkbookControlGUI *wbcg)
{
if (!wbcg_edit_finish (wbcg, TRUE, NULL))
return;
dialog_hyperlink (wbcg, SHEET_CONTROL (wbcg_cur_scg (wbcg)));
}
......
......@@ -60,6 +60,14 @@ wbcg_auto_complete_destroy (WorkbookControlGUI *wbcg)
}
/**
* wbcg_edit_finish :
* @wbcg : #WorkbookControlGUI
* @accept : Should any changes be accepted or discarded
* @showed_dialog : If non-NULL will indicate if a dialog was displayed.
*
* Return TRUE if editing completed successfully, or we were no editing.
**/
gboolean
wbcg_edit_finish (WorkbookControlGUI *wbcg, gboolean accept,
gboolean *showed_dialog)
......
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