Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1491)

Unified Diff: ui/base/l10n/l10n_util_win.cc

Issue 660173002: Type conversion fixes, ui/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/ime/remote_input_method_win.cc ('k') | ui/base/resource/data_pack.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/l10n/l10n_util_win.cc
diff --git a/ui/base/l10n/l10n_util_win.cc b/ui/base/l10n/l10n_util_win.cc
index c86b14a0c59f95a33c7c8b3b1b95caef0ecc5fa9..4e2f7f497735f2c1957cf1f0763c6d35f016af90 100644
--- a/ui/base/l10n/l10n_util_win.cc
+++ b/ui/base/l10n/l10n_util_win.cc
@@ -54,14 +54,13 @@ bool IsFontPresent(const wchar_t* font_name) {
HDC dc = GetDC(0);
HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(dc, hfont));
WCHAR actual_font_name[LF_FACESIZE];
- DWORD size_ret = GetTextFace(dc, LF_FACESIZE, actual_font_name);
- actual_font_name[LF_FACESIZE - 1] = 0;
+ int size_ret = GetTextFace(dc, LF_FACESIZE, actual_font_name);
SelectObject(dc, oldFont);
DeleteObject(hfont);
ReleaseDC(0, dc);
// We don't have to worry about East Asian fonts with locale-dependent
// names here.
- return wcscmp(font_name, actual_font_name) == 0;
+ return (size_ret != 0) && wcscmp(font_name, actual_font_name) == 0;
}
class OverrideLocaleHolder {
@@ -154,10 +153,10 @@ bool NeedOverrideDefaultUIFont(base::string16* override_font_family,
}
void AdjustUIFont(LOGFONT* logfont) {
- double dpi_scale = gfx::GetDPIScale();
+ float dpi_scale = gfx::GetDPIScale();
if (gfx::Display::HasForceDeviceScaleFactor()) {
// If the scale is forced, we don't need to adjust it here.
- dpi_scale = 1.0;
+ dpi_scale = 1.0f;
}
AdjustUIFontForDIP(dpi_scale, logfont);
}
« no previous file with comments | « ui/base/ime/remote_input_method_win.cc ('k') | ui/base/resource/data_pack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698