diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2010-06-09 14:41:24 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2010-06-09 14:41:24 +0000 |
commit | 96598c61f18a0bfdbf943b80510c1f8da01872fa (patch) | |
tree | 17e618d4875cc5a82ec81d1e5538e80b31c46df2 | |
parent | bc58b7d9841424edb0574294766d010946426853 (diff) |
text viewer: don't load font if it is the same font currently used.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26725 a1c6a512-1295-4272-9138-f99709370657
-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) const unsigned char *font_str; font_str = (oldp && !font_changing)? oldp->font_name : rb->global_settings->font_file; - font_changing = true; /* change font */ - if (rb->strcmp(font_str, prefs->font_name)) + if (font_changing || rb->strcmp(font_str, prefs->font_name)) { + font_changing = true; if (!tv_set_font(prefs->font_name)) { struct tv_preferences new_prefs = *prefs; rb->strlcpy(new_prefs.font_name, font_str, MAX_PATH); tv_set_preferences(&new_prefs); + return; } } - else if (!oldp || font_changing) - tv_set_font(font_str); + font_changing = false; /* calculates display lines */ tv_check_header_and_footer(); display_lines = tv_calc_display_lines(); - - /* if font_changing == false, the remaining processes need not be executed. */ - if (!font_changing) - return; - - font_changing = false; #else (void)oldp; |