[goffice] Really fixes #152675
- From: Jean Bréfort <jbrefort src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [goffice] Really fixes #152675
- Date: Wed, 28 Oct 2009 09:49:51 +0000 (UTC)
commit 192995c6d0bf00b657df87c33c380ef83e0cd673
Author: Jean Brefort <jean brefort normalesup org>
Date: Wed Oct 28 10:50:07 2009 +0100
Really fixes #152675
ChangeLog | 7 +++++++
NEWS | 2 ++
goffice/graph/gog-chart.c | 41 +++++++++++++++++++++++------------------
goffice/graph/gog-graph.c | 23 +++++++++++++++++++++--
4 files changed, 53 insertions(+), 20 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f02173b..41bca23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-10-28 Jean Brefort <jean brefort normalesup org>
+
+ * goffice/graph/gog-chart.c (gog_chart_view_render): reapply patch for
+ #152675 and ensure titles are rendered last.
+ * goffice/graph/gog-graph.c (gog_graph_class_init),
+ (gog_graph_view_render), (gog_graph_view_class_init): ditto.
+
2009-10-27 Morten Welinder <terra gnome org>
* goffice/app/file.c (go_file_saver_for_mime_type): Ignore file
diff --git a/NEWS b/NEWS
index 046a8ae..52e15d0 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ Jean:
* Fix bounds update of GocItem. [#598091]
* Prepare for GSEAL_ENABLE.
* Display coordinates when moving the mouseover a graph. [#382666]
+ * Make titles the first logical child and ensure they are rendered last.
+ Really fixes #152675.
Morten:
* Canvas improvements for arrows.
diff --git a/goffice/graph/gog-chart.c b/goffice/graph/gog-chart.c
index a2cfad2..7e264ac 100644
--- a/goffice/graph/gog-chart.c
+++ b/goffice/graph/gog-chart.c
@@ -401,42 +401,42 @@ static gboolean role_3d_box_can_add (GogObject const *parent) {return FALSE;}
static gboolean role_3d_box_can_remove (GogObject const *parent) {return FALSE;}
static GogObjectRole const roles[] = {
- { N_("Backplane"), "GogGrid", 0,
+ { N_("Backplane"), "GogGrid", 1,
GOG_POSITION_SPECIAL, GOG_POSITION_SPECIAL, GOG_OBJECT_NAME_BY_ROLE,
role_grid_can_add, NULL, NULL, role_grid_post_add, role_grid_pre_remove, NULL, { -1 } },
- { N_("XY-Backplane"), "GogGrid", 0,
+ { N_("XY-Backplane"), "GogGrid", 1,
GOG_POSITION_SPECIAL, GOG_POSITION_SPECIAL, GOG_OBJECT_NAME_BY_ROLE,
xy_grid_3d_can_add, NULL, NULL, xy_grid_3d_post_add, NULL, NULL,
{ GOG_GRID_XY } },
- { N_("YZ-Backplane"), "GogGrid", 0,
+ { N_("YZ-Backplane"), "GogGrid", 1,
GOG_POSITION_SPECIAL, GOG_POSITION_SPECIAL, GOG_OBJECT_NAME_BY_ROLE,
yz_grid_3d_can_add, NULL, NULL, yz_grid_3d_post_add, NULL, NULL,
{ GOG_GRID_YZ } },
- { N_("ZX-Backplane"), "GogGrid", 0,
+ { N_("ZX-Backplane"), "GogGrid", 1,
GOG_POSITION_SPECIAL, GOG_POSITION_SPECIAL, GOG_OBJECT_NAME_BY_ROLE,
zx_grid_3d_can_add, NULL, NULL, zx_grid_3d_post_add, NULL, NULL,
{ GOG_GRID_ZX } },
- { N_("X-Axis"), "GogAxis", 1,
+ { N_("X-Axis"), "GogAxis", 2,
GOG_POSITION_PADDING, GOG_POSITION_PADDING, GOG_OBJECT_NAME_BY_ROLE,
x_axis_can_add, axis_can_remove, NULL, x_axis_post_add, axis_pre_remove, NULL,
{ GOG_AXIS_X } },
- { N_("Y-Axis"), "GogAxis", 2,
+ { N_("Y-Axis"), "GogAxis", 3,
GOG_POSITION_PADDING, GOG_POSITION_PADDING, GOG_OBJECT_NAME_BY_ROLE,
y_axis_can_add, axis_can_remove, NULL, y_axis_post_add, axis_pre_remove, NULL,
{ GOG_AXIS_Y } },
- { N_("Z-Axis"), "GogAxis", 3,
+ { N_("Z-Axis"), "GogAxis", 4,
GOG_POSITION_PADDING, GOG_POSITION_PADDING, GOG_OBJECT_NAME_BY_ROLE,
z_axis_can_add, axis_can_remove, NULL, z_axis_post_add, axis_pre_remove, NULL,
{ GOG_AXIS_Z } },
- { N_("Circular-Axis"), "GogAxis", 1,
+ { N_("Circular-Axis"), "GogAxis", 2,
GOG_POSITION_PADDING, GOG_POSITION_PADDING, GOG_OBJECT_NAME_BY_ROLE,
circular_axis_can_add, axis_can_remove, NULL, circular_axis_post_add, axis_pre_remove, NULL,
{ GOG_AXIS_CIRCULAR } },
- { N_("Radial-Axis"), "GogAxis", 2,
+ { N_("Radial-Axis"), "GogAxis", 3,
GOG_POSITION_PADDING, GOG_POSITION_PADDING, GOG_OBJECT_NAME_BY_ROLE,
radial_axis_can_add, axis_can_remove, NULL, radial_axis_post_add, axis_pre_remove, NULL,
{ GOG_AXIS_RADIAL } },
- { N_("Pseudo-3D-Axis"), "GogAxis", 3,
+ { N_("Pseudo-3D-Axis"), "GogAxis", 4,
GOG_POSITION_SPECIAL, GOG_POSITION_SPECIAL, GOG_OBJECT_NAME_BY_ROLE,
pseudo_3d_axis_can_add, axis_can_remove, NULL, pseudo_3d_axis_post_add, axis_pre_remove, NULL,
{ GOG_AXIS_PSEUDO_3D } },
@@ -444,14 +444,14 @@ static GogObjectRole const roles[] = {
GOG_POSITION_SPECIAL, GOG_POSITION_SPECIAL, GOG_OBJECT_NAME_BY_ROLE,
bubble_axis_can_add, axis_can_remove, NULL, bubble_axis_post_add, axis_pre_remove, NULL,
{ GOG_AXIS_BUBBLE } },
- { N_("Color-Axis"), "GogAxis", 5,
+ { N_("Color-Axis"), "GogAxis", 4,
GOG_POSITION_SPECIAL, GOG_POSITION_SPECIAL, GOG_OBJECT_NAME_BY_ROLE,
color_axis_can_add, axis_can_remove, NULL, color_axis_post_add, axis_pre_remove, NULL,
{ GOG_AXIS_COLOR } },
{ N_("Plot"), "GogPlot", 6, /* keep the axis before the plots */
GOG_POSITION_SPECIAL, GOG_POSITION_SPECIAL, GOG_OBJECT_NAME_BY_TYPE,
role_plot_can_add, NULL, NULL, role_plot_post_add, role_plot_pre_remove, NULL, { -1 } },
- { N_("Title"), "GogLabel", 10,
+ { N_("Title"), "GogLabel", 0,
GOG_POSITION_COMPASS|GOG_POSITION_ANY_MANUAL,
GOG_POSITION_N|GOG_POSITION_ALIGN_CENTER,
GOG_OBJECT_NAME_BY_ROLE,
@@ -468,7 +468,7 @@ static GogObjectRole const roles[] = {
GOG_OBJECT_NAME_BY_ROLE,
NULL, NULL, NULL, NULL, NULL, NULL, { -1 } },
#endif
- { N_("3D-Box"), "Gog3DBox", 0,
+ { N_("3D-Box"), "Gog3DBox", 1,
GOG_POSITION_SPECIAL, GOG_POSITION_SPECIAL, GOG_OBJECT_NAME_BY_ROLE,
role_3d_box_can_add, role_3d_box_can_remove, NULL, NULL, NULL, NULL, { -1 } }
};
@@ -1155,7 +1155,7 @@ gog_chart_view_render (GogView *view, GogViewAllocation const *bbox)
if (gog_chart_is_3d (chart)) {
for (ptr = view->children ; ptr != NULL ; ptr = ptr->next) {
child_view = ptr->data;
- if (!GOG_IS_AXIS (child_view->model) && !GOG_IS_PLOT (child_view->model))
+ if (!GOG_IS_AXIS (child_view->model) && !GOG_IS_PLOT (child_view->model) && !GOG_IS_LABEL (child_view->model))
gog_view_render (ptr->data, bbox);
}
/* now render plot and axes */
@@ -1168,10 +1168,9 @@ gog_chart_view_render (GogView *view, GogViewAllocation const *bbox)
}
for (ptr = view->children ; ptr != NULL ; ptr = ptr->next) {
child_view = ptr->data;
- if (GOG_IS_AXIS (child_view->model))
+ if (!GOG_IS_PLOT (child_view->model))
continue;
- if (GOG_IS_PLOT (child_view->model))
- gog_view_render (ptr->data, bbox);
+ gog_view_render (ptr->data, bbox);
}
} else {
/* KLUDGE: render grid lines before axis */
@@ -1185,10 +1184,16 @@ gog_chart_view_render (GogView *view, GogViewAllocation const *bbox)
if (GOG_IS_PLOT (child_view->model)) {
if (!GOG_PLOT (child_view->model)->render_before_axes)
gog_view_render (ptr->data, bbox);
- } else
+ } else if (!GOG_IS_LABEL (child_view->model))
gog_view_render (ptr->data, bbox);
}
}
+ for (ptr = view->children ; ptr != NULL ; ptr = ptr->next) {
+ child_view = ptr->data;
+ if (!GOG_IS_LABEL (child_view->model))
+ continue;
+ gog_view_render (ptr->data, bbox);
+ }
}
static void
diff --git a/goffice/graph/gog-graph.c b/goffice/graph/gog-graph.c
index 67bfb91..d090159 100644
--- a/goffice/graph/gog-graph.c
+++ b/goffice/graph/gog-graph.c
@@ -278,12 +278,12 @@ gog_graph_class_init (GogGraphClass *klass)
GogObjectClass *gog_klass = (GogObjectClass *) klass;
static GogObjectRole const roles[] = {
- { N_("Chart"), "GogChart", 0,
+ { N_("Chart"), "GogChart", 1,
GOG_POSITION_SPECIAL|GOG_POSITION_ANY_MANUAL,
GOG_POSITION_SPECIAL,
GOG_OBJECT_NAME_BY_ROLE,
NULL, NULL, NULL, role_chart_post_add, role_chart_pre_remove, NULL },
- { N_("Title"), "GogLabel", 1,
+ { N_("Title"), "GogLabel", 0,
GOG_POSITION_COMPASS|GOG_POSITION_ANY_MANUAL,
GOG_POSITION_N|GOG_POSITION_ALIGN_CENTER,
GOG_OBJECT_NAME_BY_ROLE,
@@ -829,9 +829,26 @@ static void
gog_graph_view_render (GogView *view, GogViewAllocation const *bbox)
{
GogGraphView *gview = GOG_GRAPH_VIEW (view);
+ GSList *ptr;
+ GogView *child_view;
gview_parent_klass->render (view, bbox);
+ /* render everything except labels */
+ for (ptr = view->children ; ptr != NULL ; ptr = ptr->next) {
+ child_view = ptr->data;
+ if (GOG_IS_LABEL (child_view->model))
+ continue;
+ gog_view_render (ptr->data, bbox);
+ }
+ /* render labels */
+ for (ptr = view->children ; ptr != NULL ; ptr = ptr->next) {
+ child_view = ptr->data;
+ if (!GOG_IS_LABEL (child_view->model))
+ continue;
+ gog_view_render (ptr->data, bbox);
+ }
+
if (gview->selected_view != NULL)
gog_view_render_toolkit (gview->selected_view);
}
@@ -854,6 +871,7 @@ gog_graph_view_class_init (GogGraphViewClass *gview_klass)
{
GogViewClass *view_klass = (GogViewClass *) gview_klass;
GObjectClass *gobject_klass = (GObjectClass *) view_klass;
+ GogOutlinedViewClass *oview_klass = (GogOutlinedViewClass *) gview_klass;
gview_parent_klass = g_type_class_peek_parent (gview_klass);
gobject_klass->set_property = gog_graph_view_set_property;
@@ -862,6 +880,7 @@ gog_graph_view_class_init (GogGraphViewClass *gview_klass)
view_klass->render = gog_graph_view_render;
view_klass->size_allocate = gog_graph_view_size_allocate;
view_klass->clip = TRUE;
+ oview_klass->call_parent_render = FALSE;
g_object_class_install_property (gobject_klass, GRAPH_VIEW_PROP_RENDERER,
g_param_spec_object ("renderer",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]