1. 24 May, 2000 1 commit
    • Morten Welinder's avatar
      Style now needs to be initialised before formats. · 169f4952
      Morten Welinder authored
      2000-05-24  Morten Welinder  <terra@diku.dk>
      
      	* src/main.c (gnumeric_main): Style now needs to be initialised
       	before formats.
      
      	* src/number-match.c (format_match): Take a StyleFormat ** instead
       	of a char ** for the suggested format.  All callers changed.
      	(format_parse_t): rename member format to format_str and
       	introduce new member format, a StyleFormat *.
      	(format_match_define): Get a style at this point.
      
      	* src/datetime.c (datetime_value_to_serial_raw): Don't supply a
       	format return variable to format_match since we aren't interested
       	in the result.
      
      	* src/parse-util.c (parse_text_value_or_expr): Return a
       	StyleFormat * instead of a char *.  All callers changed.
      
      	* src/expr.c (expr_parse_string): Take a StyleFormat ** instead of
       	a char ** for the suggested format.  All callers changed.
      
      	* src/parser.y (make_string_return): Turn parser_desired_format
       	into a StyleFormat **.
      	(gnumeric_expr_parser): Take a StyleFormat ** instead of a char **
       	for the suggested format.  All callers changed.
      
      	* src/auto-format.c (auto_style_format_suggest): New function.
      
      
      	* src/sheet-style.c (sheet_style_optimize): Include adjacent
       	ranges in the list of styles to consider.  Handle intervening
       	styles better.  Don't stop searching for matching pairs just
       	because we merge -- only when the merge kills the slave.
      
      	* src/ranges.c (range_dump): Don't print "\n".  All callers
       	changed as needed.
      
      	* src/sheet-style.c (sheet_style_optimize, sheet_styles_dump):
       	Send all debugging output to stderr.  (As opposed to half stderr
       	and half stdout.)
      169f4952
  2. 08 May, 2000 1 commit
  3. 29 Apr, 2000 1 commit
  4. 20 Apr, 2000 1 commit
    • Jody Goldberg's avatar
      Reorg cell contents and assignment. · bedb925b
      Jody Goldberg authored
      Fixs lots of usability details.
      
      2000-04-20  Jody Goldberg <jgoldberg@home.com>
      
      	* src/dialogs/dialog-cell-format.c : Use the edit_pos as the example
      	  not the top left corner.
      
      	* src/functions/fn-stat.c (gnumeric_ftest) : Use eval_pos_cellref
      	  to help localize the strangeness.
      	(gnumeric_ttest) : Ditto.
      
      	* src/xml-io.c (xml_write_cell_and_position) : If this is an array
      	  expression and we are the top left then add attributes to indicate
      	  size of array.  Ignore the rest of the array.
      	(xml_not_used_old_array_spec) : New routinr to handle the old array format.
      	(xml_cell_set_array_expr) : store an array.
      	(xml_read_cell) : Handle the old and the new array formats.
      
      	* src/workbook.c (workbook_close_if_user_permits) : Accept input
      	  first.
      	(wb_edit_key_pressed) : Handle array formulas here.
      	(workbook_detach_sheet) : Do not recalc all if we are exiting.
      	(workbook_start_editing_at_cursor) : When we start editing an
      	  array formula display just the formula not all the extra {}()[][] crap.
      
      	* src/sheet.c (SheetPrivate) : Add a recompute_spans flag.
      	(sheet_calc_spans) : New routine.
      	(sheet_cell_calc_span) : New routine.
      	(sheet_range_calc_spans) : Renamed and extended from
      	  sheet_cells_update.
      	(sheet_update) : Use sheet_calc_spans when necessary.
      	  Update the location region when the edit_pos changes.
      	(cb_recalc_spans_in_col) : Renamed from cb_collect_cells_in_col.
      	  Recalcs spans directly, no need to collect first.
      	(cb_set_cell_content) : New routine to set expr, or expr_and_value.
      	(sheet_range_set_text) : Use cb_set_cell_content, and remember
      	  chosen format with the cell rather than overriding the assigned
      	  format.
      	(sheet_cell_set_text) : Renamed from sheet_set_text.  Be more specific
      	  about how spans, rendering and the rest are handled.
      	(sheet_cell_set_expr) : New routine.
      	(sheet_cell_set_value) : Ditto.
      	(sheet_load_cell_val) : When displaying an array formula add {%s}()[][].
      	(sheet_redraw_cell_region) : Honour spans when redrawing.
      	(sheet_redraw_partial_row) : New routine.
      	(sheet_redraw_cell) : Ditto.
      	(sheet_is_cell_array) : Use cell_is_array.
      	(sheet_range_splits_array) : Renamed from sheet_check_for_partial_array.
      	(sheet_cell_add_to_hash) :  Do not touch spans at this point.
      	(sheet_cell_insert) : Rename from sheet_cell_add made recalc span
      	  optional.
      	(sheet_cell_new) : New routine that does not touch spans.
      	(sheet_cell_remove) : Made redraw optional.
      	(cb_clear_cell_comments) : Remove the cell if there is no comment.
      	(sheet_clear_region) : Remove the cell if there are no comments or
      	  contents.  Flag an update of the status region.
      
      	* src/sheet-view.c (cb_colrow_resize) : New function.
      	(sheet_view_col_size_changed) : Resize all rows, irrespective of
      	(sheet_view_row_size_changed) : existing cells.
      	(sheet_view_redraw_cell_region) : This no longer honours spans.
      
      	* src/sheet-style.c (sheet_style_attach) : Removed call to redraw.
      	sheet_cells_update : rename to sheet_range_calc_spans and move to
      	  sheet.c.
      
      	* src/sheet-autofill.c (autofill_cell) : Use sheet_cell_set_value
      	  rather than set_text.
      
      	* src/selection.c (sheet_selection_changed_hook) : Delete.
      	(sheet_selection_extend_to) : Update the status region to display the
      	  new size.
      	(sheet_selection_cut) : Use sheet_range_splits_array.
      	(selection_check_for_array) : New routine.
      
      	* src/parser.y : Remove icky array formula parsing that conflicted
      	  with array entries.
      
      	* src/number-match.c (format_match) : Return a Value * rather than a
      	  double.
      
      	* src/mstyle.c (mstyle_set_font_size) : Do not allow font sizes < 1.
      
      	* src/main.c (gnumeric_main) : Do NOT create an empty workbook
      	  then delete it if things are successfully loaded.  This causes
      	  a global recalc.  Instead add a flag to disable exit when the
      	  number of workbooks go to zero.  Then only enable the flag AFTER
      	  we have attempted to load the initial workbooks.
      
      	* src/item-grid.c (item_grid_event) : Update the status_region when
      	  button-1 is release.  It should display the edit_pos.
      
      	* src/gutils.c : Move cell_name, col_name, col_from_name,
      	  parse_cell_name, parse_cell_name_or_range and parse_cell_name_list,
      	  to parse-util.c.
      
      	* src/gnumeric.h  : Add RenderedValue.
      
      	* src/gnumeric-util.c (gnumeric_char_start_expr_p) : Move
      	  to parse-util.c
      
      	* src/file.c (workbook_read) : Remove freese thaw usage.
      	  Move call to update AFTER mark clean.
      
      	* src/expr.c (eval_pos_init) : Take a cellpos.
      	(parse_pos_evalpos) : New routine.
      	(eval_pos_cellref) : There is some questionable code scattered in the
      	  functions.  This routing localizes the odd bits for correction.
      
      	* src/eval.c (cell_eval_content) : Use sheet_redraw_cell,
      	  and rendered_value_calc_size.
      	(cell_get_dependencies) : Improve constness.
      
      	* src/corba-sheet.c : Remove the freeze thaw operations.
      	(Sheet_cell_set_formula) : Deleted.
      	(Sheet_range_set_formula) : Delete.
      
      	* src/commands.c : Adjust so that registration of command auto
      	  calls redo.  Add misc checks for splitting arrays.
      
      	* src/clipboard.h : Move the CellCopy types here from cell.h
      
      	* src/clipboard.c (paste_cell) : Use cell_has_expr.
      	  Don't insert the new cell till after its contents are assigned.
      
      	* src/cellspan.c (cell_register_span) : Improve constness.
      	(cell_unregister_span) : Ditto.
      	(row_cell_get_displayed_at) : Delete.
      	(cell_calc_span) : Moved here from cell.c
      
      	* src/dialogs/dialog-stf.glade : Adjust the header background colour
      	  to match the purdy new icon.  Add the icon.
      
      	* src/cell-draw.c : Use the rendered_value routines.
      	  Improve constness.
      
      	* src/analysis-tools.c (set_cell) : Use sheet_cell_fetch.
      
      	*.*
      	    cell_set_* -> sheet_cell_set_
      	    cell_set_*_simple -> cell_set_
      	    Cell::{row,col} -> Cell::{row,col}_info
      	    cell_get_text -> cell_get_entered_text
      	    cell_get_content -> cell_get_entered_text
      	    cell_name -> cell_coord_name
      	    cell_get_formatted_val -> cell_get_rendered_text
      	    cell_get_content -> cell_get_entered_text
      
      	* src/cell.c :
      	(cell_dirty) : Renamed from cell_modified.  Use
      	  sheet_set_dirty.
      	(cell_formula_changed) : Make the queuing of the recalc optional.
      	(cell_cleanout) : Handle union of expression and entered_text,
      	  and remove the rendered value.
      	(cell_copy) : Ditto.
      	(cell_destroy) : handle cell_modified -> cell_dirty.
      	(cell_set_text) : Use parse_text_value_or_expr and store the prefered
      	  format.
      	(cell_set_text_and_value) : New routine.
      	(cell_assign_value) : New routine.
      	(cell_set_value) : Support formats.
      	(cell_set_expr_and_value) : New routine.
      	(cell_set_expr_internal) : Split from cell_set_expr.
      	(cell_set_expr) : Divide to allow for not queuing a recalc.
      	(cell_set_array_formula) : Use cell_set_expr_internal.
      	(cell_is_array) : New utility.
      	(cell_is_partial_array) : New utility.
      	(cell_has_expr) : New utility.
      	(cell_render_value) : Use rendered_value_*.
      	Move all comment routines into cell-comment.[ch].
      
      	* idl/Gnumeric.idl : Remove cell_set_formula, and range_set_formula.
      	  These were identical to set_text.  Made Workbook embeddable.
      bedb925b
  5. 19 Apr, 2000 1 commit
    • Almer. S. Tigelaar's avatar
      Created an stf options struct which was never freed or used · 1435c616
      Almer. S. Tigelaar authored
      2000-04-18  Almer. S. Tigelaar.  <almer1@dds.nl>
      
      	* src/dialogs/dialog-stf-format-page.c
      	(stf_dialog_format_page_init) : Created an stf options struct
      	which was never freed or used
      
      	* src/dialogs/dialog-stf-preview.c
      	(stf_preview_merge_with_hash) : Somehow there was a *gigantic* leak
      	in this routine. I simply rewrote it from scratsch because I didn't
      	see the error. This seemed to help, because the leak is gone. :-)
      
      	* src/dialogs/dialog-stf-preview.[ch]
      	Added some 'how it works' comments on top. Should make it clear
              who is responsible of freeing memory and when.
      	(stf_preview_share_hash) : Removed.
      	I removed the hash sharing, it is obsolete and just wasted space as
      	hashes are no longer shared between druid pages anyway.
      1435c616
  6. 08 Apr, 2000 1 commit
    • Almer. S. Tigelaar's avatar
      Result of gtk_editable_get_chars was not freed. (2x) · 41906667
      Almer. S. Tigelaar authored
      2000-04-08  Almer. S. Tigelaar.  <almer1@dds.nl>
      
      	* src/dialogs/dialog-stf-csv-page.c
      	(csv_page_global_change) : Result of gtk_editable_get_chars was not
      	freed. (2x)
      
      	* src/stf-parse.c
      	(stf_parse_region) : Only the last item of the GSList's would be
      	freed
      	(stf_parse_sheet) : ditto
      41906667
  7. 25 Mar, 2000 1 commit
    • Almer. S. Tigelaar's avatar
      Added a stf_dialog prefix to all functions and changed dialog_stf into · 6bee1a9d
      Almer. S. Tigelaar authored
      2000-03-25 Almer. S. Tigelaar.  <almer1@dds.nl>
      
      	* src/dialogs/dialog-stf.h, src/dialogs/dialog-stf.c : Added a
      	stf_dialog prefix to all functions and changed dialog_stf into
      	stf_dialog, this makes more sense as the same naming convention
      	was used in src/stf-parse.[ch] and src/dialogs/dialog-stf-preview.[ch]
      
      	* src/dialogs/dialog-stf-main-page.c : idem
      	* src/dialogs/dialog-stf-csv-page.c : idem
      	* src/dialogs/dialog-stf-fixed-page.c : idem
      	* src/dialogs/dialog-stf-format-page.c : idem
      	* src/dialogs/dialog-stf-preview.c : idem
      
      	* src/stf.c : Uses the renamed functions
      	* src/clipboard.c : idem
      6bee1a9d
  8. 10 Mar, 2000 1 commit
    • Jody Goldberg's avatar
      Constness. · c2af08a9
      Jody Goldberg authored
      2000-03-10  Jody Goldberg <jgoldberg@home.com>
      
      	* src/func.c (tokenized_help_new) : Constness.
      
      	* src/widgets/gtk-combo-box.c (cb_state_change) : New function to keep
      	  the state of the combo display button and the combo arrow in sync.
      	(gtk_combo_box_init) : Connect cb_state_change to the arrow.
      	(gtk_combo_box_set_display) : Ditto for the display widget.
      
      	* src/sheet.c (sheet_set_zoom_factor) : Bound the factor at 10% and 500%
      
      	* src/workbook.c (change_zoom_in_current_sheet_cb) :
      	  call change_displayed_zoom_cb to adjust the combo to contain the
      	(workbook_focus_current_sheet) : Only emit signal if the sheet
      	  changed.
      
      2000-03-08  Jody Goldberg <jgoldberg@home.com>
      
      	* src/collect.c (callback_function_collect) : Treat arrays and ranges
      	  as errors.
      
      	* src/format.c (format_value) : formating a range returns a
      	  #VALUE! message.
      
      	* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet) :
      	  Use the workbook flags, and delete the icky globals.
      	(start_cell_selection_at) : Hide the std cursor when a cell selection
      	  cursor is created.
      	(gnumeric_sheet_stop_cell_selection) : Restore the std cursor.
      
      2000-03-07  Jody Goldberg <jgoldberg@home.com>
      
      	* src/workbook.c (accept_input) : Use workbook_finish_editing.
      	(cancel_input) : Ditto.
      	(do_focus_sheet) : Support range selection across spreadsheets.
      	(workbook_get_sheet_position) : Fix and document.
      	(workbook_move_sheet) : Fix.
      	(workbook_focus_sheet) : Handle errors cleanly.
      	(wb_edit_key_pressed) : Improve F4 handling.
      	(wizard_input) : Begin non-modal function wizard.  NOT FINSIHED.
      	(workbook_start_editing_at_cursor) : transfered from
      	  sheet_start_editing_at_cursor.
      	(workbook_finish_editing) : Distilled from sheet_{accept,cancel}_pending_input.
      	(Workbook) : Add editing_cell, editing_sheet, editing.
      
      	* src/sheet.c (sheet_stop_editing) : Delete.
      	(sheet_accept_pending_input) : Merge into workbook_finish_editing.
      	(sheet_cancel_pending_input) : Ditto.
      	(sheet_start_editing_at_cursor) :
      	(sheet_create_edit_cursor) : New function.
      	(sheet_destroy_edit_cursor) : New function.
      	(sheet_destroy_cell_select_cursor) :  New function.
      	(Sheet) : Delete editing and editing_cell.
      
      	* src/selection.c (sheet_selection_changed_hook) : Make public.  This
      	  should eventually move but I'm not sure where.  It is used for more
      	  than just changes in the selection in the current sheet.  It must
      	  also be called when the sheet changes.  What it REALLY does it to
      	  sync the shared workbook state with the current sheet's selection.
      
      	* src/item-cursor.c (item_cursor_init) : Handle change from
      	  sheet_accept_pending_input -> workbook_finish_editing.
      	* src/item-grid.c (item_grid_button_1) : Ditto.
      
      	* src/gnumeric-sheet.c (gnumeric_sheet_can_move_cursor) : Edit moved
      	  from sheet -> workbook.
      	(selection_insert_selection_string) : Extend to support
      	  abs/rel refs and intersheet-refs.
      	(gnumeric_sheet_stop_cell_selection) : Add clear_string argument
      	  to optionally remove the selection range.
      	(gnumeric_sheet_key_mode_sheet) : Adjust to movement of editing flag
      	  from sheet -> workbook.  Be careful to use the original sheet when
      	  moving rather than the current sheet.  Support F4 while editing.
      
      	* src/cell-draw.c (cell_draw) : editing_cell has moved from sheet to
      	  workbook.  Fix font ref leak when drawing the edit cell.
      
      	* src/dialogs/dialog-function-wizard.c : Begin transition to being
      	  non-modal.  NOT FINISHED.
      c2af08a9
  9. 02 Mar, 2000 1 commit
    • Almer. S. Tigelaar's avatar
      src/dialogs/dialog-stf-format-page.c src/dialogs/dialog-stf-preview.c · 41fcdb90
      Almer. S. Tigelaar authored
      2000-03-02  Almer. S. Tigelaar.  <almer1@dds.nl>
      
      	* src/dialogs/dialog-stf-format-page.c
      	* src/dialogs/dialog-stf-preview.c
      	* src/dialogs/dialog-stf-preview.h
      	* src/dialogs/dialog-stf.c
      	Modified, the format page now really display formatted
      	cells in the preview.
      	NOTE : A downside of this is that the cache is no longer shared
      	between fixed/csv pages and format pages.
      
      	* src/dialogs/dialog-stf.c
      	(dialog_stf_editables_enter) :
      	Disabled "enter activates default button" for the TextIndicator
      	field on the csv page. This would case the page to cycle, which
      	is ok, but it also caused the dropdown option to pop-up on the
      	next page, which is not ok.
      
      2000-03-02  Jon K Hellan  <hellan@acm.org>
      
      	* src/dialogs/dialog-stf.c (dialog_stf_druid_page_cancel): In
      	Yes/No dialog - set initial keyboard focus to "No". It went
      	nowhere.
      	(dialog_stf_set_initial_keyboard_focus): New function: Set
      	keyboard focus to the an appropriate widget on the page.
      	(dialog_stf_druid_page_next, dialog_stf_druid_page_previous): Set
      	initial keyboard focus.
      	(dialog_stf_druid_page_next): Make "Finish" button default on the the
      	final page. This doesn't change behaviour, but cues the user
      	visually.
      	(dialog_stf_druid_page_previous): Restore "Next" button as default
      	when coming from final page.
      	(dialog_stf_check_escape): New function: Watch keypresses, and
      	simulate "Cancel" when you see <Escape>.
      	(dialog_stf_attach_page_signals): Connect dialog_stf_check_escape
      	to handle <Escape>.
      	(dialog_stf_editables_enter): New function: Make <Ret> in text
      	fields activate default.
      	(dialog_stf): Use dialog_stf_editables_enter,
      	dialog_stf_set_initial_keyboard_focus. Make "next" button the
      	default button. Make window a child of the workbook window.
      
      	* src/dialogs/dialog-stf-format-page.c (format_page_init): Make
      	format list titles passive.
      
      	* src/dialogs/dialog-stf-fixed-page.c (fixed_page_init): Make
      	column list titles passive.
      
      	* src/clipboard.c (x_selection_to_cell_region): Add command
      	context to interface. Use it when calling dialog_stf.
      	(x_selection_to_cell_region):
      	(x_selection_received): Call x_selection_to_cell_region with
      	workbook_command_context_gui.
      41fcdb90
  10. 21 Feb, 2000 1 commit
    • Almer. S. Tigelaar's avatar
      : csv_page_custom_toggled was called twice, removed one. · 39d5acca
      Almer. S. Tigelaar authored
      2000-02-21 Almer. S. Tigelaar.  <almer1@dds.nl>
      
      	* src/dialogs/dialog-stf-csv-page.c :
      	(csv_page_prepare) : csv_page_custom_toggled was called twice, removed one.
      
      	* src/stf.c, src/dialogs/dialog-stf.c, src/dialogs/dialog-stf-main-page.c,
      	* src/dialogs/dialog-stf-csv-page.c, src/dialogs/dialog-stf-fixed-page.c,
      	* src/dialogs/dialog-stf-format-page.c, src/dialogs/dialog-stf-preview.c
      	Fixed incorrect comments and added function comment headers where they
      	didn't exist. Also moved some includes.
      
      	* src/dialogs/dialog-stf.h
      	Removed TEXT_VOFFSET, because it is no langer required.
      
      	* src/dialogs/dialog-stf-preview.h
      	Changed the colours to match the current gnumeric sheet selection color
      
      	* src/dialogs/dialog-stf-format-page.c
      	(format_page_collist_select_row) : Makes selected row visible
      	(format_page_prepare) : Corrected minor error which caused the format entry to stay empty
      
      	* src/dialogs/dialog-stf.glade, src/dialogs/dialog-stf.c, src/dialogs/dialog-stf.h
      	Completely removed the "finish" page of the druid.
      
      	* src/dialogs/dialog-stf.glade, src/stf-parse.h, src/stf-parse.c
      	Fixed support for colon and added support for new separator
      	symbols : semicolon, pipe, slash, hyphen, bang.
      	separators are now also displayed on the csv page.
      
      	* src/stf-parse.c
      	(stf_parse_get_colcount) : last line wasn't counted
      	(stf_parse_get_colwidth) : idem
      
      	* src/stf.h :
      	Removed obsoleted FileSource_t struct type definition.
      
      	* src/stf.c :
      	(stf_read_workbook) : Detach sheet on parse error.
      39d5acca
  11. 18 Feb, 2000 1 commit
    • Miguel de Icaza's avatar
      Remove stf plugin from here. And from here. · 86a1dc8b
      Miguel de Icaza authored
      2000-02-18  Miguel de Icaza  <miguel@gnu.org>
      
      	* configure.in (EXTRA_GNOME_CFLAGS): Remove stf plugin from here.
      	* plugins/Makefile.am (SUBDIRS): And from here.
      
      	* src/stf.c (stf_open_and_read): Use malloc instead of g_malloc0
      	because g_malloc aborts execution if the buffer is too large
      	(which it might likely be).
      	(stf_read_workbook): Release using free, not g_free here.
      	(stf_read_workbook): Fix sheet object memory leak.
      	(stf_init): Kill old and unused code.
      86a1dc8b