Commit ad7f27cdc31253ec8926f05ab9e830a4554ce78b

Authored by Perry Werneck
1 parent 7a361dd7

Fixing error when the selection format toggle is activated with an

active selection.
Showing 1 changed file with 7 additions and 5 deletions   Show diff stats
src/selection/selection.c
@@ -154,15 +154,17 @@ static void update_selected_region(H3270 *session) @@ -154,15 +154,17 @@ static void update_selected_region(H3270 *session)
154 154
155 } 155 }
156 156
157 -void toggle_rectselect(H3270 *session, const struct lib3270_toggle GNUC_UNUSED(*t), LIB3270_TOGGLE_TYPE GNUC_UNUSED(tt)) 157 +void toggle_rectselect(H3270 *hSession, const struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE GNUC_UNUSED(tt))
158 { 158 {
159 - if(!session->selected) 159 + if(!hSession->selected)
160 return; 160 return;
161 161
162 - if(t->value)  
163 - update_selected_rectangle(session); 162 + hSession->rectsel = (t->value != 0);
  163 +
  164 + if(hSession->rectsel)
  165 + update_selected_rectangle(hSession);
164 else 166 else
165 - update_selected_region(session); 167 + update_selected_region(hSession);
166 } 168 }
167 169
168 void do_select(H3270 *hSession, unsigned int start, unsigned int end, unsigned int rect) 170 void do_select(H3270 *hSession, unsigned int start, unsigned int end, unsigned int rect)