diff options
Diffstat (limited to 'apps/plugins/text_viewer/tv_window.c')
-rw-r--r-- | apps/plugins/text_viewer/tv_window.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/apps/plugins/text_viewer/tv_window.c b/apps/plugins/text_viewer/tv_window.c index 36fbb9268c..1ffc921a85 100644 --- a/apps/plugins/text_viewer/tv_window.c +++ b/apps/plugins/text_viewer/tv_window.c | |||
@@ -282,31 +282,25 @@ static void tv_change_preferences(const struct tv_preferences *oldp) | |||
282 | const unsigned char *font_str; | 282 | const unsigned char *font_str; |
283 | 283 | ||
284 | font_str = (oldp && !font_changing)? oldp->font_name : rb->global_settings->font_file; | 284 | font_str = (oldp && !font_changing)? oldp->font_name : rb->global_settings->font_file; |
285 | font_changing = true; | ||
286 | 285 | ||
287 | /* change font */ | 286 | /* change font */ |
288 | if (rb->strcmp(font_str, prefs->font_name)) | 287 | if (font_changing || rb->strcmp(font_str, prefs->font_name)) |
289 | { | 288 | { |
289 | font_changing = true; | ||
290 | if (!tv_set_font(prefs->font_name)) | 290 | if (!tv_set_font(prefs->font_name)) |
291 | { | 291 | { |
292 | struct tv_preferences new_prefs = *prefs; | 292 | struct tv_preferences new_prefs = *prefs; |
293 | 293 | ||
294 | rb->strlcpy(new_prefs.font_name, font_str, MAX_PATH); | 294 | rb->strlcpy(new_prefs.font_name, font_str, MAX_PATH); |
295 | tv_set_preferences(&new_prefs); | 295 | tv_set_preferences(&new_prefs); |
296 | return; | ||
296 | } | 297 | } |
297 | } | 298 | } |
298 | else if (!oldp || font_changing) | 299 | font_changing = false; |
299 | tv_set_font(font_str); | ||
300 | 300 | ||
301 | /* calculates display lines */ | 301 | /* calculates display lines */ |
302 | tv_check_header_and_footer(); | 302 | tv_check_header_and_footer(); |
303 | display_lines = tv_calc_display_lines(); | 303 | display_lines = tv_calc_display_lines(); |
304 | |||
305 | /* if font_changing == false, the remaining processes need not be executed. */ | ||
306 | if (!font_changing) | ||
307 | return; | ||
308 | |||
309 | font_changing = false; | ||
310 | #else | 304 | #else |
311 | (void)oldp; | 305 | (void)oldp; |
312 | 306 | ||