goffice r2039 - in trunk: . goffice/graph
- From: jbrefort svn gnome org
- To: svn-commits-list gnome org
- Subject: goffice r2039 - in trunk: . goffice/graph
- Date: Wed, 5 Mar 2008 16:05:31 +0000 (GMT)
Author: jbrefort
Date: Wed Mar 5 16:05:31 2008
New Revision: 2039
URL: http://svn.gnome.org/viewvc/goffice?rev=2039&view=rev
Log:
2008-03-05 Jean Brefort <jean brefort normalesup org>
* goffice/graph/gog-axis-line.c: (gog_axis_base_get_crossed_axis),
(gog_axis_base_get_clamped_position): do not draw axes when no axis
is defined.
* goffice/graph/gog-renderer.c: (gog_renderer_update): do not attempt
to render with negative width or height. Partially fixes #519788.
Modified:
trunk/ChangeLog
trunk/goffice/graph/gog-axis-line.c
trunk/goffice/graph/gog-renderer.c
Modified: trunk/goffice/graph/gog-axis-line.c
==============================================================================
--- trunk/goffice/graph/gog-axis-line.c (original)
+++ trunk/goffice/graph/gog-axis-line.c Wed Mar 5 16:05:31 2008
@@ -298,9 +298,11 @@
GogAxis *crossed_axis = NULL;
GSList *axes, *ptr;
gboolean found = FALSE;
+ GogAxisType axis_type = gog_axis_base_get_crossed_axis_type (axis_base);
- axes = gog_chart_get_axes (axis_base->chart,
- gog_axis_base_get_crossed_axis_type (axis_base));
+ if (axis_type == GOG_AXIS_UNKNOWN)
+ return NULL;
+ axes = gog_chart_get_axes (axis_base->chart, axis_type);
g_return_val_if_fail (axes != NULL, NULL);
for (ptr = axes; ptr != NULL && !found; ptr = ptr->next) {
@@ -379,6 +381,8 @@
double minimum, maximum;
cross_axis = gog_axis_base_get_crossed_axis (axis_base);
+ if (cross_axis == NULL)
+ return GOG_AXIS_AUTO;
cross_location = gog_axis_base_get_cross_location (axis_base);
if (gog_axis_get_bounds (cross_axis, &minimum, &maximum)) {
if (go_sub_epsilon (cross_location - minimum) <= 0.0)
Modified: trunk/goffice/graph/gog-renderer.c
==============================================================================
--- trunk/goffice/graph/gog-renderer.c (original)
+++ trunk/goffice/graph/gog-renderer.c Wed Mar 5 16:05:31 2008
@@ -1231,6 +1231,8 @@
gboolean redraw = TRUE;
gboolean size_changed;
+ if (w <= 0 || h <= 0)
+ return FALSE;
g_return_val_if_fail (IS_GOG_RENDERER (rend), FALSE);
g_return_val_if_fail (IS_GOG_VIEW (rend->view), FALSE);
@@ -1249,8 +1251,6 @@
rend->cairo_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, rend->w, rend->h);
}
- if (w == 0 || h == 0)
- return FALSE;
view = rend->view;
graph = GOG_GRAPH (view->model);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]