Commit d0559e77 authored by Jody Goldberg's avatar Jody Goldberg

[slicers] Misc

    - print hidden col/row items in xls import
    - fix for new canvas and support blank
    - Start to implement the slicer dialog
    - Prep for creation
    - add buttons to combo

    - <Tab> cursor movement
    Have it work the same way when entering content as when just moving
    around
parent 3a1e4702
......@@ -10,22 +10,18 @@ For 1.10
Release Critical
----------------
- move xml probe to gsf (DONE)
- poi open-pkg in gsf (DONE)
- merge autosave tree (DONE)
- win32 build issues (DONE)
- coverity fixes (DONE)
- hidding col/row headers should not hide outline symbols
- header selection broken when there are groups
In Progress
-----------
Jody
- xlsx chart axis export
- data slicers
- move clipboard to SAX interfaces
- CELL translation & array handling
- INDEX range res, iteration
- ExprEntry extensions
- Filter dups (does this make sense ?)
- Tool to filter dups
- python wrapper for libspreadsheet
- mis-export of array expr
http://bugzilla.gnome.org/show_bug.cgi?id=322096
......@@ -35,8 +31,6 @@ In Progress
Review
------
- func name translation {Manny}
- merge hdate functions
http://bugzilla.gnome.org/show_bug.cgi?id=153738
- merge libgda port
Target Features
......@@ -76,7 +70,7 @@ Misc stuff that should be fixed
Worries
-------
: range_translate in stf.c looks suspecious.
: range_translate in stf.c looks suspicous.
: Add bounds checking of integers on the xml based importers
: do bounds check in excel_get_text
: provide undo for dropped objects from sheet_objects_clear
......@@ -87,10 +81,6 @@ Worries
- Create new type string/double/int (not bool) for BIN2DEC etc.
- Allow missing arguments that are not '?' for ACCRINT.
- GETPIVOTDATA signature
- Reading /local/info/test-xls/Desktop\ \&\ Collaboration\ Products\ Weekly\ Invoice.xls
: getpivotdata
- TestForBiffConsumer : #REF ??
- accrint-test.xls : why fail ?
- BAHT functions
......@@ -111,7 +101,6 @@ Worries
- named-expr-97.xls
- operand.xls
- pivot-edited.xls : odd colours in the 'the range that contains' box
- hidding col/row headers should not hide outline symbols
- store and persist view modes
- fix bogosity of 'ant' cursors being in sheet_view and having the app contact them.
......@@ -247,6 +236,8 @@ Architecture Changes
5.5.4.3) support toggles (DONE)
5.5.4.4) Add ok/cancel buttons
5.5.4.5) filter/sort options
5.6) Functions
5.6.1) GETPIVOTDATA signature
6) Undo/redo improvements
6.1) Keep a .swp style log of user actions {Dan Hall}
......@@ -824,37 +815,23 @@ Architecture Changes
41) win32
41.1) Fix preview [#533795]
41.1.1) port over evince based preview from unix
41.1.1.1) port it (DONE)
41.1.1.1) port it
41.1.1.2) patch glib [#566348]
41.2) python installation [#549387]
41.2.1) pygobject build fix (DONE)
41.2.2) automate pygobject build fix (DONE)
41.2.1) pygobject build fix
41.2.2) automate pygobject build fix
41.2.3) package pygobject
41.2.4) install pygobject
41.3) libbz2 not found for libgsf (DONE)
41.4) hhmap
41.4.1) how to generate
41.4.2) include in the installer
41.5) optionally add quicklaunch & desktop links
41.3) Docs
41.3.1) Generation of hhmap (DONE)
41.3.2) include hhmap with installer (DONE)
41.3.3) Include chm/hhmap build in build process
41.3.4) Generate chm package during build
41.6) long pause between license and screen ?
41.7) version dll.a the same way the .dll is handled
41.8) Fix Paradox build
41.8.1) find solution (DONE)
41.8.2) automate solution
41.9) Add MS Office processing instruction hooks for us
41.10) freetype
41.10.1) fix build (DONE)
41.10.2) extend jhbuild to automate fix (DONE)
41.10.3) get patch into mainline [#566437]
41.11) fontconfig
41.11.1) jpg not found
41.11.2) zlib not found
41.11.3) CPPFLAGS patch
41.12) evince
41.12.1) totem screensaver disable
41.12.1.1) make patch
41.12.2) session management
41.12.3) direct connection to unix print backend
41.8) Add MS Office processing instruction hooks for us
41.9) Increase stack size
41.10) Check registry/gconf wrapper
autoformat
----------
......
2009-12-29 Jody Goldberg <jody@gnome.org>
* src/gnm-pane.c (gnm_pane_key_mode_sheet) : Support autoiterating
through a region with <Tab>.
2009-12-29 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/sheet-object-widget.c (sheet_widget_draw_cairo): only use
......
2009-12-29 Jody Goldberg <jody@gnome.org>
* xls-read-pivot.c (xls_read_SXVI) : new stub. Currently only notices
when XL wants to hide things.
(xls_read_SXVD) : used from here.
2009-12-24 Jean Brefort <jean.brefort@normalesup.org>
* xlsx-read-pivot.c (xlsx_CT_Number),
......
......@@ -612,6 +612,54 @@ xls_read_SXIVD (BiffQuery *q, ExcelReadSheet *esheet)
}
}
static void
xls_read_SXVI (BiffQuery *q, ExcelReadSheet *esheet, unsigned int i)
{
guint16 const type = GSF_LE_GET_GUINT16 (q->data + 0);
guint16 const flags = GSF_LE_GET_GUINT16 (q->data + 2);
guint16 const cache_index = GSF_LE_GET_GUINT16 (q->data + 4);
// guint16 const name_len = GSF_LE_GET_GUINT16 (q->data + 6);
GnmXLImporter *imp = esheet->container.importer;
GODataCacheField *dcf = go_data_slicer_field_get_cache_field (imp->pivot.slicer_field);
char const *type_str = "unknown";
XL_CHECK_CONDITION (NULL != dcf);
d(0, { switch (type) {
case 0xFE: type_str = "Page"; break;
case 0xFF: type_str = "Null"; break;
case 0x00: type_str = "Data"; break;
case 0x01: type_str = "Default"; break;
case 0x02: type_str = "SUM"; break;
case 0x03: type_str = "COUNTA"; break;
case 0x04: type_str = "COUNT"; break;
case 0x05: type_str = "AVERAGE"; break;
case 0x06: type_str = "MAX"; break;
case 0x07: type_str = "MIN"; break;
case 0x08: type_str = "PRODUCT"; break;
case 0x09: type_str = "STDEV"; break;
case 0x0A: type_str = "STDEVP"; break;
case 0x0B: type_str = "VAR"; break;
case 0x0C: type_str = "VARP"; break;
case 0x0D: type_str = "Grand total"; break;
default : type_str = "UNKNOWN"; break;
}
g_print ("[%u] %s %s %s %s %s = %hu\n", i, type_str,
(flags & 1) ? "hidden " : "",
(flags & 2) ? "detailHid " : "",
(flags & 4) ? "calc " : "",
(flags & 8) ? "missing " : "", cache_index);
});
if (type == 0x00 && (flags & 1))
{
XL_CHECK_CONDITION (cache_index != 0xffff);
g_print ("hide : ");
go_data_cache_dump_value (go_data_cache_field_get_val (dcf, cache_index));
g_print ("\n");
}
}
void
xls_read_SXVD (BiffQuery *q, ExcelReadSheet *esheet)
{
......@@ -657,7 +705,7 @@ xls_read_SXVD (BiffQuery *q, ExcelReadSheet *esheet)
for (i = 0 ; i < num_items ; i++)
if (ms_biff_query_peek_next (q, &opcode) && BIFF_SXVI == opcode &&
check_next_min (q, 8)) {
/* Ignore */
xls_read_SXVI (q, esheet, i);
}
if (ms_biff_query_peek_next (q, &opcode) && BIFF_SXVDEX == opcode &&
check_next_min (q, 12)) {
......
......@@ -250,7 +250,7 @@ xls_write_cache_row (ExcelWriteState *ewb, GODataCache const *cache, unsigned in
for (i = 0 ; i < inlined->len ; i++)
xls_write_pivot_cache_value (ewb,
go_data_cache_get_val (cache, g_ptr_array_index (inlined, i), n));
go_data_cache_field_get_val (g_ptr_array_index (inlined, i), n));
}
static void
......
......@@ -117,7 +117,7 @@ xlsx_write_pivot_cache_records (XLSXWriteState *state, GODataCache const *cache,
case GO_DATA_CACHE_FIELD_TYPE_INLINE :
xlsx_write_pivot_val (state, xml,
go_data_cache_get_val (cache, field, j));
go_data_cache_field_get_val (field, j));
break;
case GO_DATA_CACHE_FIELD_TYPE_NONE :
......
......@@ -736,7 +736,7 @@ typedef struct {
GnmEvalPos pos;
gchar *text;
PangoAttrList *markup;
gboolean has_user_format;
gboolean has_user_format, first_time;
GnmCellRegion *old_contents;
ColRowIndexList *columns, *rows;
ColRowStateGroup *old_widths, *old_heights;
......@@ -978,6 +978,7 @@ cmd_set_text (WorkbookControl *wbc,
g_free (where);
g_free (text);
me->first_time = TRUE;
me->has_user_format = !go_format_is_general (
gnm_style_get_format (sheet_style_get (sheet, pos->col, pos->row)));
......
2009-12-29 Jody Goldberg <jody@gnome.org>
* dialog-data-slicer.c : some incomplete work towards creating sources
2009-12-29 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* formula-guru.glade: add quote button
......
......@@ -91,12 +91,14 @@
<property name="enable_popup">False</property>
<child>
<widget class="Custom" id="custom1">
<widget class="GtkVBox" id="source_vbox">
<property name="visible">True</property>
<property name="creation_function">gnm_expr_entry_new_glade</property>
<property name="int1">0</property>
<property name="int2">0</property>
<property name="last_modification_time">Sun, 03 May 2009 22:57:16 GMT</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
......@@ -107,7 +109,7 @@
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">Data</property>
<property name="label" translatable="yes">Source</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
......
......@@ -34,17 +34,24 @@
#include <gnm-sheet-slicer.h>
#include <go-data-slicer.h>
#include <go-data-slicer-field.h>
#include <go-data-cache.h>
#include <glade/glade.h>
typedef struct {
GtkWidget *dialog;
GladeXML *gui;
WBCGtk *wbcg;
SheetView *sv;
GnmSheetSlicer *slicer;
GtkWidget *dialog;
GladeXML *gui;
WBCGtk *wbcg;
SheetView *sv;
GtkTreeView *treeview;
GnmSheetSlicer *slicer;
GODataCache *cache;
GODataCacheSource *source;
GtkWidget *notebook;
GnmExprEntry *source_expr;
GtkTreeView *treeview;
GtkTreeSelection *selection;
} DialogDataSlicer;
......@@ -60,8 +67,10 @@ enum {
static void
cb_dialog_data_slicer_destroy (DialogDataSlicer *state)
{
if (NULL != state->gui) { g_object_unref (G_OBJECT (state->gui)); state->gui = NULL; }
if (NULL != state->slicer) { g_object_unref (G_OBJECT (state->slicer)); state->slicer = NULL; }
if (NULL != state->gui) { g_object_unref (G_OBJECT (state->gui)); state->gui = NULL; }
if (NULL != state->slicer) { g_object_unref (G_OBJECT (state->slicer)); state->slicer = NULL; }
if (NULL != state->cache) { g_object_unref (G_OBJECT (state->cache)); state->cache = NULL; }
if (NULL != state->source) { g_object_unref (G_OBJECT (state->source)); state->source = NULL; }
state->dialog = NULL;
g_free (state);
}
......@@ -134,6 +143,7 @@ cb_dialog_data_slicer_create_model (DialogDataSlicer *state)
{ GDS_FIELD_TYPE_ROW, N_("Row") },
{ GDS_FIELD_TYPE_COL, N_("Column") },
{ GDS_FIELD_TYPE_DATA, N_("Data") },
/* Must be last */
{ GDS_FIELD_TYPE_UNSET, N_("Unused") }
};
......@@ -164,24 +174,26 @@ cb_dialog_data_slicer_create_model (DialogDataSlicer *state)
n = go_data_slicer_num_fields (GO_DATA_SLICER (state->slicer));
for (i = 0 ; i < n ; i++) {
GtkTreeIter child_iter;
unsigned int field_types;
int header_indx;
GODataSlicerField *field =
go_data_slicer_get_field (GO_DATA_SLICER (state->slicer), i);
GOString *name = go_data_slicer_field_get_name (field);
g_object_get (field, "field-types", &field_types, "header-index", &header_indx, NULL);
for (j = 0 ; j < G_N_ELEMENTS (field_type_labels) ; j++)
if ((field_types & (1 << field_type_labels[j].type))) {
gboolean used = FALSE;
for (j = 0 ; j < G_N_ELEMENTS (field_type_labels) ; j++) {
int header_index = (GDS_FIELD_TYPE_UNSET != field_type_labels[j].type)
? go_data_slicer_field_get_field_type_pos (field, field_type_labels[j].type)
: (used ? -1 : 0);
if (header_index >= 0) {
used = TRUE;
gtk_tree_store_append (model, &child_iter, &field_type_labels[j].iter);
gtk_tree_store_set (model, &child_iter,
FIELD, NULL,
FIELD, field,
FIELD_TYPE, field_type_labels[j].type,
FIELD_NAME, name->str,
FIELD_HEADER_INDEX, header_indx,
FIELD_HEADER_INDEX, header_index,
-1);
}
}
}
gtk_tree_view_set_model (state->treeview, smodel);
}
......@@ -192,6 +204,14 @@ cb_dialog_data_slicer_selection_changed (GtkTreeSelection *selection,
{
}
static void
cb_source_expr_changed (DialogDataSlicer *state)
{
GnmValue *range;
range = gnm_expr_entry_parse_as_value
(GNM_EXPR_ENTRY (state->source_expr), sv_sheet (state->sv));
}
void
dialog_data_slicer (WBCGtk *wbcg, gboolean create)
{
......@@ -211,16 +231,35 @@ dialog_data_slicer (WBCGtk *wbcg, gboolean create)
if (NULL == gui)
return;
state = g_new (DialogDataSlicer, 1);
state = g_new0 (DialogDataSlicer, 1);
state->wbcg = wbcg;
state->sv = wb_control_cur_sheet_view (WORKBOOK_CONTROL (wbcg));
state->gui = gui;
state->slicer = sv_editpos_in_slicer (state->sv);
state->dialog = glade_xml_get_widget (state->gui, "dialog_data_slicer");
state->notebook = glade_xml_get_widget (state->gui, "notebook");
state->slicer = create ? NULL : sv_editpos_in_slicer (state->sv);
state->cache = NULL;
state->source = NULL;
if (NULL == state->slicer) {
} else
state->slicer = g_object_new (GNM_SHEET_SLICER_TYPE, NULL);
} else {
g_object_ref (G_OBJECT (state->slicer));
g_object_get (G_OBJECT (state->slicer), "cache", &state->cache, NULL);
if (NULL != state->cache &&
NULL != (state->source = go_data_cache_get_source (state->cache)))
g_object_ref (G_OBJECT (state->source));
}
state->dialog = glade_xml_get_widget (state->gui, "dialog_data_slicer");
state->source_expr = gnm_expr_entry_new (state->wbcg, TRUE);
gnm_expr_entry_set_flags (state->source_expr,
GNM_EE_SINGLE_RANGE, GNM_EE_MASK);
g_signal_connect_swapped (G_OBJECT (state->source_expr),
"changed", G_CALLBACK (cb_source_expr_changed), state);
w = glade_xml_get_widget (state->gui, "source_vbox");
gtk_box_pack_start (GTK_BOX (w), GTK_WIDGET (state->source_expr), FALSE, FALSE, 0);
gtk_widget_show (GTK_WIDGET (state->source_expr));
w = glade_xml_get_widget (state->gui, "ok_button");
g_signal_connect (G_OBJECT (w), "clicked",
......@@ -246,6 +285,8 @@ dialog_data_slicer (WBCGtk *wbcg, gboolean create)
g_signal_connect (state->treeview, "realize", G_CALLBACK (gtk_tree_view_expand_all), NULL);
gtk_notebook_set_current_page (GTK_NOTEBOOK (state->notebook), create ? 0 : 1);
/* a candidate for merging into attach guru */
gnumeric_init_help_button (glade_xml_get_widget (state->gui, "help_button"),
GNUMERIC_HELP_LINK_DATA_SLICER);
......
......@@ -159,6 +159,7 @@ gnm_pane_key_mode_sheet (GnmPane *pane, GdkEventKey *event,
gboolean delayed_movement = FALSE;
gboolean jump_to_bounds = event->state & GDK_CONTROL_MASK;
gboolean is_enter = FALSE;
int first_tab_col;
int state = gnumeric_filter_modifiers (event->state);
void (*movefn) (SheetControlGUI *, int n, gboolean jump, gboolean horiz);
......@@ -386,8 +387,14 @@ gnm_pane_key_mode_sheet (GnmPane *pane, GdkEventKey *event,
if (wbcg_is_editing (wbcg))
sheet = wbcg->editing_sheet;
/* registering the cmd clears it, restore it afterwards */
first_tab_col = sv->first_tab_col;
if (wbcg_edit_finish (wbcg, WBC_EDIT_ACCEPT, NULL)) {
GODirection dir = gnm_conf_get_core_gui_editing_enter_moves_dir ();
sv->first_tab_col = first_tab_col;
if ((event->state & GDK_MOD1_MASK) &&
(event->state & GDK_CONTROL_MASK) &&
!is_enter) {
......@@ -395,7 +402,7 @@ gnm_pane_key_mode_sheet (GnmPane *pane, GdkEventKey *event,
workbook_cmd_dec_indent (sc->wbc);
else
workbook_cmd_inc_indent (sc->wbc);
} else if (dir != GO_DIRECTION_NONE) {
} else if (!is_enter || dir != GO_DIRECTION_NONE) {
gboolean forward = TRUE;
gboolean horizontal = TRUE;
if (is_enter) {
......
......@@ -321,6 +321,7 @@ gnm_sheet_slicers_at_pos (Sheet const *sheet, GnmCellPos const *pos)
return NULL;
}
#if 0
static void
gss_append_field_indicies (GnmSheetSlicer const *gss, GODataSlicerFieldType type,
GArray *field_order)
......@@ -331,6 +332,29 @@ gss_append_field_indicies (GnmSheetSlicer const *gss, GODataSlicerFieldType type
g_array_append_val (field_order, g_array_index (tmp, int, i));
}
static void
gnm_sheet_slicer_test_sort (GnmSheetSlicer *gss)
{
/* quick test to sort the cache based on the row/col */
GArray *permutation, *field_order;
unsigned int i, n;
field_order = g_array_sized_new (FALSE, FALSE, sizeof (unsigned int), gss->base.all_fields->len);
gss_append_field_indicies (gss, GDS_FIELD_TYPE_ROW, field_order);
gss_append_field_indicies (gss, GDS_FIELD_TYPE_COL, field_order);
n = go_data_cache_num_items (gss->base.cache);
permutation = g_array_sized_new (FALSE, FALSE, sizeof (int), n);
for (i = 0 ; i < n ; i++)
g_array_append_val (permutation, i);
go_data_cache_permute (gss->base.cache, field_order, permutation);
go_data_cache_dump (gss->base.cache, field_order, permutation);
g_array_free (field_order, TRUE);
g_array_free (permutation, TRUE);
}
#endif
/**
* gnm_sheet_slicer_regenerate:
* @gss : #GnmSheetSlicer
......@@ -342,27 +366,20 @@ gss_append_field_indicies (GnmSheetSlicer const *gss, GODataSlicerFieldType type
void
gnm_sheet_slicer_regenerate (GnmSheetSlicer *gss)
{
GArray *permutation, *field_order;
#if 0
GArray *permutation, *rows;
unsigned int i, n;
g_return_if_fail (IS_GNM_SHEET_SLICER (gss));
g_return_if_fail (IS_SHEET (gss->sheet));
g_return_if_fail (NULL != gss->base.cache);
field_order = g_array_sized_new (FALSE, FALSE, sizeof (unsigned int), gss->base.all_fields->len);
gss_append_field_indicies (gss, GDS_FIELD_TYPE_ROW, field_order);
gss_append_field_indicies (gss, GDS_FIELD_TYPE_COL, field_order);
n = go_data_cache_num_items (gss->base.cache);
permutation = g_array_sized_new (FALSE, FALSE, sizeof (int), n);
for (i = 0 ; i < n ; i++)
g_array_append_val (permutation, i);
/* TODO : apply page filters */
go_data_cache_permute (gss->base.cache, field_order, permutation);
go_data_cache_dump (gss->base.cache, field_order, permutation);
g_array_free (field_order, TRUE);
g_array_free (permutation, TRUE);
#endif
}
GnmSheetSlicerLayout
......
......@@ -23,6 +23,7 @@
#include <gnumeric-config.h>
#include "go-data-cache-field-impl.h"
#include "go-data-cache-impl.h"
#include "go-data-cache.h"
#include <go-val.h>
......@@ -152,6 +153,13 @@ GSF_CLASS (GODataCacheField, go_data_cache_field,
go_data_cache_field_class_init, go_data_cache_field_init,
G_TYPE_OBJECT)
GODataCache *
go_data_cache_field_get_cache (GODataCacheField const *field)
{
g_return_val_if_fail (IS_GO_DATA_CACHE_FIELD (field), NULL);
return field->cache;
}
GOString *
go_data_cache_field_get_name (GODataCacheField const *field)
{
......@@ -194,3 +202,26 @@ go_data_cache_field_ref_type (GODataCacheField const *field)
g_return_val_if_fail (IS_GO_DATA_CACHE_FIELD (field), GO_DATA_CACHE_FIELD_TYPE_NONE);
return field->ref_type;
}
GOVal const *
go_data_cache_field_get_val (GODataCacheField const *field, unsigned int record_num)
{
gpointer p;
unsigned int idx;
g_return_val_if_fail (IS_GO_DATA_CACHE_FIELD (field), NULL);
p = go_data_cache_records_index (field->cache, record_num) + field->offset;
switch (field->ref_type) {
case GO_DATA_CACHE_FIELD_TYPE_NONE : return NULL;
case GO_DATA_CACHE_FIELD_TYPE_INLINE : return *((GOVal **)p);
case GO_DATA_CACHE_FIELD_TYPE_INDEXED_I8 : idx = *(guint8 *)p; break;
case GO_DATA_CACHE_FIELD_TYPE_INDEXED_I16 : idx = *(guint16 *)p; break;
case GO_DATA_CACHE_FIELD_TYPE_INDEXED_I32 : idx = *(guint32 *)p; break;
default :
g_warning ("unknown field type %d", field->ref_type);
return NULL;
}
return (idx-- > 0) ? g_ptr_array_index (field->indexed, idx) : NULL;
}
......@@ -44,10 +44,12 @@ typedef enum {
GType go_data_cache_field_get_type (void);
GOString *go_data_cache_field_get_name (GODataCacheField const *field);
GOValArray const *go_data_cache_field_get_vals (GODataCacheField const *field, gboolean group_val);
void go_data_cache_field_set_vals (GODataCacheField *field, gboolean group_val,
GOValArray *a);
GODataCache *go_data_cache_field_get_cache (GODataCacheField const *field);
GOVal const *go_data_cache_field_get_val (GODataCacheField const *field, unsigned int record_num);
GOString *go_data_cache_field_get_name (GODataCacheField const *field);
GOValArray const *go_data_cache_field_get_vals (GODataCacheField const *field, gboolean group_val);
void go_data_cache_field_set_vals (GODataCacheField *field, gboolean group_val,
GOValArray *a);
gboolean go_data_cache_field_is_base (GODataCacheField const *field);
GODataCacheFieldType
......
......@@ -48,6 +48,9 @@ typedef struct {
GObjectClass base;
} GODataCacheClass;
/* utility macro */
#define go_data_cache_records_index(c, i) ((c)->records + ((c)->record_size * (i)))
G_END_DECLS
#endif /* GO_DATA_CACHE_IMPL_H */
......@@ -42,7 +42,6 @@ enum {
};
/*****************************************************************/
#define go_data_cache_records_index(c, i) ((c)->records + ((c)->record_size * (i)))
static void
go_data_cache_records_set_size (GODataCache *cache, unsigned int n)
......@@ -296,7 +295,7 @@ go_data_cache_import_start (GODataCache *cache, unsigned int n)
go_data_cache_records_init (cache, n, offset);
}
static void
void
go_data_cache_dump_value (GOVal const *v)
{
if (NULL == v) {
......@@ -426,30 +425,6 @@ go_data_cache_get_field (GODataCache const *cache, int i)
return g_ptr_array_index (cache->fields, i);
}
GOVal const *
go_data_cache_get_val (GODataCache const *cache,
GODataCacheField const *field, unsigned int record_num)
{
gpointer p;
unsigned int idx;
g_return_val_if_fail (IS_GO_DATA_CACHE (cache), NULL);
p = go_data_cache_records_index (cache, record_num) + field->offset;
switch (field->ref_type) {
case GO_DATA_CACHE_FIELD_TYPE_NONE : return NULL;
case GO_DATA_CACHE_FIELD_TYPE_INLINE : return *((GOVal **)p);
case GO_DATA_CACHE_FIELD_TYPE_INDEXED_I8 : idx = *(guint8 *)p; break;
case GO_DATA_CACHE_FIELD_TYPE_INDEXED_I16 : idx = *(guint16 *)p; break;
case GO_DATA_CACHE_FIELD_TYPE_INDEXED_I32 : idx = *(guint32 *)p; break;
default :
g_warning ("unknown field type %d", field->ref_type);
return NULL;
}
return (idx-- > 0) ? g_ptr_array_index (field->indexed, idx) : NULL;
}
int
go_data_cache_get_index (GODataCache const *cache,
GODataCacheField const *field, unsigned int record_num)
......
......@@ -47,8 +47,6 @@ void go_data_cache_set_val (GODataCache *dc,
int field, unsigned int record_num, GOVal *v);
int go_data_cache_get_index (GODataCache const *dc,
GODataCacheField const *field, unsigned int record_num);
GOVal const *go_data_cache_get_val (GODataCache const *dc,
GODataCacheField const *field, unsigned int record_num);
/* Data Access */
unsigned int go_data_cache_num_items (GODataCache const *dc);
......@@ -64,6 +62,7 @@ void go_data_cache_permute (GODataCache const *dc,
void go_data_cache_dump (GODataCache *dc,
GArray const *field_order,
GArray const *permutation);
void go_data_cache_dump_value (GOVal const *v);
G_END_DECLS
......
......@@ -1141,37 +1141,23 @@ cb_wbc_destroyed (SheetControlGUI *scg)
}
static void
cb_scg_prefs (G_GNUC_UNUSED Sheet *sheet,
G_GNUC_UNUSED GParamSpec *pspec,
SheetControlGUI *scg)
cb_scg_redraw (SheetControlGUI *scg)
{
scg_adjust_preferences (scg);
}
static void
cb_scg_redraw (Sheet *sheet,
GParamSpec *pspec,
SheetControlGUI *scg)
{
cb_scg_prefs (sheet, pspec, scg);
scg_redraw_all (&scg->sheet_control, TRUE);
}
static void
cb_scg_redraw_resize (Sheet *sheet,
GParamSpec *pspec,
SheetControlGUI *scg)
cb_scg_redraw_resize (SheetControlGUI *scg)
{
cb_scg_redraw (sheet, pspec, scg);
cb_scg_redraw (scg);
scg_resize (scg, FALSE);
}
static void
cb_scg_sheet_resized (Sheet *sheet,
GParamSpec *pspec,
SheetControlGUI *scg)
cb_scg_sheet_resized (SheetControlGUI *scg)
{
cb_scg_redraw_resize (sheet, pspec, scg);
cb_scg_redraw_resize (scg);
sc_set_panes (&scg->sheet_control);
}
......@@ -1535,20 +1521,19 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
sv_attach_control (sv, SHEET_CONTROL (scg));
g_object_connect
(G_OBJECT (sheet),
g_object_connect (G_OBJECT (sheet),
"swapped_signal::notify::text-is-rtl", cb_scg_direction_changed, scg,
"signal::notify::display-formulas", cb_scg_redraw, scg,
"signal::notify::display-zeros", cb_scg_redraw, scg,
"signal::notify::display-grid", cb_scg_redraw, scg,
"signal::notify::display-column-header", cb_scg_prefs, scg,
"signal::notify::display-row-header", cb_scg_prefs, scg,
"signal::notify::use-r1c1", cb_scg_redraw, scg,
"signal::notify::display-outlines", cb_scg_redraw_resize, scg,
"signal::notify::display-outlines-below", cb_scg_redraw_resize, scg,
"signal::notify::display-outlines-right", cb_scg_redraw_resize, scg,
"signal::notify::columns", cb_scg_sheet_resized, scg,