static void
psppire_sheet_finalize (GObject *object)
{
- PsppireSheet *sheet;
-
g_return_if_fail (object != NULL);
g_return_if_fail (PSPPIRE_IS_SHEET (object));
- sheet = PSPPIRE_SHEET (object);
-
if (G_OBJECT_CLASS (parent_class)->finalize)
(*G_OBJECT_CLASS (parent_class)->finalize) (object);
}
GdkRectangle allocation)
{
GtkShadowType shadow_type;
- gint text_width = 0, text_height = 0;
+ gint text_width = 0;
PangoAlignment align = PANGO_ALIGN_LEFT;
gboolean rtl ;
if (button->label_visible)
{
- text_height = DEFAULT_ROW_HEIGHT -
- 2 * COLUMN_TITLES_HEIGHT;
-
gdk_gc_set_clip_rectangle (GTK_WIDGET (sheet)->style->fg_gc[button->state],
&allocation);
gdk_gc_set_clip_rectangle (GTK_WIDGET (sheet)->style->white_gc,
struct string tmp;
- bool explicit_decimals = false;
int save_errno;
char *tail;
/* Decimal point and following digits. */
if (ss_match_byte (&i->input, style->decimal))
{
- explicit_decimals = true;
ds_put_byte (&tmp, '.');
while (c_isdigit (ss_first (i->input)))
ds_put_byte (&tmp, ss_get_byte (&i->input));
&& !ss_is_empty (i->input)
&& strchr ("eEdD-+", ss_first (i->input)))
{
- explicit_decimals = true;
ds_put_byte (&tmp, 'e');
if (strchr ("eEdD", ss_first (i->input)))
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2007, 2009-2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2007, 2009-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
enum segmenter_mode mode;
struct string *outputs;
struct string input;
- size_t input_len;
size_t n_values;
char *file_name;
int line_number;
if (ds_is_empty (&input))
ds_put_byte (&input, '\n');
ds_put_byte (&input, '\0');
- input_len = ds_length (&input);
n_values = count_values (dummies);
outputs = xmalloc (n_values * sizeof *outputs);
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
else if (lex_match (lexer, T_LPAREN))
{
struct variable *v;
- size_t old_value_cnt;
int width;
if (!lex_force_id (lexer))
d = dataset_dict (ds);
}
- old_value_cnt = dict_get_next_value_idx (d);
v = dict_create_var (d, name, width);
if (v == NULL)
{
int
cmd_factor (struct lexer *lexer, struct dataset *ds)
{
- bool extraction_seen = false;
const struct dictionary *dict = dataset_dict (ds);
struct cmd_factor factor;
}
else if (lex_match_id (lexer, "EXTRACTION"))
{
- extraction_seen = true;
lex_match (lexer, T_EQUALS);
while (lex_token (lexer) != T_ENDCMD && lex_token (lexer) != T_SLASH)
{
/* PSPP - a program for statistical analysis.
- Copyright (C) 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011, 2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
quick_cluster_show_centers (struct Kmeans *kmeans, bool initial, const struct qc *qc)
{
struct tab_table *t;
- int nc, nr, heading_columns, currow;
+ int nc, nr, currow;
int i, j;
nc = qc->ngroups + 1;
nr = qc->n_vars + 4;
- heading_columns = 1;
t = tab_create (nc, nr);
tab_headers (t, 0, nc - 1, 0, 1);
currow = 0;
/* pspp - a program for statistical analysis.
- Copyright (C) 2007, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009, 2011, 2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
unsigned long int width)
{
unsigned long int node_start;
- int i;
if (width == 0 || old_start == new_start)
return;
assert (old_start + width - 1 >= old_start);
assert (new_start + width - 1 >= new_start);
- i = 0;
do
{
struct range_tower_node *node;
struct string_map *o, enum xr_output_type file_type)
{
enum { MIN_WIDTH = 3, MIN_LENGTH = 3 };
- struct output_driver *d;
struct xr_driver *xr;
cairo_surface_t *surface;
cairo_status_t status;
double width_pt, length_pt;
xr = xr_allocate (file_name, device_type, o);
- d = &xr->driver;
width_pt = (xr->width + xr->left_margin + xr->right_margin) / 1000.0;
length_pt = (xr->length + xr->top_margin + xr->bottom_margin) / 1000.0;
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2005, 2007, 2010, 2011 Free Software Foundation
+ Copyright (C) 2005, 2007, 2010, 2011, 2012 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class;
- GtkEntryClass *entry_class;
parent_class = g_type_class_peek_parent (klass);
widget_class = (GtkWidgetClass*) klass;
- entry_class = (GtkEntryClass*) klass;
widget_class->map = psppire_custom_entry_map;
widget_class->unmap = psppire_custom_entry_unmap;
PsppSheetViewColumn *column = NULL;
GtkCellRenderer *focus_cell = NULL;
gboolean row_double_click = FALSE;
- gboolean node_selected;
/* Empty tree? */
if (tree_view->priv->row_count == 0)
return TRUE;
/* select */
- node_selected = pspp_sheet_view_node_is_selected (tree_view, node);
pre_val = tree_view->priv->vadjustment->value;
path = _pspp_sheet_view_find_path (tree_view, node);
tree_view->priv->press_start_node = node;
if (tree_view->priv->rubber_banding_enable
- //&& !node_selected
&& (tree_view->priv->selection->type == PSPP_SHEET_SELECTION_MULTIPLE ||
tree_view->priv->selection->type == PSPP_SHEET_SELECTION_RECTANGLE))
{
gint new_y;
gint y_offset, cell_offset;
gint max_height;
- gint depth;
GdkRectangle background_area;
GdkRectangle cell_area;
guint flags;
gtk_tree_model_get_iter (tree_view->priv->model,
&iter,
path);
- depth = gtk_tree_path_get_depth (path);
gtk_tree_path_free (path);
cursor_path = NULL;
gint horizontal_separator;
gint vertical_separator;
gint focus_line_width;
- gboolean retval = FALSE;
gboolean draw_vgrid_lines, draw_hgrid_lines;
gint focus_pad;
gint grid_line_width;
}
if (tmp_width > column->requested_width)
- {
- retval = TRUE;
- column->requested_width = tmp_width;
- }
+ column->requested_width = tmp_width;
}
if (draw_hgrid_lines)
if (tree_view->priv->model)
{
gint i;
- GtkTreeModelFlags flags;
if (tree_view->priv->search_column == -1)
{
G_CALLBACK (pspp_sheet_view_rows_reordered),
tree_view);
- flags = gtk_tree_model_get_flags (tree_view->priv->model);
-
tree_view->priv->row_count = gtk_tree_model_iter_n_children (tree_view->priv->model, NULL);
/* FIXME: do I need to do this? pspp_sheet_view_create_buttons (tree_view); */
GdkRectangle background_area;
GdkRectangle expose_area;
GtkWidget *widget;
- gint depth;
/* start drawing inside the black outline */
gint x = 1, y = 1;
GdkDrawable *drawable;
if (!gtk_widget_get_realized (widget))
return NULL;
- depth = gtk_tree_path_get_depth (path);
-
_pspp_sheet_view_find_node (tree_view,
path,
&node);
PsppSheetViewSpecialCells special_cells)
{
PsppSheetViewPrivate *priv;
- GtkWidget *widget;
g_return_if_fail (PSPP_IS_SHEET_VIEW (tree_view));
priv = tree_view->priv;
- widget = GTK_WIDGET (tree_view);
if (priv->special_cells != special_cells)
{
{
PsppireDialogAction *act = PSPPIRE_DIALOG_ACTION (dar);
- gint response;
-
gtk_window_set_transient_for (GTK_WINDOW (dar->types_dialog),
GTK_WINDOW (act->dialog));
types_dialog_reset (dar);
- response = psppire_dialog_run (PSPPIRE_DIALOG (dar->types_dialog));
+ psppire_dialog_run (PSPPIRE_DIALOG (dar->types_dialog));
}
static void
{
PsppireDialogAction *act = PSPPIRE_DIALOG_ACTION (dar);
- gint response;
-
gtk_window_set_transient_for (GTK_WINDOW (dar->ties_dialog),
GTK_WINDOW (act->dialog));
- response = psppire_dialog_run (PSPPIRE_DIALOG (dar->ties_dialog));
+ psppire_dialog_run (PSPPIRE_DIALOG (dar->ties_dialog));
}
static void
static void
psppire_dialog_finalize (GObject *object)
{
- PsppireDialog *dialog ;
-
g_return_if_fail (object != NULL);
g_return_if_fail (PSPPIRE_IS_DIALOG (object));
- dialog = PSPPIRE_DIALOG (object);
-
if (G_OBJECT_CLASS (parent_class)->finalize)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
struct variable *var;
GtkTreeIter iter;
GtkTreeModel *model;
- PsppireDict *dict;
dv_get_base_model (top_model, top_iter, &model, &iter);
- dict = PSPPIRE_DICT (model);
-
gtk_tree_model_get (model,
&iter, DICT_TVM_COL_VAR, &var, -1);
{
const gchar *tip ;
GtkTreeModel *m;
- PsppireDict *dict;
dv_get_base_model (tree_model, NULL, &m, NULL);
- dict = PSPPIRE_DICT (m);
if ( PSPPIRE_DICT_VIEW (treeview)->prefer_labels )
tip = var_get_name (var);
GtkSelectionData *sd,
gpointer data)
{
- gchar *c;
PsppireSyntaxWindow *syntax_window = data;
if ( sd->length < 0 )
if ( sd->type != gdk_atom_intern ("UTF8_STRING", FALSE))
return;
- c = (gchar *) sd->data;
-
gtk_text_buffer_insert_at_cursor (GTK_TEXT_BUFFER (syntax_window->buffer),
(gchar *) sd->data,
sd->length);
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2010, 2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
delete[i] = insert[i];
for (i = 0; i < cnt; i++)
{
- int old_value, old_min, new_min;
- old_min = min_int (delete, cnt);
- old_value = delete[i];
elements[i].x = delete[i] = rand () % (cnt + 2) - 1;
- new_min = min_int (delete, cnt);
heap_changed (h, &elements[i].node);
check (heap_node_to_element (heap_minimum (h))->x
== min_int (delete, cnt));
if (action == INSERT)
{
int new_value;
- int old_min;
new_value = rand () % max_elems;
values[cnt] = new_value;
heap_insert (h, &elements[cnt].node);
- old_min = min_int (values, cnt);
-
cnt++;
}
else if (action == DELETE)
{
int del_idx;
- int del_value;
- int old_min, new_min;
-
- old_min = min_int (values, cnt);
del_idx = rand () % cnt;
- del_value = values[del_idx];
heap_delete (h, &elements[del_idx].node);
cnt--;
elements[del_idx] = elements[cnt];
heap_moved (h, &elements[del_idx].node);
}
-
- new_min = min_int (values, cnt);
}
else
abort ();