diff options
| author | Juanma Barranquero | 2008-05-27 08:56:38 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2008-05-27 08:56:38 +0000 |
| commit | 9c623c856ed7d3fa80ce357fad3def9900a28a1f (patch) | |
| tree | c8d81b59d2adbbecaa1e651c2218360a045e7e70 | |
| parent | 943f2093bfdf3b7e8d8cbe2f6e67c03ff76ae8f8 (diff) | |
| download | emacs-9c623c856ed7d3fa80ce357fad3def9900a28a1f.tar.gz emacs-9c623c856ed7d3fa80ce357fad3def9900a28a1f.zip | |
(compute_metrics): Rewrite an "else { if () ... else ... }"
into "else if () ... else ...".
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2008-05-27 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * w32font.c (compute_metrics): Rewrite an "else { if () ... else ... }" | ||
| 4 | into "else if () ... else ...". | ||
| 5 | |||
| 1 | 2008-05-27 Jason Rumney <jasonr@gnu.org> | 6 | 2008-05-27 Jason Rumney <jasonr@gnu.org> |
| 2 | 7 | ||
| 3 | * w32font.c (w32font_open_internal): Determine if glyph indices | 8 | * 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) | |||
| 404 | font structure. Use selected_frame until the API | 404 | font structure. Use selected_frame until the API |
| 405 | is updated to pass in a frame. */ | 405 | is updated to pass in a frame. */ |
| 406 | f = XFRAME (selected_frame); | 406 | f = XFRAME (selected_frame); |
| 407 | 407 | ||
| 408 | dc = get_frame_dc (f); | 408 | dc = get_frame_dc (f); |
| 409 | old_font = SelectObject (dc, FONT_COMPAT (font)->hfont); | 409 | old_font = SelectObject (dc, FONT_COMPAT (font)->hfont); |
| 410 | } | 410 | } |
| @@ -958,7 +958,7 @@ w32_enumfont_pattern_entity (frame, logical_font, physical_font, | |||
| 958 | 958 | ||
| 959 | /* Foundry is difficult to get in readable form on Windows. | 959 | /* Foundry is difficult to get in readable form on Windows. |
| 960 | But Emacs crashes if it is not set, so set it to something more | 960 | But Emacs crashes if it is not set, so set it to something more |
| 961 | generic. These values make xflds compatible with Emacs 22. */ | 961 | generic. These values make xlfds compatible with Emacs 22. */ |
| 962 | if (lf->lfOutPrecision == OUT_STRING_PRECIS) | 962 | if (lf->lfOutPrecision == OUT_STRING_PRECIS) |
| 963 | tem = Qraster; | 963 | tem = Qraster; |
| 964 | else if (lf->lfOutPrecision == OUT_STROKE_PRECIS) | 964 | else if (lf->lfOutPrecision == OUT_STROKE_PRECIS) |
| @@ -1511,7 +1511,7 @@ fill_in_logfont (f, logfont, font_spec) | |||
| 1511 | logfont->lfPitchAndFamily = family | DEFAULT_PITCH; | 1511 | logfont->lfPitchAndFamily = family | DEFAULT_PITCH; |
| 1512 | } | 1512 | } |
| 1513 | 1513 | ||
| 1514 | 1514 | ||
| 1515 | /* Set pitch based on the spacing property. */ | 1515 | /* Set pitch based on the spacing property. */ |
| 1516 | tmp = AREF (font_spec, FONT_SPACING_INDEX); | 1516 | tmp = AREF (font_spec, FONT_SPACING_INDEX); |
| 1517 | if (INTEGERP (tmp)) | 1517 | if (INTEGERP (tmp)) |
| @@ -1595,7 +1595,7 @@ list_all_matching_fonts (match_data) | |||
| 1595 | if (NILP (family)) | 1595 | if (NILP (family)) |
| 1596 | continue; | 1596 | continue; |
| 1597 | else if (SYMBOLP (family)) | 1597 | else if (SYMBOLP (family)) |
| 1598 | name = SDATA (SYMBOL_NAME (family)); | 1598 | name = SDATA (SYMBOL_NAME (family)); |
| 1599 | else | 1599 | else |
| 1600 | continue; | 1600 | continue; |
| 1601 | 1601 | ||
| @@ -1851,7 +1851,8 @@ w32font_full_name (font, font_obj, pixel_size, name, nbytes) | |||
| 1851 | } | 1851 | } |
| 1852 | 1852 | ||
| 1853 | 1853 | ||
| 1854 | static void compute_metrics (dc, w32_font, code, metrics) | 1854 | static void |
| 1855 | compute_metrics (dc, w32_font, code, metrics) | ||
| 1855 | HDC dc; | 1856 | HDC dc; |
| 1856 | struct w32font_info *w32_font; | 1857 | struct w32font_info *w32_font; |
| 1857 | unsigned int code; | 1858 | unsigned int code; |
| @@ -1876,19 +1877,16 @@ static void compute_metrics (dc, w32_font, code, metrics) | |||
| 1876 | metrics->width = gm.gmCellIncX; | 1877 | metrics->width = gm.gmCellIncX; |
| 1877 | metrics->status = W32METRIC_SUCCESS; | 1878 | metrics->status = W32METRIC_SUCCESS; |
| 1878 | } | 1879 | } |
| 1879 | else | 1880 | else if (w32_font->glyph_idx) |
| 1880 | { | 1881 | { |
| 1881 | if (w32_font->glyph_idx) | 1882 | /* Can't use glyph indexes after all. |
| 1882 | { | 1883 | Avoid it in future, and clear any metrics that were based on |
| 1883 | /* Can't use glyph indexes after all. | 1884 | glyph indexes. */ |
| 1884 | Avoid it in future, and clear any metrics that were based on | 1885 | w32_font->glyph_idx = 0; |
| 1885 | glyph indexes. */ | 1886 | clear_cached_metrics (w32_font); |
| 1886 | w32_font->glyph_idx = 0; | ||
| 1887 | clear_cached_metrics (w32_font); | ||
| 1888 | } | ||
| 1889 | else | ||
| 1890 | metrics->status = W32METRIC_FAIL; | ||
| 1891 | } | 1887 | } |
| 1888 | else | ||
| 1889 | metrics->status = W32METRIC_FAIL; | ||
| 1892 | } | 1890 | } |
| 1893 | 1891 | ||
| 1894 | static void | 1892 | static void |