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

Unified Diff: core/fxge/ge/cfx_font.cpp

Issue 2323793003: Refactor CPDF_Document (Closed)
Patch Set: Comments Created 4 years, 3 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 | « core/fpdfapi/fpdf_parser/include/cpdf_document.h ('k') | core/fxge/include/fx_font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/ge/cfx_font.cpp
diff --git a/core/fxge/ge/cfx_font.cpp b/core/fxge/ge/cfx_font.cpp
index 3d2e6d64991d04e5ceeebd941ed375ff59c48dd3..feea8b0aa152c710d79f1cb1e327e357170823eb 100644
--- a/core/fxge/ge/cfx_font.cpp
+++ b/core/fxge/ge/cfx_font.cpp
@@ -446,30 +446,27 @@ FX_BOOL CFX_Font::GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox) {
return TRUE;
}
-FX_BOOL CFX_Font::IsItalic() const {
+bool CFX_Font::IsItalic() const {
if (!m_Face)
- return FALSE;
+ return false;
- FX_BOOL ret = FXFT_Is_Face_Italic(m_Face) == FXFT_STYLE_FLAG_ITALIC;
- if (!ret) {
- CFX_ByteString str(FXFT_Get_Face_Style_Name(m_Face));
- str.MakeLower();
- if (str.Find("italic") != -1)
- ret = TRUE;
- }
- return ret;
+ if (FXFT_Is_Face_Italic(m_Face) == FXFT_STYLE_FLAG_ITALIC)
+ return true;
+ CFX_ByteString str(FXFT_Get_Face_Style_Name(m_Face));
+ str.MakeLower();
+ return str.Find("italic") != -1;
}
-FX_BOOL CFX_Font::IsBold() const {
+bool CFX_Font::IsBold() const {
if (!m_Face)
- return FALSE;
+ return false;
return FXFT_Is_Face_Bold(m_Face) == FXFT_STYLE_FLAG_BOLD;
}
-FX_BOOL CFX_Font::IsFixedWidth() const {
+bool CFX_Font::IsFixedWidth() const {
if (!m_Face)
- return FALSE;
- return FXFT_Is_Face_fixedwidth(m_Face);
+ return false;
+ return FXFT_Is_Face_fixedwidth(m_Face) != 0;
}
CFX_ByteString CFX_Font::GetPsName() const {
« no previous file with comments | « core/fpdfapi/fpdf_parser/include/cpdf_document.h ('k') | core/fxge/include/fx_font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698