summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-05-27 23:08:28 -0700
committerLei Zhang <thestig@chromium.org>2016-05-27 23:08:28 -0700
commit8b3b3f59930eb29a80b3e83c0c724a50765b21f9 (patch)
treec90618b7b412d3877d3fa34ff8b23cf0ab5caf7a
parentdcc29b1f2eb66984a18d54e66851965472675006 (diff)
downloadpdfium-8b3b3f59930eb29a80b3e83c0c724a50765b21f9.tar.xz
Change IsGDIEnabled() to use a bool.
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/2017293002 .
-rw-r--r--core/fxge/win32/fx_win32_device.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index c5b32bdbfc..240fb30e9e 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -76,14 +76,13 @@ bool GetSubFontName(CFX_ByteString* name) {
return false;
}
-FX_BOOL IsGDIEnabled() {
+bool IsGDIEnabled() {
// If GDI is disabled then GetDC for the desktop will fail.
HDC hdc = ::GetDC(nullptr);
- if (hdc) {
- ::ReleaseDC(nullptr, hdc);
- return TRUE;
- }
- return FALSE;
+ if (!hdc)
+ return false;
+ ::ReleaseDC(nullptr, hdc);
+ return true;
}
HPEN CreatePen(const CFX_GraphStateData* pGraphState,
@@ -715,9 +714,8 @@ void CFX_GEModule::InitPlatform() {
ver.dwOSVersionInfoSize = sizeof(ver);
GetVersionEx(&ver);
pPlatformData->m_bHalfTone = ver.dwMajorVersion >= 5;
- if (IsGDIEnabled()) {
+ if (IsGDIEnabled())
pPlatformData->m_GdiplusExt.Load();
- }
m_pPlatformData = pPlatformData;
m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault(nullptr));
}