From ea5c4d3929928b318b339231804580d93a6e5f21 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 2 Oct 2015 12:28:32 -0700 Subject: Merge to XFA: Turn a couple functions that always return true to return void. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1386463003 . (cherry picked from commit dcfa0ba2928072c962fe8835d1a2ccd309eafbbd) Review URL: https://codereview.chromium.org/1379093003 . --- core/include/fxge/fx_font.h | 15 +++++++-------- core/src/fpdftext/fpdf_text_int.cpp | 13 ++++++------- core/src/fpdftext/text_int.h | 2 +- core/src/fxge/ge/fx_ge_font.cpp | 15 +++++++-------- xfa/src/fgas/src/font/fx_gefont.cpp | 5 ++--- 5 files changed, 23 insertions(+), 27 deletions(-) diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h index 3484196187..571be3f22a 100644 --- a/core/include/fxge/fx_font.h +++ b/core/include/fxge/fx_font.h @@ -60,14 +60,13 @@ class CFX_Font { CFX_Font(); ~CFX_Font(); - FX_BOOL LoadSubst(const CFX_ByteString& face_name, - FX_BOOL bTrueType, - FX_DWORD flags, - int weight, - int italic_angle, - int CharsetCP, - FX_BOOL bVertical = FALSE); - + void LoadSubst(const CFX_ByteString& face_name, + FX_BOOL bTrueType, + FX_DWORD flags, + int weight, + int italic_angle, + int CharsetCP, + FX_BOOL bVertical = FALSE); FX_BOOL LoadEmbedded(const uint8_t* data, FX_DWORD size); FX_BOOL LoadFile(IFX_FileRead* pFile, diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp index b343c1d566..e427a1d2a8 100644 --- a/core/src/fpdftext/fpdf_text_int.cpp +++ b/core/src/fpdftext/fpdf_text_int.cpp @@ -2614,9 +2614,7 @@ void CPDF_LinkExtract::parserLink() { } if (nCount > 5 && (CheckWebLink(strBeCheck) || CheckMailLink(strBeCheck))) { - if (!AppendToLinkList(start, nCount, strBeCheck)) { - break; - } + AppendToLinkList(start, nCount, strBeCheck); } } start = ++pos; @@ -2730,16 +2728,17 @@ FX_BOOL CPDF_LinkExtract::CheckMailLink(CFX_WideString& str) { } return TRUE; } -FX_BOOL CPDF_LinkExtract::AppendToLinkList(int start, - int count, - const CFX_WideString& strUrl) { + +void CPDF_LinkExtract::AppendToLinkList(int start, + int count, + const CFX_WideString& strUrl) { CPDF_LinkExt* linkInfo = new CPDF_LinkExt; linkInfo->m_strUrl = strUrl; linkInfo->m_Start = start; linkInfo->m_Count = count; m_LinkList.Add(linkInfo); - return TRUE; } + CFX_WideString CPDF_LinkExtract::GetURL(int index) const { if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { return L""; diff --git a/core/src/fpdftext/text_int.h b/core/src/fpdftext/text_int.h index 7d69492a21..129ef0a8ae 100644 --- a/core/src/fpdftext/text_int.h +++ b/core/src/fpdftext/text_int.h @@ -227,7 +227,7 @@ class CPDF_LinkExtract : public IPDF_LinkExtract { void DeleteLinkList(); FX_BOOL CheckWebLink(CFX_WideString& strBeCheck); FX_BOOL CheckMailLink(CFX_WideString& str); - FX_BOOL AppendToLinkList(int start, int count, const CFX_WideString& strUrl); + void AppendToLinkList(int start, int count, const CFX_WideString& strUrl); private: LINK_InfoArray m_LinkList; diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp index aa19c58b05..468033eb01 100644 --- a/core/src/fxge/ge/fx_ge_font.cpp +++ b/core/src/fxge/ge/fx_ge_font.cpp @@ -116,13 +116,13 @@ void CFX_Font::DeleteFace() { FXFT_Done_Face(m_Face); m_Face = NULL; } -FX_BOOL CFX_Font::LoadSubst(const CFX_ByteString& face_name, - FX_BOOL bTrueType, - FX_DWORD flags, - int weight, - int italic_angle, - int CharsetCP, - FX_BOOL bVertical) { +void CFX_Font::LoadSubst(const CFX_ByteString& face_name, + FX_BOOL bTrueType, + FX_DWORD flags, + int weight, + int italic_angle, + int CharsetCP, + FX_BOOL bVertical) { m_bEmbedded = FALSE; m_bVertical = bVertical; m_pSubstFont = new CFX_SubstFont; @@ -139,7 +139,6 @@ FX_BOOL CFX_Font::LoadSubst(const CFX_ByteString& face_name, m_pFontData = FXFT_Get_Face_Stream_Base(m_Face); m_dwSize = FXFT_Get_Face_Stream_Size(m_Face); } - return TRUE; } extern "C" { unsigned long _FTStreamRead(FXFT_Stream stream, diff --git a/xfa/src/fgas/src/font/fx_gefont.cpp b/xfa/src/fgas/src/font/fx_gefont.cpp index 0da6720e2c..12c4f0ea39 100644 --- a/xfa/src/fgas/src/font/fx_gefont.cpp +++ b/xfa/src/fgas/src/font/fx_gefont.cpp @@ -235,9 +235,8 @@ FX_BOOL CFX_GEFont::LoadFont(const FX_WCHAR* pszFontFamily, } else if (dwFlags & FXFONT_ITALIC) { csFontFamily += ",Italic"; } - FX_BOOL bRet = - m_pFont->LoadSubst(csFontFamily, TRUE, dwFlags, iWeight, 0, wCodePage); - bRet = m_pFont->m_Face != NULL; + m_pFont->LoadSubst(csFontFamily, TRUE, dwFlags, iWeight, 0, wCodePage); + FX_BOOL bRet = m_pFont->m_Face != nullptr; if (bRet) { InitFont(); } -- cgit v1.2.3