Merge branch 'rewrite-sheet' of ssh://jmd@git.sv.gnu.org/srv/git/pspp into rewrite...
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 1 Dec 2008 09:35:16 +0000 (18:35 +0900)
committerJohn Darrington <john@darrington.wattle.id.au>
Mon, 1 Dec 2008 09:35:16 +0000 (18:35 +0900)
Conflicts:

src/ui/gui/psppire-var-store.h

lib/gtksheet/gsheetmodel.c
lib/gtksheet/gsheetmodel.h
lib/gtksheet/gtksheet.c
lib/gtksheet/gtksheet.h
src/ui/gui/data-editor.c
src/ui/gui/data-editor.h
src/ui/gui/psppire-data-editor.c
src/ui/gui/psppire-data-store.c
src/ui/gui/psppire-data-store.h
src/ui/gui/psppire-var-store.c
src/ui/gui/psppire-var-store.h

index 88e4e603aca33e59409b1b45423654c628de3671..23aca590dccef5680ffcf741b22263f6b3a4438a 100644 (file)
@@ -415,27 +415,6 @@ g_sheet_model_get_justification (const GSheetModel *model,
                                                               row, column);
 }
 
-/**
- * g_sheet_model_get_font_desc:
- * @sheet_model: A #GSheetModel
- * @row: The row
- * @column: The column
- *
- * Returns the font description of the cell at @row, @column
- * Returns: the font description, or NULL on error.
- **/
-const PangoFontDescription *
-g_sheet_model_get_font_desc(const GSheetModel *model,
-                             glong row, glong column)
-{
-  g_return_val_if_fail (G_IS_SHEET_MODEL (model), NULL);
-  if ( ! G_SHEET_MODEL_GET_IFACE (model)->get_font_desc)
-    return NULL;
-
-  return G_SHEET_MODEL_GET_IFACE (model)->get_font_desc (model,
-                                                          row, column);
-}
-
 /**
  * g_sheet_model_get_cell_border:
  * @sheet_model: A #GSheetModel
index 510c92e9fcf5d3ae7a9a73051f4c2719e6848803..cd7f1d33596814fe9e8ec261eea1d5ef9afef156 100644 (file)
@@ -117,9 +117,6 @@ struct _GSheetModelIface
   const GtkJustification *  (* get_justification) (const GSheetModel *sheet_model,
                                                   glong row, glong column);
 
-  const PangoFontDescription *  (* get_font_desc) (const GSheetModel *sheet_model,
-                                                  glong row, glong column);
-
   const GtkSheetCellBorder *  (* get_cell_border) (const GSheetModel *sheet_model,
                                                   glong row, glong column);
 
@@ -189,14 +186,9 @@ GdkColor *g_sheet_model_get_foreground
 GdkColor *g_sheet_model_get_background
  (const GSheetModel *model, glong row, glong column);
 
-
 const GtkJustification *g_sheet_model_get_justification
  (const GSheetModel *model, glong row, glong column);
 
-
-const PangoFontDescription *g_sheet_model_get_font_desc
- (const GSheetModel *model, glong row, glong column);
-
 const GtkSheetCellBorder * g_sheet_model_get_cell_border
  (const GSheetModel *model, glong row, glong column);
 
index 010778c7eb2cf5d65d947f0c896d54355cdd2a91..3c1f32252a1eab199cf0dc3c23216baf9854f7e4 100644 (file)
@@ -86,6 +86,8 @@ enum
 #define DEFAULT_COLUMN_WIDTH 80
 #define DEFAULT_ROW_HEIGHT 25
 
+static void set_entry_widget_font (GtkSheet *sheet);
+
 static void gtk_sheet_update_primary_selection (GtkSheet *sheet);
 static void draw_column_title_buttons_range (GtkSheet *sheet, gint first, gint n);
 static void draw_row_title_buttons_range (GtkSheet *sheet, gint first, gint n);
@@ -392,6 +394,7 @@ static void gtk_sheet_map                    (GtkWidget *widget);
 static void gtk_sheet_unmap                     (GtkWidget *widget);
 static gint gtk_sheet_expose                    (GtkWidget *widget,
                                                  GdkEventExpose *event);
+
 static void gtk_sheet_forall                    (GtkContainer *container,
                                                  gboolean include_internals,
                                                  GtkCallback callback,
@@ -1707,6 +1710,7 @@ gtk_sheet_style_set (GtkWidget *widget,
       gtk_style_set_background (widget->style, widget->window, widget->state);
     }
 
+  set_entry_widget_font (sheet);
 }
 
 #define BORDER_WIDTH 2
@@ -2009,6 +2013,7 @@ gtk_sheet_cell_draw (GtkSheet *sheet, gint row, gint col)
 {
   PangoLayout *layout;
   PangoRectangle text;
+  PangoFontDescription *font_desc = GTK_WIDGET (sheet)->style->font_desc;
   gint font_height;
 
   gchar *label;
@@ -2058,15 +2063,16 @@ gtk_sheet_cell_draw (GtkSheet *sheet, gint row, gint col)
 
   layout = gtk_widget_create_pango_layout (GTK_WIDGET (sheet), label);
   dispose_string (sheet, label);
-  pango_layout_set_font_description (layout, attributes.font_desc);
 
 
+  pango_layout_set_font_description (layout, font_desc);
+
   pango_layout_get_pixel_extents (layout, NULL, &text);
 
   gdk_gc_set_clip_rectangle (sheet->fg_gc, &area);
 
-  font_height = pango_font_description_get_size (attributes.font_desc);
-  if ( !pango_font_description_get_size_is_absolute (attributes.font_desc))
+  font_height = pango_font_description_get_size (font_desc);
+  if ( !pango_font_description_get_size_is_absolute (font_desc))
     font_height /= PANGO_SCALE;
 
   /* Centre the text vertically */
