summaryrefslogtreecommitdiff
path: root/xfa/src/fxfa
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-12-02 12:51:14 -0800
committerTom Sepez <tsepez@chromium.org>2015-12-02 12:51:14 -0800
commit9263e71cb259ab372d32722ee64e1a183b4b6088 (patch)
treec0c54c523688119454e44a6e303596f4b9b300a9 /xfa/src/fxfa
parent8677d53e8730efc20c80a1ad75be4e10a9db21d0 (diff)
downloadpdfium-9263e71cb259ab372d32722ee64e1a183b4b6088.tar.xz
Remove _FWL_RETURN_IF_ macros
These hide early returns from the casual reader, hide the inversion of the condition under test from the reader, prevent the folding of conditions into a single statement, and take up more characters than the if() itself. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1494683002 .
Diffstat (limited to 'xfa/src/fxfa')
-rw-r--r--xfa/src/fxfa/src/app/xfa_fwladapter.cpp6
-rw-r--r--xfa/src/fxfa/src/app/xfa_fwltheme.cpp18
2 files changed, 16 insertions, 8 deletions
diff --git a/xfa/src/fxfa/src/app/xfa_fwladapter.cpp b/xfa/src/fxfa/src/app/xfa_fwladapter.cpp
index 94e10ab01d..3c9f1a1556 100644
--- a/xfa/src/fxfa/src/app/xfa_fwladapter.cpp
+++ b/xfa/src/fxfa/src/app/xfa_fwladapter.cpp
@@ -42,9 +42,11 @@ FX_BOOL FWL_ShowCaret(IFWL_Widget* pWidget,
}
FWL_ERR CXFA_FWLAdapterWidgetMgr::RepaintWidget(IFWL_Widget* pWidget,
const CFX_RectF* pRect) {
- _FWL_RETURN_VALUE_IF_FAIL(pWidget, FWL_ERR_Indefinite);
+ if (!pWidget)
+ return FWL_ERR_Indefinite;
CXFA_FFField* pField = (CXFA_FFField*)pWidget->GetPrivateData(pWidget);
- _FWL_RETURN_VALUE_IF_FAIL(pField, FWL_ERR_Indefinite);
+ if (!pField)
+ return FWL_ERR_Indefinite;
#ifdef _XFA_EMB
CFX_RectF rtInvalidate;
pWidget->GetWidgetRect(rtInvalidate);
diff --git a/xfa/src/fxfa/src/app/xfa_fwltheme.cpp b/xfa/src/fxfa/src/app/xfa_fwltheme.cpp
index 3b12058f88..0d2412858f 100644
--- a/xfa/src/fxfa/src/app/xfa_fwltheme.cpp
+++ b/xfa/src/fxfa/src/app/xfa_fwltheme.cpp
@@ -131,7 +131,8 @@ FX_BOOL CXFA_FWLTheme::DrawText(CFWL_ThemeText* pParams) {
}
CFX_Graphics* pGraphics = pParams->m_pGraphics;
CFX_RenderDevice* pRenderDevice = pGraphics->GetRenderDevice();
- _FWL_RETURN_VALUE_IF_FAIL(pRenderDevice, FALSE);
+ if (!pRenderDevice)
+ return FALSE;
m_pTextOut->SetRenderDevice(pRenderDevice);
CFX_Matrix mtPart = pParams->m_matrix;
CFX_Matrix* pMatrix = pGraphics->GetMatrix();
@@ -150,7 +151,8 @@ FX_BOOL CXFA_FWLTheme::DrawText(CFWL_ThemeText* pParams) {
CXFA_WidgetAcc* pAcc = pWidget->GetDataAcc();
CFX_Graphics* pGraphics = pParams->m_pGraphics;
CFX_RenderDevice* pRenderDevice = pGraphics->GetRenderDevice();
- _FWL_RETURN_VALUE_IF_FAIL(pRenderDevice, FALSE);
+ if (!pRenderDevice)
+ return FALSE;
m_pTextOut->SetRenderDevice(pRenderDevice);
m_pTextOut->SetStyles(pParams->m_dwTTOStyles);
m_pTextOut->SetAlignment(pParams->m_iTTOAlign);
@@ -274,8 +276,10 @@ FX_BOOL CXFA_FWLTheme::CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) {
if (!pWidget) {
return FWL_ERR_Indefinite;
}
- _FWL_RETURN_VALUE_IF_FAIL(pParams, FALSE);
- _FWL_RETURN_VALUE_IF_FAIL(m_pTextOut, FALSE);
+ if (!pParams)
+ return FALSE;
+ if (!m_pTextOut)
+ return FALSE;
m_pTextOut->SetFont(m_pCalendarFont);
m_pTextOut->SetFontSize(FWLTHEME_CAPACITY_FontSize);
m_pTextOut->SetTextColor(FWLTHEME_CAPACITY_TextColor);
@@ -293,8 +297,10 @@ FX_BOOL CXFA_FWLTheme::CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) {
m_pTextOut->SetFont(pAcc->GetFDEFont());
m_pTextOut->SetFontSize(pAcc->GetFontSize());
m_pTextOut->SetTextColor(pAcc->GetTextColor());
- _FWL_RETURN_VALUE_IF_FAIL(pParams, FALSE);
- _FWL_RETURN_VALUE_IF_FAIL(m_pTextOut, FALSE);
+ if (!pParams)
+ return FALSE;
+ if (!m_pTextOut)
+ return FALSE;
m_pTextOut->SetAlignment(pParams->m_iTTOAlign);
m_pTextOut->SetStyles(pParams->m_dwTTOStyles);
m_pTextOut->CalcLogicSize(pParams->m_wsText, pParams->m_wsText.GetLength(),