From 9c623c856ed7d3fa80ce357fad3def9900a28a1f Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 27 May 2008 08:56:38 +0000 Subject: [PATCH] (compute_metrics): Rewrite an "else { if () ... else ... }" into "else if () ... else ...". --- src/ChangeLog | 5 +++++ src/w32font.c | 30 ++++++++++++++---------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e9047f1a701..32b8b6bd368 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-05-27 Juanma Barranquero + + * w32font.c (compute_metrics): Rewrite an "else { if () ... else ... }" + into "else if () ... else ...". + 2008-05-27 Jason Rumney * w32font.c (w32font_open_internal): Determine if glyph indices diff --git a/src/w32font.c b/src/w32font.c index 413c103d6e4..1828af108ee 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -404,7 +404,7 @@ w32font_text_extents (font, code, nglyphs, metrics) 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 @@ w32_enumfont_pattern_entity (frame, logical_font, physical_font, /* 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 @@ fill_in_logfont (f, logfont, font_spec) 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 @@ list_all_matching_fonts (match_data) if (NILP (family)) continue; else if (SYMBOLP (family)) - name = SDATA (SYMBOL_NAME (family)); + name = SDATA (SYMBOL_NAME (family)); else continue; @@ -1851,7 +1851,8 @@ w32font_full_name (font, font_obj, pixel_size, name, nbytes) } -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 @@ static void compute_metrics (dc, w32_font, code, metrics) 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 -- 2.39.2