@@ -4547,6 +4553,20 @@ gtk_sheet_size_allocate_entry (GtkSheet *sheet)
 }
 
 
+/* Copy the sheet's font to the entry widget */
+static void
+set_entry_widget_font (GtkSheet *sheet)
+{
+  GtkRcStyle *style = gtk_widget_get_modifier_style (sheet->entry_widget);
+
+  pango_font_description_free (style->font_desc);
+  style->font_desc = pango_font_description_copy (GTK_WIDGET (sheet)->style->font_desc);
+
+  gtk_widget_modify_style (sheet->entry_widget, style);
+}
+
+
+
 static void
 create_sheet_entry (GtkSheet *sheet)
 {
@@ -4584,6 +4604,8 @@ create_sheet_entry (GtkSheet *sheet)
                      G_CALLBACK (gtk_sheet_entry_changed),
                      sheet);
 
+  set_entry_widget_font (sheet);
+
   gtk_widget_show (sheet->entry_widget);
 }
 
@@ -5193,7 +5215,6 @@ gtk_sheet_get_attributes (const GtkSheet *sheet, gint row, gint col,
 {
   GdkColor *fg, *bg;
   const GtkJustification *j ;
-  const PangoFontDescription *font_desc ;
   const GtkSheetCellBorder *border ;
   GdkColormap *colormap;
 
@@ -5211,7 +5232,6 @@ gtk_sheet_get_attributes (const GtkSheet *sheet, gint row, gint col,
   attr->border.join_style = GDK_JOIN_MITER;
   attr->border.mask = 0;
   attr->border.color = GTK_WIDGET (sheet)->style->black;
-  attr->font_desc = GTK_WIDGET (sheet)->style->font_desc;
 
   attr->is_editable = g_sheet_model_is_editable (sheet->model, row, col);
 
@@ -5237,9 +5257,6 @@ gtk_sheet_get_attributes (const GtkSheet *sheet, gint row, gint col,
   if (j)
     attr->justification = *j;
 
-  font_desc = g_sheet_model_get_font_desc (sheet->model, row, col);
-  if ( font_desc ) attr->font_desc = font_desc;
-
   border = g_sheet_model_get_cell_border (sheet->model, row, col);
 
   if ( border ) attr->border = *border;
index 75e21c9827916104a4cf76d609c44e4ed3b8ef71..92c4248eff1c6fb42f6974db8103e6a30aa32a86 100644 (file)
@@ -62,7 +62,6 @@ typedef struct _GtkSheetHoverTitle GtkSheetHoverTitle;
 struct _GtkSheetCellAttr
 {
   GtkJustification justification;
-  const PangoFontDescription *font_desc;
   GdkColor foreground;
   GdkColor background;
   GtkSheetCellBorder border;
index d4cbae1e6716640ea5d2f85c878c91422c410e9f..13cc29a941f8be002bcbe10103fbddc590be04e6 100644 (file)
@@ -74,6 +74,9 @@ static void on_edit_paste (GtkAction *a, gpointer data);
 
 
 static GtkWidget * create_data_sheet_variable_popup_menu (struct data_editor *);
+
+static GtkWidget * create_var_sheet_variable_popup_menu (struct data_editor *);
+
 static GtkWidget * create_data_sheet_cases_popup_menu (struct data_editor *);
 
 static void register_data_editor_actions (struct data_editor *de);
@@ -933,17 +936,20 @@ new_data_editor (void)
   de->data_sheet_variable_popup_menu =
     GTK_MENU (create_data_sheet_variable_popup_menu (de));
 
+  de->var_sheet_variable_popup_menu =
+    GTK_MENU (create_var_sheet_variable_popup_menu (de));
+
   de->data_sheet_cases_popup_menu =
     GTK_MENU (create_data_sheet_cases_popup_menu (de));
 
 
   g_object_set (de->data_editor,
-               "column-menu", de->data_sheet_variable_popup_menu, NULL);
+               "datasheet-column-menu", de->data_sheet_variable_popup_menu,
+               "datasheet-row-menu", de->data_sheet_cases_popup_menu,
+               "varsheet-row-menu", de->var_sheet_variable_popup_menu,
+               NULL);
 
 
-  g_object_set (de->data_editor,
-               "row-menu", de->data_sheet_cases_popup_menu, NULL);
-
   return de;
 }
 
@@ -1038,9 +1044,19 @@ static void
 fonts_activate (GtkMenuItem *menuitem, gpointer data)
 {
   struct data_editor *de = data;
+  PangoFontDescription *current_font;
+  gchar *font_name;
   GtkWidget *dialog =
     gtk_font_selection_dialog_new (_("Font Selection"));
 
+
+  current_font = GTK_WIDGET(de->data_editor)->style->font_desc;
+  font_name = pango_font_description_to_string (current_font);
+
+  gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG (dialog), font_name);
+
+  g_free (font_name);
+
   gtk_window_set_transient_for (GTK_WINDOW (dialog),
                                GTK_WINDOW (get_widget_assert (de->xml,
                                                               "data_editor")));
@@ -1617,6 +1633,43 @@ create_data_sheet_cases_popup_menu (struct data_editor *de)
 }
 
 
+static GtkWidget *
+create_var_sheet_variable_popup_menu (struct data_editor *de)
+{
+  GtkWidget *menu = gtk_menu_new ();
+
+  GtkWidget *insert_variable =
+    gtk_menu_item_new_with_label (_("Insert Variable"));
+
+  GtkWidget *delete_variable =
+    gtk_menu_item_new_with_label (_("Clear"));
+
+
+  gtk_action_connect_proxy (de->delete_variables,
+                           delete_variable);
+
+
+  gtk_menu_shell_append (GTK_MENU_SHELL (menu), insert_variable);
+
+  g_signal_connect_swapped (G_OBJECT (insert_variable), "activate",
+                           G_CALLBACK (gtk_action_activate),
+                           de->insert_variable);
+
+
+  gtk_menu_shell_append (GTK_MENU_SHELL (menu),
+                        gtk_separator_menu_item_new ());
+
+
+  gtk_menu_shell_append (GTK_MENU_SHELL (menu), delete_variable);
+
+
+  gtk_widget_show_all (menu);
+
+  return menu;
+}
+
+
+
 \f
 
 static void
index 237b6769a896ecd4bb8580e3e2b7d0e43cf2e6bd..af282e26fb0f947e6896269c53183967d5be0ad2 100644 (file)
@@ -77,6 +77,8 @@ struct data_editor
   GtkMenu *data_sheet_variable_popup_menu;
   GtkMenu *data_sheet_cases_popup_menu;
 
+  GtkMenu *var_sheet_variable_popup_menu;
+
   PsppireDataEditor *data_editor;
 
   gboolean save_as_portable;
index 592e8aaa455c3ee9faa5d80039c71e334bd94d2d..ff96109d451ffd21e10582c82ea911beaf4e2acc 100644 (file)
@@ -109,8 +109,12 @@ psppire_data_editor_finalize (GObject *obj)
 
 
 
-static void popup_variable_menu (GtkSheet *sheet, gint column,
-                                GdkEventButton *event, gpointer data);
+static void popup_variable_column_menu (GtkSheet *sheet, gint column,
+                                       GdkEventButton *event, gpointer data);
+
+static void popup_variable_row_menu (GtkSheet *sheet, gint row,
+                                    GdkEventButton *event, gpointer data);
+
 
 static void popup_cases_menu (GtkSheet *sheet, gint row,
                              GdkEventButton *event, gpointer data);
@@ -118,6 +122,7 @@ static void popup_cases_menu (GtkSheet *sheet, gint row,
 
 
 
+
 /* Callback which occurs when the data sheet's column title
    is double clicked */
 static gboolean
@@ -193,8 +198,9 @@ enum
     PROP_0,
     PROP_DATA_STORE,
     PROP_VAR_STORE,
-    PROP_COLUMN_MENU,
-    PROP_ROW_MENU,
+    PROP_VS_ROW_MENU,
+    PROP_DS_COLUMN_MENU,
+    PROP_DS_ROW_MENU,
     PROP_VALUE_LABELS,
     PROP_CURRENT_CASE,
     PROP_CURRENT_VAR,
@@ -203,7 +209,6 @@ enum
   };
 
 
-#define WIDTH_OF_M 10
 #define DEFAULT_ROW_HEIGHT 25
 
 static void
@@ -252,12 +257,31 @@ new_variables_callback (PsppireDict *dict, gpointer data)
     }
 }
 
