Commit 14d43a50 authored by Simon Budig's avatar Simon Budig Committed by Simon Budig

app/vectors/gimpbezierstroke.c shuffled some g_return*_if_fail around as

2005-12-23  Simon Budig  <simon@gimp.org>

	* app/vectors/gimpbezierstroke.c
	* app/vectors/gimpstroke.c: shuffled some g_return*_if_fail
	around as suggested by mitch.
parent ab1beb5e
2005-12-23 Simon Budig <simon@gimp.org>
* app/vectors/gimpbezierstroke.c
* app/vectors/gimpstroke.c: shuffled some g_return*_if_fail
around as suggested by mitch.
2005-12-21 Sven Neumann <sven@gimp.org>
* app/widgets/gimpfileprocview.c: removed icons from
......
......@@ -250,9 +250,6 @@ gimp_bezier_stroke_anchor_delete (GimpStroke *stroke,
/* Anchors always are surrounded by two handles that have to
* be deleted too */
g_return_if_fail (GIMP_IS_BEZIER_STROKE (stroke));
g_return_if_fail (anchor && anchor->type == GIMP_ANCHOR_ANCHOR);
list2 = g_list_find (stroke->anchors, anchor);
list = g_list_previous(list2);
......@@ -273,10 +270,6 @@ gimp_bezier_stroke_open (GimpStroke *stroke,
GList *list, *list2;
GimpStroke *new_stroke = NULL;
g_return_val_if_fail (GIMP_IS_BEZIER_STROKE (stroke), NULL);
g_return_val_if_fail (end_anchor &&
end_anchor->type == GIMP_ANCHOR_ANCHOR, NULL);
list = g_list_find (stroke->anchors, end_anchor);
g_return_val_if_fail (list != NULL && list->next != NULL, NULL);
......@@ -312,8 +305,6 @@ gimp_bezier_stroke_anchor_is_insertable (GimpStroke *stroke,
GimpAnchor *predec,
gdouble position)
{
g_return_val_if_fail (GIMP_IS_BEZIER_STROKE (stroke), FALSE);
return (g_list_find (stroke->anchors, predec) != NULL);
}
......@@ -328,9 +319,6 @@ gimp_bezier_stroke_anchor_insert (GimpStroke *stroke,
GimpCoords beziercoords[4];
gint i;
g_return_val_if_fail (GIMP_IS_BEZIER_STROKE (stroke), NULL);
g_return_val_if_fail (predec->type == GIMP_ANCHOR_ANCHOR, NULL);
segment_start = g_list_find (stroke->anchors, predec);
if (! segment_start)
......@@ -421,8 +409,6 @@ gimp_bezier_stroke_point_is_movable (GimpStroke *stroke,
GimpAnchor *predec,
gdouble position)
{
g_return_val_if_fail (GIMP_IS_BEZIER_STROKE (stroke), FALSE);
return (g_list_find (stroke->anchors, predec) != NULL);
}
......@@ -439,8 +425,6 @@ gimp_bezier_stroke_point_move_relative (GimpStroke *stroke,
gint i;
gdouble feel_good;
g_return_if_fail (GIMP_IS_BEZIER_STROKE (stroke));
segment_start = g_list_find (stroke->anchors, predec);
g_return_if_fail (segment_start != NULL);
......@@ -495,8 +479,6 @@ gimp_bezier_stroke_point_move_absolute (GimpStroke *stroke,
GList *segment_start, *list;
gint i;
g_return_if_fail (GIMP_IS_BEZIER_STROKE (stroke));
segment_start = g_list_find (stroke->anchors, predec);
g_return_if_fail (segment_start != NULL);
......@@ -531,8 +513,6 @@ gimp_bezier_stroke_close (GimpStroke *stroke)
GList *start, *end;
GimpAnchor *anchor;
g_return_if_fail (stroke->anchors != NULL);
start = g_list_first (stroke->anchors);
end = g_list_last (stroke->anchors);
......@@ -589,8 +569,6 @@ gimp_bezier_stroke_nearest_point_get (const GimpStroke *stroke,
GimpAnchor *anchor;
gint count;
g_return_val_if_fail (GIMP_IS_BEZIER_STROKE (stroke), -1.0);
if (!stroke->anchors)
return -1.0;
......@@ -816,8 +794,6 @@ gimp_bezier_stroke_nearest_tangent_get (const GimpStroke *stroke,
GimpAnchor *anchor;
gint count;
g_return_val_if_fail (GIMP_IS_BEZIER_STROKE (stroke), -1.0);
if (!stroke->anchors)
return -1.0;
......@@ -999,7 +975,6 @@ gimp_bezier_stroke_is_extendable (GimpStroke *stroke,
GList *listneighbor;
gint loose_end;
g_return_val_if_fail (GIMP_IS_BEZIER_STROKE (stroke), FALSE);
bezier_stroke = GIMP_BEZIER_STROKE (stroke);
if (stroke->closed)
......@@ -1090,11 +1065,8 @@ gimp_bezier_stroke_extend (GimpStroke *stroke,
GList *listneighbor;
gint loose_end, control_count;
g_return_val_if_fail (GIMP_IS_BEZIER_STROKE (stroke), NULL);
bezier_stroke = GIMP_BEZIER_STROKE (stroke);
g_return_val_if_fail (!stroke->closed, NULL);
if (stroke->anchors == NULL)
{
/* assure that there is no neighbor specified */
......@@ -1300,9 +1272,6 @@ gimp_bezier_stroke_connect_stroke (GimpStroke *stroke,
{
GList *list1, *list2;
g_return_val_if_fail (stroke->closed == FALSE &&
extension->closed == FALSE, FALSE);
list1 = g_list_find (stroke->anchors, anchor);
list1 = gimp_bezier_stroke_get_anchor_listitem (list1);
list2 = g_list_find (extension->anchors, neighbor);
......@@ -1481,8 +1450,6 @@ gimp_bezier_stroke_interpolate (const GimpStroke *stroke,
gint count;
gboolean need_endpoint = FALSE;
g_return_val_if_fail (GIMP_IS_BEZIER_STROKE (stroke), NULL);
if (!stroke->anchors)
{
if (ret_closed)
......
......@@ -457,8 +457,6 @@ gimp_stroke_real_anchor_get (const GimpStroke *stroke,
GList *list;
GimpAnchor *anchor = NULL;
g_return_val_if_fail (GIMP_IS_STROKE (stroke), NULL);
anchors = gimp_stroke_get_draw_controls (stroke);
for (list = anchors; list; list = g_list_next (list))
......@@ -510,8 +508,6 @@ gimp_stroke_real_anchor_get_next (const GimpStroke *stroke,
{
GList *list;
g_return_val_if_fail (GIMP_IS_STROKE (stroke), NULL);
if (prev)
{
list = g_list_find (stroke->anchors, prev);
......@@ -693,6 +689,7 @@ void
gimp_stroke_close (GimpStroke *stroke)
{
g_return_if_fail (GIMP_IS_STROKE (stroke));
g_return_if_fail (stroke->anchors != NULL);
GIMP_STROKE_GET_CLASS (stroke)->close (stroke);
}
......@@ -729,6 +726,7 @@ gimp_stroke_anchor_delete (GimpStroke *stroke,
GimpAnchor *anchor)
{
g_return_if_fail (GIMP_IS_STROKE (stroke));
g_return_if_fail (anchor && anchor->type == GIMP_ANCHOR_ANCHOR);
GIMP_STROKE_GET_CLASS (stroke)->anchor_delete (stroke, anchor);
}
......@@ -745,6 +743,8 @@ gimp_stroke_open (GimpStroke *stroke,
GimpAnchor *end_anchor)
{
g_return_val_if_fail (GIMP_IS_STROKE (stroke), NULL);
g_return_val_if_fail (end_anchor &&
end_anchor->type == GIMP_ANCHOR_ANCHOR, NULL);
return GIMP_STROKE_GET_CLASS (stroke)->open (stroke, end_anchor);
}
......@@ -785,6 +785,7 @@ gimp_stroke_anchor_insert (GimpStroke *stroke,
gdouble position)
{
g_return_val_if_fail (GIMP_IS_STROKE (stroke), NULL);
g_return_val_if_fail (predec->type == GIMP_ANCHOR_ANCHOR, NULL);
return GIMP_STROKE_GET_CLASS (stroke)->anchor_insert (stroke,
predec, position);
......@@ -825,6 +826,7 @@ gimp_stroke_extend (GimpStroke *stroke,
GimpVectorExtendMode extend_mode)
{
g_return_val_if_fail (GIMP_IS_STROKE (stroke), NULL);
g_return_val_if_fail (!stroke->closed, NULL);
return GIMP_STROKE_GET_CLASS (stroke)->extend (stroke, coords,
neighbor, extend_mode);
......@@ -848,6 +850,8 @@ gimp_stroke_connect_stroke (GimpStroke *stroke,
{
g_return_val_if_fail (GIMP_IS_STROKE (stroke), FALSE);
g_return_val_if_fail (GIMP_IS_STROKE (extension), FALSE);
g_return_val_if_fail (stroke->closed == FALSE &&
extension->closed == FALSE, FALSE);
return GIMP_STROKE_GET_CLASS (stroke)->connect_stroke (stroke, anchor,
extension, neighbor);
......@@ -896,8 +900,6 @@ gimp_stroke_real_get_length (const GimpStroke *stroke,
gdouble length;
GimpCoords difference;
g_return_val_if_fail (GIMP_IS_STROKE (stroke), -1);
if (!stroke->anchors)
return -1;
......@@ -1279,8 +1281,6 @@ gimp_stroke_real_get_point_at_dist (const GimpStroke *stroke,
gboolean ret = FALSE;
GimpCoords difference;
g_return_val_if_fail (GIMP_IS_STROKE (stroke), FALSE);
points = gimp_stroke_interpolate (stroke, precision, NULL);
if (points == NULL)
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment