summaryrefslogtreecommitdiff
path: root/apps/plugins/text_viewer/tv_window.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-06-09 14:41:24 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-06-09 14:41:24 +0000
commit96598c61f18a0bfdbf943b80510c1f8da01872fa (patch)
tree17e618d4875cc5a82ec81d1e5538e80b31c46df2 /apps/plugins/text_viewer/tv_window.c
parentbc58b7d9841424edb0574294766d010946426853 (diff)
downloadrockbox-96598c61f18a0bfdbf943b80510c1f8da01872fa.tar.gz
rockbox-96598c61f18a0bfdbf943b80510c1f8da01872fa.zip
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
Diffstat (limited to 'apps/plugins/text_viewer/tv_window.c')
-rw-r--r--apps/plugins/text_viewer/tv_window.c14
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