+/* Return the width (in pixels) of an upper case M when rendered in the
+   current font of W
+*/
+static gint
+width_of_m (GtkWidget *w)
+{
+  PangoRectangle rect;
+  PangoLayout *layout = gtk_widget_create_pango_layout (w, "M");
+
+  pango_layout_get_pixel_extents (layout, NULL, &rect);
+
+  g_object_unref (layout);
+
+  return rect.width;
+}
+
 static void
 insert_variable_callback (PsppireDict *dict, gint x, gpointer data)
 {
   gint i;
+
   PsppireDataEditor *de = PSPPIRE_DATA_EDITOR (data);
 
+  gint m_width  = width_of_m (GTK_WIDGET (de));
+
   PsppireAxisHetero *var_vaxis;
   g_object_get (de->var_sheet, "vertical-axis", &var_vaxis, NULL);
 
@@ -269,7 +293,7 @@ insert_variable_callback (PsppireDict *dict, gint x, gpointer data)
       PsppireAxisHetero *haxis;
       g_object_get (de->data_sheet[i], "horizontal-axis", &haxis, NULL);
 
-      psppire_axis_hetero_insert (haxis, WIDTH_OF_M * var_get_display_width (var), x);
+      psppire_axis_hetero_insert (haxis, m_width * var_get_display_width (var), x);
     }
 }
 
