Commit ad7f27cdc31253ec8926f05ab9e830a4554ce78b
1 parent
7a361dd7
Exists in
master
and in
3 other branches
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 | 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 | 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 | 166 | else |
165 | - update_selected_region(session); | |
167 | + update_selected_region(hSession); | |
166 | 168 | } |
167 | 169 | |
168 | 170 | void do_select(H3270 *hSession, unsigned int start, unsigned int end, unsigned int rect) | ... | ... |