summaryrefslogtreecommitdiff
path: root/math/guppi/patches/patch-ac
blob: 31c8cbed3b1091e27b1f97a25a6b38bd9b73a711 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
$NetBSD: patch-ac,v 1.4 2005/12/06 16:12:43 joerg Exp $

--- libguppitank/guppi-object-barchart.c	2003-05-30 21:21:16.000000000 +0200
+++ libguppitank/guppi-object-barchart.c	2003-05-30 21:21:26.000000000 +0200
@@ -410,6 +410,7 @@ update (GuppiObject *obj) 
   GuppiElementState *left_axis_state = NULL;
   GuppiElementState *frame_state = NULL;
   GuppiColorPalette *color_palette = NULL;
+  GuppiColorPalette *color_palette_legend = NULL;
   GuppiDataTable *data_table;
   GnomeFont *font;
   
@@ -446,11 +447,13 @@ update (GuppiObject *obj) 
   /* FIXME: check for construction of legends. */
 
   if (obar->legend_view && obar->col_labels) {
-    add_col_labels (obar, data_table, obar->data_cols, obar->col_labels, FALSE);
+    add_col_labels (obar, data_table, obar->data_cols, obar->col_labels, 
+		    obar->legend_reversed);
   }
 
   if (obar->col_colors) {
     color_palette = build_bar_colors (obar, FALSE);
+    color_palette_legend = build_bar_colors (obar, obar->legend_reversed);
   }
   
   guppi_element_state_set (barchart_state,
@@ -497,7 +500,7 @@ update (GuppiObject *obj) 
 
     guppi_element_state_set (legend_state,
 			     "labels", data_table,
-			     "swatch_colors", color_palette,
+			     "swatch_colors", color_palette_legend,
 			     "label_font", font,
 			     NULL);
   }
@@ -505,6 +508,8 @@ update (GuppiObject *obj) 
  
   /* clean up */
   
+  guppi_unref (color_palette);
+  guppi_unref (color_palette_legend);
   guppi_unref (barchart_state);
   guppi_unref (legend_state);			   
   guppi_unref (bottom_axis_state);
@@ -525,6 +530,7 @@ build (GuppiObject *obj, double hsize, d
 
   GuppiDataTable *data_table;
   GuppiColorPalette *color_palette = NULL;
+  GuppiColorPalette *color_palette_legend = NULL;
 
   GuppiElementState *barchart_state;
   GuppiElementState *legend_state = NULL;
@@ -560,7 +566,8 @@ build (GuppiObject *obj, double hsize, d
   }
 
   if (obar->col_labels) {
-    add_col_labels (obar, data_table, obar->data_cols, obar->col_labels, FALSE);
+    add_col_labels (obar, data_table, obar->data_cols, obar->col_labels, 
+		    obar->legend_reversed);
   }
 
 
@@ -568,6 +575,7 @@ build (GuppiObject *obj, double hsize, d
 
   if (obar->col_colors) {
     color_palette = build_bar_colors (obar, FALSE);
+    color_palette_legend = build_bar_colors (obar, obar->legend_reversed);
   }
 
   barchart_state = guppi_element_state_new ("barchart",
@@ -620,7 +628,8 @@ build (GuppiObject *obj, double hsize, d
 
     legend_state = guppi_element_state_new ("legend",
 					    "labels", data_table,
-					    "swatch_colors", color_palette,
+					    "swatch_colors", 
+					    color_palette_legend,
 					    "label_font", font,
 					    NULL);
 
@@ -669,6 +678,8 @@ build (GuppiObject *obj, double hsize, d
   /* Clean up after ourselves... */
 
   guppi_unref (data_table);
+  guppi_unref (color_palette);
+  guppi_unref (color_palette_legend);
 
   guppi_unref (barchart_state);
   guppi_unref (bottom_axis_state);
@@ -701,6 +712,7 @@ clicked_bar_cb (GuppiCanvasItem *item,
     break;
 
   default:
+    break;
   }
 }
 
@@ -733,6 +745,7 @@ clicked_box_cb (GuppiCanvasItem *item,
     break;
 
   default:
+    break;
   }
 }