@@ -301,6 +325,7 @@ rewidth_variable_callback (PsppireDict *dict, gint posn, gpointer data)
 {
   gint i;
   PsppireDataEditor *de = PSPPIRE_DATA_EDITOR (data);
+  gint m_width = width_of_m (GTK_WIDGET (de));
 
   for (i = 0 ; i < 4 ; ++i)
     {
@@ -309,7 +334,7 @@ rewidth_variable_callback (PsppireDict *dict, gint posn, gpointer data)
       g_object_get (de->data_sheet[i], "horizontal-axis", &haxis, NULL);
 
       psppire_axis_hetero_resize_unit (haxis,
-                                      WIDTH_OF_M *
+                                      m_width *
                                       var_get_display_width (var), posn);
     }
 }
@@ -355,15 +380,23 @@ psppire_data_editor_set_property (GObject         *object,
                    "model", de->var_store,
                    NULL);
       break;
-    case PROP_COLUMN_MENU:
+    case PROP_VS_ROW_MENU:
+      {
+       GObject *menu = g_value_get_object (value);
+
+       g_signal_connect (de->var_sheet, "button-event-row",
+                         G_CALLBACK (popup_variable_row_menu), menu);
+      }
+      break;
+    case PROP_DS_COLUMN_MENU:
       {
        GObject *menu = g_value_get_object (value);
 
        g_signal_connect (de->data_sheet[0], "button-event-column",
-                         G_CALLBACK (popup_variable_menu), menu);
+                         G_CALLBACK (popup_variable_column_menu), menu);
       }
       break;
