summaryrefslogtreecommitdiff
path: root/xfa/src/fgas
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-01 14:45:20 -0500
committerDan Sinclair <dsinclair@chromium.org>2016-03-01 14:45:20 -0500
commit738b08ce6b9f80d93b815411b47c2b11c2f090f6 (patch)
treeec648b9bdf6d9597043bfe657d56f98dc3cdef30 /xfa/src/fgas
parent50dfc4a7068e8e08105f7b9a3945136e7246e677 (diff)
downloadpdfium-738b08ce6b9f80d93b815411b47c2b11c2f090f6.tar.xz
Fix and enable lint checks.
This CL fixes and enables: * readability/namespace * readability/multiline_string * readability/multiline_comment * readability/inheritance * readability/function * readability/braces R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1747123002 .
Diffstat (limited to 'xfa/src/fgas')
-rw-r--r--xfa/src/fgas/src/font/fx_gefont.h2
-rw-r--r--xfa/src/fgas/src/font/fx_stdfontmgr.cpp12
-rw-r--r--xfa/src/fgas/src/font/fx_stdfontmgr.h21
-rw-r--r--xfa/src/fgas/src/layout/fx_rtfbreak.cpp14
-rw-r--r--xfa/src/fgas/src/layout/fx_rtfbreak.h4
5 files changed, 28 insertions, 25 deletions
diff --git a/xfa/src/fgas/src/font/fx_gefont.h b/xfa/src/fgas/src/font/fx_gefont.h
index 8fb207d588..ef7803d2a5 100644
--- a/xfa/src/fgas/src/font/fx_gefont.h
+++ b/xfa/src/fgas/src/font/fx_gefont.h
@@ -52,7 +52,7 @@ class CFX_GEFont : public IFX_Font {
virtual void SetLogicalFontStyle(FX_DWORD dwLogFontStyle) {
m_bUseLogFontStyle = TRUE;
m_dwLogFontStyle = dwLogFontStyle;
- };
+ }
#endif
protected:
diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp b/xfa/src/fgas/src/font/fx_stdfontmgr.cpp
index 6ad4918203..8ec8fc51fe 100644
--- a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp
+++ b/xfa/src/fgas/src/font/fx_stdfontmgr.cpp
@@ -66,11 +66,12 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage(
return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : NULL;
}
FX_LPCFONTDESCRIPTOR pFD;
- if ((pFD = FindFont(pszFontFamily, dwFontStyles, TRUE, wCodePage)) == NULL)
- if ((pFD = FindFont(NULL, dwFontStyles, TRUE, wCodePage)) == NULL)
- if ((pFD = FindFont(NULL, dwFontStyles, FALSE, wCodePage)) == NULL) {
+ if ((pFD = FindFont(pszFontFamily, dwFontStyles, TRUE, wCodePage)) == NULL) {
+ if ((pFD = FindFont(NULL, dwFontStyles, TRUE, wCodePage)) == NULL) {
+ if ((pFD = FindFont(NULL, dwFontStyles, FALSE, wCodePage)) == NULL)
return NULL;
- }
+ }
+ }
FXSYS_assert(pFD != NULL);
pFont = IFX_Font::LoadFont(pFD->wsFontFace, dwFontStyles, wCodePage, this);
if (pFont != NULL) {
@@ -146,11 +147,12 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFontFamily,
return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : NULL;
}
FX_LPCFONTDESCRIPTOR pFD = NULL;
- if ((pFD = FindFont(pszFontFamily, dwFontStyles, TRUE, wCodePage)) == NULL)
+ if ((pFD = FindFont(pszFontFamily, dwFontStyles, TRUE, wCodePage)) == NULL) {
if ((pFD = FindFont(pszFontFamily, dwFontStyles, FALSE, wCodePage)) ==
NULL) {
return NULL;
}
+ }
FXSYS_assert(pFD != NULL);
if (wCodePage == 0xFFFF) {
wCodePage = FX_GetCodePageFromCharset(pFD->uCharSet);
diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.h b/xfa/src/fgas/src/font/fx_stdfontmgr.h
index 1314d2f465..d1cc095805 100644
--- a/xfa/src/fgas/src/font/fx_stdfontmgr.h
+++ b/xfa/src/fgas/src/font/fx_stdfontmgr.h
@@ -106,15 +106,16 @@ struct FX_FontDescriptorInfo {
public:
CFX_FontDescriptor* pFont;
int32_t nPenalty;
- bool operator>(const FX_FontDescriptorInfo& x) {
- return nPenalty > x.nPenalty;
- };
- bool operator<(const FX_FontDescriptorInfo& x) {
- return nPenalty < x.nPenalty;
- };
- bool operator==(const FX_FontDescriptorInfo& x) {
- return nPenalty == x.nPenalty;
- };
+
+ bool operator>(const FX_FontDescriptorInfo& other) const {
+ return nPenalty > other.nPenalty;
+ }
+ bool operator<(const FX_FontDescriptorInfo& other) const {
+ return nPenalty < other.nPenalty;
+ }
+ bool operator==(const FX_FontDescriptorInfo& other) const {
+ return nPenalty == other.nPenalty;
+ }
};
typedef CFX_ArrayTemplate<FX_FontDescriptorInfo> CFX_FontDescriptorInfos;
@@ -131,7 +132,7 @@ struct FX_HandleParentPath {
class CFX_FontSourceEnum_File : public IFX_FontSourceEnum {
public:
CFX_FontSourceEnum_File();
- virtual void Release() { delete this; };
+ virtual void Release() { delete this; }
virtual FX_POSITION GetStartPosition(void* pUserData = NULL);
virtual IFX_FileAccess* GetNext(FX_POSITION& pos, void* pUserData = NULL);
diff --git a/xfa/src/fgas/src/layout/fx_rtfbreak.cpp b/xfa/src/fgas/src/layout/fx_rtfbreak.cpp
index 4b17615e07..b1f9d5e9ae 100644
--- a/xfa/src/fgas/src/layout/fx_rtfbreak.cpp
+++ b/xfa/src/fgas/src/layout/fx_rtfbreak.cpp
@@ -531,11 +531,12 @@ FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar* pCurChar,
if (m_bVertical != FX_IsOdd(iLastRotation)) {
iCharWidth = 1000;
} else {
- if (!m_pFont->GetCharWidth(wForm, iCharWidth, m_bCharCode))
+ if (!m_pFont->GetCharWidth(wForm, iCharWidth, m_bCharCode)) {
if (!m_pFont->GetCharWidth(pLastChar->m_wCharCode, iCharWidth,
m_bCharCode)) {
iCharWidth = m_iDefChar;
}
+ }
}
iCharWidth *= m_iFontSize;
iCharWidth = iCharWidth * m_iHorizontalScale / 100;
@@ -548,13 +549,12 @@ FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar* pCurChar,
m_pArabicChar->GetFormChar(pCurChar, (bAlef ? NULL : pLastChar), NULL);
if (m_bVertical != FX_IsOdd(iRotation)) {
iCharWidth = 1000;
- } else {
- if (!m_pFont->GetCharWidth(wForm, iCharWidth, m_bCharCode))
- if (!m_pFont->GetCharWidth(pCurChar->m_wCharCode, iCharWidth,
- m_bCharCode)) {
- iCharWidth = m_iDefChar;
- }
+ } else if (!m_pFont->GetCharWidth(wForm, iCharWidth, m_bCharCode) &&
+ !m_pFont->GetCharWidth(pCurChar->m_wCharCode, iCharWidth,
+ m_bCharCode)) {
+ iCharWidth = m_iDefChar;
}
+
iCharWidth *= m_iFontSize;
iCharWidth = iCharWidth * m_iHorizontalScale / 100;
pCurChar->m_iCharWidth = iCharWidth;
diff --git a/xfa/src/fgas/src/layout/fx_rtfbreak.h b/xfa/src/fgas/src/layout/fx_rtfbreak.h
index a54b83bf3d..7aecef7f10 100644
--- a/xfa/src/fgas/src/layout/fx_rtfbreak.h
+++ b/xfa/src/fgas/src/layout/fx_rtfbreak.h
@@ -69,8 +69,8 @@ class CFX_RTFBreak : public IFX_RTFBreak {
CFX_RTFBreak(FX_DWORD dwPolicies);
~CFX_RTFBreak();
void Release() override { delete this; }
- void SetLineBoundary(FX_FLOAT fLineStart, FX_FLOAT fLineEnd) override final;
- void SetLineStartPos(FX_FLOAT fLinePos) override final;
+ void SetLineBoundary(FX_FLOAT fLineStart, FX_FLOAT fLineEnd) override;
+ void SetLineStartPos(FX_FLOAT fLinePos) override;
FX_DWORD GetLayoutStyles() const override { return m_dwLayoutStyles; }
void SetLayoutStyles(FX_DWORD dwLayoutStyles) override;
void SetFont(IFX_Font* pFont) override;