[libchamplain] Fix an invalid cast if a view is passed a ChamplainLayer instead of a ChamplainSelectionLayer
- From: Jiří Techet <jiritechet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain] Fix an invalid cast if a view is passed a ChamplainLayer instead of a ChamplainSelectionLayer
- Date: Tue, 11 May 2010 23:23:42 +0000 (UTC)
commit d9765e75b009172d86f7d1c96df21fc5f075d03a
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date: Tue May 11 21:59:49 2010 +0200
Fix an invalid cast if a view is passed a ChamplainLayer instead of a ChamplainSelectionLayer
button_release_cb can't assume that all objects in the layer group are
selection layers. Normal layers are also allowed.
champlain/champlain-view.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 2256acb..18ef0e5 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -1193,12 +1193,16 @@ button_release_cb (ClutterActor *actor,
for (i = 0; i < clutter_group_get_n_children (CLUTTER_GROUP (priv->user_layers)); i++)
{
- ChamplainSelectionLayer *layer = CHAMPLAIN_SELECTION_LAYER (clutter_group_get_nth_child (CLUTTER_GROUP (priv->user_layers), i));
+ ClutterActor *actor = CLUTTER_ACTOR (clutter_group_get_nth_child (CLUTTER_GROUP (priv->user_layers), i));
- if (layer && champlain_selection_layer_count_selected_markers (layer ) > 0)
+ if (actor && CHAMPLAIN_IS_SELECTION_LAYER (actor))
{
- champlain_selection_layer_unselect_all (layer);
- found = TRUE;
+ ChamplainSelectionLayer *layer = CHAMPLAIN_SELECTION_LAYER (actor);
+ if (champlain_selection_layer_count_selected_markers (layer) > 0)
+ {
+ champlain_selection_layer_unselect_all (layer);
+ found = TRUE;
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]