rem: else { struct struct_type_ope *type;  gtk_option_menu_set_history ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ), 0 );    if ( operation -> montant < 0 ) TYPE_DEFAUT_DEBIT = GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ) -> menu_item ), "no_type" )); else TYPE_DEFAUT_CREDIT = GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ) -> menu_item ), "no_type" ));    type = gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ) -> menu_item ), "adr_type" );  if ( type -> affiche_entree ) gtk_widget_show ( widget_formulaire_echeancier[SCHEDULER_FORM_CHEQUE] ); } } }    gtk_option_menu_set_history (  GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_EXERCICE] ), cherche_no_menu_exercice ( operation -> no_exercice, widget_formulaire_echeancier[SCHEDULER_FORM_EXERCICE] ));     liste_tmp = g_slist_find_custom ( liste_struct_imputation, GINT_TO_POINTER ( operation -> imputation ), ( GCompareFunc ) recherche_imputation_par_no );  if ( liste_tmp ) { GSList *liste_tmp_2;  entree_prend_focus ( widget_formulaire_echeancier[SCHEDULER_FORM_BUDGETARY]);  liste_tmp_2 = g_slist_find_custom ( (( struct struct_imputation * )( liste_tmp -> data )) -> liste_sous_imputation, GINT_TO_POINTER ( operation -> sous_imputation ), ( GCompareFunc ) recherche_sous_categorie_par_no ); if ( liste_tmp_2 ) gtk_combofix_set_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_BUDGETARY] ), g_strconcat ( (( struct struct_imputation * )( liste_tmp -> data )) -> nom_imputation, " : ", (( struct struct_sous_imputation * )( liste_tmp_2 -> data )) -> nom_sous_imputation, NULL )); else gtk_combofix_set_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_BUDGETARY] ), (( struct struct_imputation * )( liste_tmp -> data )) -> nom_imputation ); }     if ( operation -> notes ) { entree_prend_focus ( widget_formulaire_echeancier[SCHEDULER_FORM_NOTES] ); gtk_entry_set_text ( GTK_ENTRY ( widget_formulaire_echeancier[SCHEDULER_FORM_NOTES] ), operation -> notes );
add: else { p_tab_nom_de_compte_variable = p_tab_nom_de_compte + operation -> no_compte;  if ( operation -> montant < 0 ) place_type = cherche_no_menu_type_echeancier ( TYPE_DEFAUT_DEBIT ); else place_type = cherche_no_menu_type_echeancier ( TYPE_DEFAUT_CREDIT );  if ( place_type != -1 ) gtk_option_menu_set_history ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ), place_type ); else { struct struct_type_ope *type;  gtk_option_menu_set_history ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ), 0 );    if ( operation -> montant < 0 ) TYPE_DEFAUT_DEBIT = GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ) -> menu_item ), "no_type" )); else TYPE_DEFAUT_CREDIT = GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ) -> menu_item ), "no_type" ));    type = gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ) -> menu_item ), "adr_type" );  if ( type -> affiche_entree ) gtk_widget_show ( widget_formulaire_echeancier[SCHEDULER_FORM_CHEQUE] ); } } }    gtk_option_menu_set_history (  GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_EXERCICE] ), cherche_no_menu_exercice ( operation -> no_exercice, widget_formulaire_echeancier[SCHEDULER_FORM_EXERCICE] ));     liste_tmp = g_slist_find_custom ( liste_struct_imputation, GINT_TO_POINTER ( operation -> imputation ), ( GCompareFunc ) recherche_imputation_par_no );  if ( liste_tmp ) { GSList *liste_tmp_2;  entree_prend_focus ( widget_formulaire_echeancier[SCHEDULER_FORM_BUDGETARY]);  liste_tmp_2 = g_slist_find_custom ( (( struct struct_imputation * )( liste_tmp -> data )) -> liste_sous_imputation, GINT_TO_POINTER ( operation -> sous_imputation ), ( GCompareFunc ) recherche_sous_categorie_par_no ); if ( liste_tmp_2 ) gtk_combofix_set_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_BUDGETARY] ), g_strconcat ( (( struct struct_imputation * )( liste_tmp -> data )) -> nom_imputation, " : ", (( struct struct_sous_imputation * )( liste_tmp_2 -> data )) -> nom_sous_imputation, NULL )); else gtk_combofix_set_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_BUDGETARY] ), (( struct struct_imputation * )( liste_tmp -> data )) -> nom_imputation ); }     if ( operation -> notes ) { entree_prend_focus ( widget_formulaire_echeancier[SCHEDULER_FORM_NOTES] ); gtk_entry_set_text ( GTK_ENTRY ( widget_formulaire_echeancier[SCHEDULER_FORM_NOTES] ), operation -> notes );
context: void completion_operation_par_tiers_echeancier ( void ){  GSList *liste_tmp;  struct struct_tiers *tiers;  struct structure_operation *operation;  gint no_compte;  GSList *pointeur_ope;  /* s'il y a quelque chose dans les crdit ou dbit ou catgories, on se barre */  if ( gtk_widget_get_style ( widget_formulaire_echeancier[SCHEDULER_FORM_DEBIT] ) == style_entree_formulaire[ENCLAIR]       ||       gtk_widget_get_style ( widget_formulaire_echeancier[SCHEDULER_FORM_CREDIT] ) == style_entree_formulaire[ENCLAIR]       ||       gtk_widget_get_style ( GTK_COMBOFIX (widget_formulaire_echeancier[SCHEDULER_FORM_CATEGORY])->entry ) == style_entree_formulaire[ENCLAIR] )    return;  liste_tmp = g_slist_find_custom ( liste_struct_tiers,				    g_strstrip ( gtk_combofix_get_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_PARTY]))),				    ( GCompareFunc ) recherche_tiers_par_nom );  /*   si nouveau tiers,  on s'en va simplement */  if ( !liste_tmp )    return;  tiers = liste_tmp -> data;  /* on fait d'abord le tour du compte courant pour recherche une op avec ce tiers */  /* s'il n'y a aucune op correspondante, on fait le tour de tous les comptes */  no_compte = GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_ACCOUNT]  ) -> menu_item ),						      "no_compte" ) );  p_tab_nom_de_compte_variable = p_tab_nom_de_compte + no_compte;  operation = NULL;  pointeur_ope = LISTE_OPERATIONS;  while ( pointeur_ope )    {      struct structure_operation *ope_test;      ope_test = pointeur_ope -> data;      if ( ope_test -> tiers == tiers -> no_tiers )	{	  if ( operation )	    {	      if ( g_date_compare ( ope_test -> date,				    operation -> date ) >= 0 )		operation = ope_test;	    }	  else	    operation = ope_test;	}      pointeur_ope = pointeur_ope -> next;    }  if ( !operation )    {      /* aucune opration correspondant  ce tiers n'a t trouve dans le compte courant */      /*       on recherche dans les autres comptes, la premire trouve fera l'affaire */      gint i;      p_tab_nom_de_compte_variable = p_tab_nom_de_compte;      for ( i = 0 ; i < nb_comptes ; i++ )	{	  if ( i != no_compte )	    {	      pointeur_ope = LISTE_OPERATIONS;	      while ( pointeur_ope )		{		  struct structure_operation *ope_test;		  ope_test = pointeur_ope -> data;		  if ( ope_test -> tiers == tiers -> no_tiers )		    {		      operation = ope_test;		      pointeur_ope = NULL;		      i = nb_comptes;		    }		  else		    pointeur_ope = pointeur_ope -> next;		}	    }	  p_tab_nom_de_compte_variable++;	}    }  /* si on n'a trouv aucune opration, on se tire */  if ( !operation )    return;  /* remplit les diffrentes entres du formulaire */  /* remplit les montant */  if ( operation -> montant < 0 )    {      entree_prend_focus ( widget_formulaire_echeancier[SCHEDULER_FORM_DEBIT] );      gtk_entry_set_text ( GTK_ENTRY ( widget_formulaire_echeancier[SCHEDULER_FORM_DEBIT] ),			   g_strdup_printf ( "%4.2f",					     -operation -> montant ));      /* met le menu des types dbits */      if ( !etat.affiche_tous_les_types )	{	  GtkWidget *menu;	  if ( (menu = creation_menu_types ( 1,					     GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_ACCOUNT] ) -> menu_item ),										     "no_compte" )),					     1 )))	    {	      gtk_option_menu_set_menu ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ),					 menu );	      gtk_widget_show ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] );	    }	  else	    gtk_widget_hide ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] );	}    }  else    {      entree_prend_focus ( widget_formulaire_echeancier[SCHEDULER_FORM_CREDIT] );      gtk_entry_set_text ( GTK_ENTRY ( widget_formulaire_echeancier[SCHEDULER_FORM_CREDIT] ),			   g_strdup_printf ( "%4.2f",					     operation -> montant ));      /* met le menu des types crdits */      if ( !etat.affiche_tous_les_types )	{	  GtkWidget *menu;	  if ( (menu = creation_menu_types ( 2,					     GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_ACCOUNT] ) -> menu_item ),										     "no_compte" )),					     1 )))	    {	      gtk_option_menu_set_menu ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ),					 menu );	      gtk_widget_show ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] );	    }	  else	    gtk_widget_hide ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] );	}    }  /* met la devise */  gtk_option_menu_set_history ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_DEVISE] ),				g_slist_position ( liste_struct_devises,						   g_slist_find_custom ( liste_struct_devises,									 GINT_TO_POINTER ( operation -> devise ),									 ( GCompareFunc ) recherche_devise_par_no )));  /* mise en forme des catgories */  /* vrifie si c'est un virement */  if ( operation -> relation_no_operation )    {      /* c'est un virement, on l'affiche */      entree_prend_focus ( widget_formulaire_echeancier[SCHEDULER_FORM_CATEGORY]);      p_tab_nom_de_compte_variable = p_tab_nom_de_compte + operation -> relation_no_compte;      gtk_combofix_set_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_CATEGORY] ),			      g_strconcat ( COLON(_("Transfer")),					    NOM_DU_COMPTE,					    NULL ));    }  else    {      liste_tmp = g_slist_find_custom ( liste_struct_categories,					GINT_TO_POINTER ( operation -> categorie ),					( GCompareFunc ) recherche_categorie_par_no );      if ( liste_tmp )	{	  GSList *liste_tmp_2;	  entree_prend_focus ( widget_formulaire_echeancier[SCHEDULER_FORM_CATEGORY]);	  liste_tmp_2 = g_slist_find_custom ( (( struct struct_categ * )( liste_tmp -> data )) -> liste_sous_categ,					      GINT_TO_POINTER ( operation -> sous_categorie ),					      ( GCompareFunc ) recherche_sous_categorie_par_no );	  if ( liste_tmp_2 )	    gtk_combofix_set_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_CATEGORY] ),				    g_strconcat ( (( struct struct_categ * )( liste_tmp -> data )) -> nom_categ,						  " : ",						  (( struct struct_sous_categ * )( liste_tmp_2 -> data )) -> nom_sous_categ,						  NULL ));	  else	    gtk_combofix_set_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_CATEGORY] ),				    (( struct struct_categ * )( liste_tmp -> data )) -> nom_categ );      	}    }  /* met l'option menu du type d'op */  if ( GTK_WIDGET_VISIBLE ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ))    {      gint place_type;      place_type = cherche_no_menu_type_echeancier ( operation -> type_ope );      /*       si la place est trouve, on la met, sinon on met  la place par dfaut */      if ( place_type != -1 )	gtk_option_menu_set_history ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ),				      place_type );      else	{	  p_tab_nom_de_compte_variable = p_tab_nom_de_compte + operation -> no_compte;	  if ( operation -> montant < 0 )	    place_type = cherche_no_menu_type_echeancier ( TYPE_DEFAUT_DEBIT );	  else	      place_type = cherche_no_menu_type_echeancier ( TYPE_DEFAUT_CREDIT );	  if ( place_type != -1 )	    gtk_option_menu_set_history ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ),					  place_type );	  else	    {	      struct struct_type_ope *type;	      gtk_option_menu_set_history ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ),					    0 );	      /*  on met ce type par dfaut, vu que celui par dfaut marche plus ... */	      if ( operation -> montant < 0 )		TYPE_DEFAUT_DEBIT = GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ) -> menu_item ),						      "no_type" ));	      else		TYPE_DEFAUT_CREDIT = GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ) -> menu_item ),						      "no_type" ));	      /* rcupre l'adr du type pour afficher l'entre si ncessaire */	      type = gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ) -> menu_item ),					   "adr_type" );	      if ( type -> affiche_entree )		gtk_widget_show ( widget_formulaire_echeancier[SCHEDULER_FORM_CHEQUE] );	    }	}    }  /* met en place l'exercice */  gtk_option_menu_set_history (  GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_EXERCICE] ),				 cherche_no_menu_exercice ( operation -> no_exercice,							    widget_formulaire_echeancier[SCHEDULER_FORM_EXERCICE] ));  /* met en place l'imputation budgtaire */  liste_tmp = g_slist_find_custom ( liste_struct_imputation,				    GINT_TO_POINTER ( operation -> imputation ),				    ( GCompareFunc ) recherche_imputation_par_no );  if ( liste_tmp )    {      GSList *liste_tmp_2;      entree_prend_focus ( widget_formulaire_echeancier[SCHEDULER_FORM_BUDGETARY]);      liste_tmp_2 = g_slist_find_custom ( (( struct struct_imputation * )( liste_tmp -> data )) -> liste_sous_imputation,					  GINT_TO_POINTER ( operation -> sous_imputation ),					  ( GCompareFunc ) recherche_sous_categorie_par_no );      if ( liste_tmp_2 )	gtk_combofix_set_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_BUDGETARY] ),				g_strconcat ( (( struct struct_imputation * )( liste_tmp -> data )) -> nom_imputation,					      " : ",					      (( struct struct_sous_imputation * )( liste_tmp_2 -> data )) -> nom_sous_imputation,					      NULL ));      else	gtk_combofix_set_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_BUDGETARY] ),				(( struct struct_imputation * )( liste_tmp -> data )) -> nom_imputation );    }  /*   remplit les notes */  if ( operation -> notes )    {      entree_prend_focus ( widget_formulaire_echeancier[SCHEDULER_FORM_NOTES] );      gtk_entry_set_text ( GTK_ENTRY ( widget_formulaire_echeancier[SCHEDULER_FORM_NOTES] ),			   operation -> notes );    }}