app: don't gimp_display_get_image(NULL) in gimp_transform_tool_response()

This commit is contained in:
Michael Natterer 2013-05-29 19:41:54 +02:00
parent 279abd260b
commit e3ef19ec89
1 changed files with 9 additions and 8 deletions

View File

@ -1754,8 +1754,9 @@ gimp_transform_tool_response (GtkWidget *widget,
gint response_id, gint response_id,
GimpTransformTool *tr_tool) GimpTransformTool *tr_tool)
{ {
GimpTool *tool = GIMP_TOOL (tr_tool); GimpTool *tool = GIMP_TOOL (tr_tool);
gint i; GimpDisplay *display = tool->display;
gint i;
switch (response_id) switch (response_id)
{ {
@ -1783,7 +1784,7 @@ gimp_transform_tool_response (GtkWidget *widget,
} }
/* reget the selection bounds */ /* reget the selection bounds */
gimp_transform_tool_bounds (tr_tool, tool->display); gimp_transform_tool_bounds (tr_tool, display);
/* recalculate the tool's transformation matrix */ /* recalculate the tool's transformation matrix */
gimp_transform_tool_recalc_matrix (tr_tool); gimp_transform_tool_recalc_matrix (tr_tool);
@ -1791,19 +1792,19 @@ gimp_transform_tool_response (GtkWidget *widget,
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool)); gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
/* update the undo actions / menu items */ /* update the undo actions / menu items */
gimp_image_flush (gimp_display_get_image (tool->display)); gimp_image_flush (gimp_display_get_image (display));
break; break;
case GTK_RESPONSE_OK: case GTK_RESPONSE_OK:
g_return_if_fail (tool->display != NULL); g_return_if_fail (display != NULL);
gimp_transform_tool_transform (tr_tool, tool->display); gimp_transform_tool_transform (tr_tool, display);
break; break;
default: default:
gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, tool->display); gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
/* update the undo actions / menu items */ /* update the undo actions / menu items */
gimp_image_flush (gimp_display_get_image (tool->display)); gimp_image_flush (gimp_display_get_image (display));
break; break;
} }
} }