-    case PROP_ROW_MENU:
+    case PROP_DS_ROW_MENU:
       {
        GObject *menu = g_value_get_object (value);
 
@@ -463,7 +496,8 @@ psppire_data_editor_class_init (PsppireDataEditorClass *klass)
   GParamSpec *data_store_spec ;
   GParamSpec *var_store_spec ;
   GParamSpec *column_menu_spec;
-  GParamSpec *row_menu_spec;
+  GParamSpec *ds_row_menu_spec;
+  GParamSpec *vs_row_menu_spec;
   GParamSpec *value_labels_spec;
   GParamSpec *current_case_spec;
   GParamSpec *current_var_spec;
@@ -500,27 +534,40 @@ psppire_data_editor_class_init (PsppireDataEditorClass *klass)
                                    var_store_spec);
 
   column_menu_spec =
-    g_param_spec_object ("column-menu",
-                        "Column Menu",
-                        "A menu to be displayed when button 3 is pressed in the column title buttons",
+    g_param_spec_object ("datasheet-column-menu",
+                        "Data Sheet Column Menu",
+                        "A menu to be displayed when button 3 is pressed in thedata sheet's column title buttons",
                         GTK_TYPE_MENU,
                         G_PARAM_WRITABLE);
 
   g_object_class_install_property (object_class,
-                                   PROP_COLUMN_MENU,
+                                   PROP_DS_COLUMN_MENU,
                                    column_menu_spec);
 
 
-  row_menu_spec =
-    g_param_spec_object ("row-menu",
-                        "Row Menu",
-                        "A menu to be displayed when button 3 is pressed in the row title buttons",
+  ds_row_menu_spec =
+    g_param_spec_object ("datasheet-row-menu",
+                        "Data Sheet Row Menu",
+                        "A menu to be displayed when button 3 is pressed in the data sheet's row title buttons",
                         GTK_TYPE_MENU,
                         G_PARAM_WRITABLE);
 
   g_object_class_install_property (object_class,
-                                   PROP_ROW_MENU,
-                                   row_menu_spec);
+                                   PROP_DS_ROW_MENU,
+                                   ds_row_menu_spec);
+
+
+  vs_row_menu_spec =
+    g_param_spec_object ("varsheet-row-menu",
+                        "Variable Sheet Row Menu",
+                        "A menu to be displayed when button 3 is pressed in the variable sheet's row title buttons",
+                        GTK_TYPE_MENU,
+                        G_PARAM_WRITABLE);
+
+  g_object_class_install_property (object_class,
+                                   PROP_VS_ROW_MENU,
+                                   vs_row_menu_spec);
+
 
   value_labels_spec =
     g_param_spec_boolean ("value-labels",
@@ -1077,7 +1124,7 @@ psppire_data_editor_clip_cut (PsppireDataEditor *de)
 /* Popup menu related stuff */
 
 static void
-popup_variable_menu (GtkSheet *sheet, gint column,
+popup_variable_column_menu (GtkSheet *sheet, gint column,
                     GdkEventButton *event, gpointer data)
 {
   GtkMenu *menu = GTK_MENU (data);
@@ -1099,6 +1146,29 @@ popup_variable_menu (GtkSheet *sheet, gint column,
 }
 
 
+static void
+popup_variable_row_menu (GtkSheet *sheet, gint row,
+                    GdkEventButton *event, gpointer data)
+{
+  GtkMenu *menu = GTK_MENU (data);
+
+  PsppireVarStore *var_store =
+    PSPPIRE_VAR_STORE (gtk_sheet_get_model (sheet));
+
+  const struct variable *v =
+    psppire_dict_get_variable (var_store->dict, row);
+
+  if ( v && event->button == 3)
+    {
+      gtk_sheet_select_row (sheet, row);
+
+      gtk_menu_popup (menu,
+                     NULL, NULL, NULL, NULL,
+                     event->button, event->time);
+    }
+}
+
+
 static void
 popup_cases_menu (GtkSheet *sheet, gint row,
                  GdkEventButton *event, gpointer data)
@@ -1263,11 +1333,27 @@ psppire_data_editor_show_grid (PsppireDataEditor *de, gboolean grid_visible)
   gtk_sheet_show_grid (GTK_SHEET (de->data_sheet[0]), grid_visible);
 }
 
+
+static void
+set_font (GtkWidget *w, gpointer data)
+{
+  PangoFontDescription *font_desc = data;
+  GtkRcStyle *style = gtk_widget_get_modifier_style (w);
+
+  pango_font_description_free (style->font_desc);
+  style->font_desc = pango_font_description_copy (font_desc);
+
+  gtk_widget_modify_style (w, style);
+
+  if ( GTK_IS_CONTAINER (w))
+    gtk_container_foreach (GTK_CONTAINER (w), set_font, font_desc);
+}
+
 void
 psppire_data_editor_set_font (PsppireDataEditor *de, PangoFontDescription *font_desc)
 {
-  psppire_data_store_set_font (de->data_store, font_desc);
-  psppire_var_store_set_font (de->var_store, font_desc);
+  set_font (GTK_WIDGET (de), font_desc);
+  gtk_container_foreach (GTK_CONTAINER (de), set_font, font_desc);
 }
 
 
index 03e6e4c0121ad5605e5f58983e40c4bf0e1adb9b..f21dfbd68031156dbb2001cb40ffb97aad679cbb 100644 (file)
@@ -54,7 +54,7 @@ static gboolean psppire_data_store_clear_datum (GSheetModel *model,
 static GObjectClass *parent_class = NULL;
 
 
-enum  {FONT_CHANGED,
+enum  {
        BACKEND_CHANGED,
        n_SIGNALS};
 
@@ -113,17 +113,6 @@ psppire_data_store_class_init (PsppireDataStoreClass *class)
   object_class->finalize = psppire_data_store_finalize;
   object_class->dispose = psppire_data_store_dispose;
 
-  signals [FONT_CHANGED] =
-    g_signal_new ("font_changed",
-                 G_TYPE_FROM_CLASS (class),
-                 G_SIGNAL_RUN_FIRST,
-                 0,
-                 NULL, NULL,
-                 g_cclosure_marshal_VOID__VOID,
-                 G_TYPE_NONE,
-                 0);
-
-
   signals [BACKEND_CHANGED] =
     g_signal_new ("backend-changed",
                  G_TYPE_FROM_CLASS (class),
@@ -169,19 +158,9 @@ psppire_data_store_init (PsppireDataStore *data_store)
 {
   data_store->dict = 0;
   data_store->case_file = NULL;
-  data_store->width_of_m = 10;
   data_store->dispose_has_run = FALSE;
 }
 
-const PangoFontDescription *
-psppire_data_store_get_font_desc (const GSheetModel *model,
-                             glong row, glong column)
-{
-  PsppireDataStore *store = PSPPIRE_DATA_STORE (model);
-
-  return store->font_desc;
-}
-
 static inline gchar *
 psppire_data_store_get_string_wrapper (const GSheetModel *model, glong row,
                                       glong column)
@@ -220,7 +199,6 @@ psppire_data_store_sheet_model_init (GSheetModelIface *iface)
   iface->is_editable = NULL;
   iface->get_foreground = NULL;
   iface->get_background = NULL;
-  iface->get_font_desc = psppire_data_store_get_font_desc;
   iface->get_cell_border = NULL;
   iface->get_column_count = psppire_data_store_get_var_count;
   iface->get_row_count = psppire_data_store_get_case_count_wrapper;
@@ -695,24 +673,6 @@ psppire_data_store_set_string (PsppireDataStore *store,
 }
 
 
-void
-psppire_data_store_set_font (PsppireDataStore *store,
-                           const PangoFontDescription *fd)
-{
-  g_return_if_fail (store);
-  g_return_if_fail (PSPPIRE_IS_DATA_STORE (store));
-
-  store->font_desc = fd;
-#if 0
-  store->width_of_m = calc_m_width (fd);
-#endif
-  g_signal_emit (store, signals [FONT_CHANGED], 0);
-
-
-  g_sheet_model_range_changed (G_SHEET_MODEL (store),
-                                -1, -1, -1, -1);
-}
-
 
 void
 psppire_data_store_show_labels (PsppireDataStore *store, gboolean show_labels)
index 8f30afa448f6b4df49b4cb9248232933ecdf3614..1693a9ad0b9e138f213bec8af144eb65311ad92c 100644 (file)
@@ -83,10 +83,6 @@ struct _PsppireDataStore
   gboolean dispose_has_run ;
   PsppireDict *dict;
   PsppireCaseFile *case_file;
-  const PangoFontDescription *font_desc;
-
-  /* The width of an upper case 'M' rendered in the current font */
-  gint width_of_m ;
 
   gboolean show_labels;
 
@@ -118,9 +114,6 @@ void psppire_data_store_set_case_file (PsppireDataStore *data_store,
 void psppire_data_store_set_dictionary (PsppireDataStore *data_store,
                                        PsppireDict *dict);
 
-void psppire_data_store_set_font (PsppireDataStore *store,
-                                const PangoFontDescription *fd);
-
 void psppire_data_store_show_labels (PsppireDataStore *store,
                                    gboolean show_labels);
 
index 4465fa1dda4cab6aac70eee1f4bbbc5c9219911f..083bffad9e8be57a5a087ddbe973396c9a495a1c 100644 (file)
@@ -279,15 +279,6 @@ psppire_var_store_get_foreground (const GSheetModel *model, glong row, glong col
 }
 
 
-const PangoFontDescription *
-psppire_var_store_get_font_desc (const GSheetModel *model,
-                             glong row, glong column)
-{
-  PsppireVarStore *store = PSPPIRE_VAR_STORE (model);
-
-  return store->font_desc;
-}
-
 static gchar *get_column_title (const GSheetModel *model, gint col);
 static gchar *get_row_title (const GSheetModel *model, gint row);
 static gboolean get_row_sensitivity (const GSheetModel *model, gint row);
@@ -304,7 +295,6 @@ psppire_var_store_sheet_model_init (GSheetModelIface *iface)
   iface->is_editable = psppire_var_store_is_editable;
   iface->get_foreground = psppire_var_store_get_foreground;
   iface->get_background = NULL;
-  iface->get_font_desc = psppire_var_store_get_font_desc;
   iface->get_cell_border = NULL;
   iface->get_justification = NULL;
 
@@ -726,18 +716,6 @@ psppire_var_store_get_var_cnt (PsppireVarStore  *store)
 }
 
 
-void
-psppire_var_store_set_font (PsppireVarStore *store, const PangoFontDescription *fd)
-{
-  g_return_if_fail (store);
-  g_return_if_fail (PSPPIRE_IS_VAR_STORE (store));
-
-  store->font_desc = fd;
-
-  g_sheet_model_range_changed (G_SHEET_MODEL (store), -1, -1, -1, -1);
-}
-
-
 static glong
 psppire_var_store_get_row_count (const GSheetModel * model)
 {
index 7ef186a0a1b06067f22dbb6899866558a91ee97a..cf4375898f737fd782196c51cf7143cc8334b4d4 100644 (file)
@@ -65,7 +65,6 @@ struct _PsppireVarStore
   /*< private >*/
   PsppireDict *dict;
   GdkColor disabled;
-  const PangoFontDescription *font_desc;
   PsppireVarStoreFormatType format_type;
 };