From dd0e6e1eba14c76dedd4b4e55ab47406856c9a76 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 28 Sep 2017 11:51:24 -0400 Subject: Cleanup font defines This CL removes duplicate defines between XFA and core. Several OR'd values have been coverted into individual booleans to make the code clearer. Change-Id: Ic32a71c711cffd9a0cf1136e5a22f0502e085c39 Reviewed-on: https://pdfium-review.googlesource.com/15071 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fgas/font/cfgas_defaultfontmanager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'xfa/fgas/font/cfgas_defaultfontmanager.cpp') diff --git a/xfa/fgas/font/cfgas_defaultfontmanager.cpp b/xfa/fgas/font/cfgas_defaultfontmanager.cpp index 6f39797927..322d06b384 100644 --- a/xfa/fgas/font/cfgas_defaultfontmanager.cpp +++ b/xfa/fgas/font/cfgas_defaultfontmanager.cpp @@ -24,10 +24,11 @@ RetainPtr CFGAS_DefaultFontManager::GetFont( FGAS_FontInfoByFontName(wsFontName.AsStringView()); if (pCurFont && pCurFont->pReplaceFont) { uint32_t dwStyle = 0; - if (dwFontStyles & FX_FONTSTYLE_Bold) - dwStyle |= FX_FONTSTYLE_Bold; - if (dwFontStyles & FX_FONTSTYLE_Italic) - dwStyle |= FX_FONTSTYLE_Italic; + // TODO(dsinclair): Why doesn't this check the other flags? + if (dwFontStyles & FXFONT_BOLD) + dwStyle |= FXFONT_BOLD; + if (dwFontStyles & FXFONT_ITALIC) + dwStyle |= FXFONT_ITALIC; const wchar_t* pReplace = pCurFont->pReplaceFont; int32_t iLength = wcslen(pReplace); -- cgit v1.2.3