Mercurial > emacs
changeset 95341:5602389abb69
(compute_metrics): Rewrite an "else { if () ... else ... }"
into "else if () ... else ...".
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 27 May 2008 08:55:21 +0000 |
parents | c2e8bb750d17 |
children | c91624c7baa3 |
files | src/w32font.c |
diffstat | 1 files changed, 14 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/w32font.c Tue May 27 08:30:02 2008 +0000 +++ b/src/w32font.c Tue May 27 08:55:21 2008 +0000 @@ -404,7 +404,7 @@ font structure. Use selected_frame until the API is updated to pass in a frame. */ f = XFRAME (selected_frame); - + dc = get_frame_dc (f); old_font = SelectObject (dc, FONT_COMPAT (font)->hfont); } @@ -958,7 +958,7 @@ /* Foundry is difficult to get in readable form on Windows. But Emacs crashes if it is not set, so set it to something more - generic. These values make xflds compatible with Emacs 22. */ + generic. These values make xlfds compatible with Emacs 22. */ if (lf->lfOutPrecision == OUT_STRING_PRECIS) tem = Qraster; else if (lf->lfOutPrecision == OUT_STROKE_PRECIS) @@ -1511,7 +1511,7 @@ logfont->lfPitchAndFamily = family | DEFAULT_PITCH; } - + /* Set pitch based on the spacing property. */ tmp = AREF (font_spec, FONT_SPACING_INDEX); if (INTEGERP (tmp)) @@ -1595,7 +1595,7 @@ if (NILP (family)) continue; else if (SYMBOLP (family)) - name = SDATA (SYMBOL_NAME (family)); + name = SDATA (SYMBOL_NAME (family)); else continue; @@ -1851,7 +1851,8 @@ } -static void compute_metrics (dc, w32_font, code, metrics) +static void +compute_metrics (dc, w32_font, code, metrics) HDC dc; struct w32font_info *w32_font; unsigned int code; @@ -1876,19 +1877,16 @@ metrics->width = gm.gmCellIncX; metrics->status = W32METRIC_SUCCESS; } - else + else if (w32_font->glyph_idx) { - if (w32_font->glyph_idx) - { - /* Can't use glyph indexes after all. - Avoid it in future, and clear any metrics that were based on - glyph indexes. */ - w32_font->glyph_idx = 0; - clear_cached_metrics (w32_font); - } - else - metrics->status = W32METRIC_FAIL; + /* Can't use glyph indexes after all. + Avoid it in future, and clear any metrics that were based on + glyph indexes. */ + w32_font->glyph_idx = 0; + clear_cached_metrics (w32_font); } + else + metrics->status = W32METRIC_FAIL; } static void