summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffwidget.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-20 21:19:13 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-20 21:19:13 +0000
commit2501ae2474c1f097a06634d647de2eb3fb730864 (patch)
tree3ac7d386a3e73f3c848c203c3f0e61af9d284c1f /xfa/fxfa/cxfa_ffwidget.cpp
parent89453e92d5d0b7aaf9e0c3890a90a21adc94a0ce (diff)
downloadpdfium-2501ae2474c1f097a06634d647de2eb3fb730864.tar.xz
Remove CXFA_DataData operator bool override
This CL removes CXFA_DataData::operator bool in favour of an explicit HasValidNode method. This makes the call sites a lot clearer. Change-Id: I6fae14fdeec4674ca7916e21b9e5703070fc3069 Reviewed-on: https://pdfium-review.googlesource.com/18830 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffwidget.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffwidget.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp
index bb2d2e8a1c..88c1fea971 100644
--- a/xfa/fxfa/cxfa_ffwidget.cpp
+++ b/xfa/fxfa/cxfa_ffwidget.cpp
@@ -485,8 +485,10 @@ void XFA_BOX_Fill(const CXFA_BoxData& boxData,
const CFX_Matrix& matrix,
uint32_t dwFlags) {
CXFA_FillData fillData = boxData.GetFillData(false);
- if (!fillData || fillData.GetPresence() != XFA_ATTRIBUTEENUM_Visible)
+ if (!fillData.HasValidNode() ||
+ fillData.GetPresence() != XFA_ATTRIBUTEENUM_Visible) {
return;
+ }
pGS->SaveGraphState();
CXFA_GEPath fillPath;
@@ -528,7 +530,7 @@ void XFA_BOX_StrokePath(const CXFA_StrokeData& strokeData,
CXFA_GEPath* pPath,
CXFA_Graphics* pGS,
const CFX_Matrix& matrix) {
- if (!strokeData || !strokeData.IsVisible())
+ if (!strokeData.HasValidNode() || !strokeData.IsVisible())
return;
float fThickness = strokeData.GetThickness();
@@ -555,7 +557,7 @@ void XFA_BOX_StrokeArc(const CXFA_BoxData& boxData,
const CFX_Matrix& matrix,
uint32_t dwFlags) {
CXFA_EdgeData edgeData = boxData.GetEdgeData(0);
- if (!edgeData || !edgeData.IsVisible())
+ if (!edgeData.HasValidNode() || !edgeData.IsVisible())
return;
bool bVisible = false;
@@ -879,8 +881,10 @@ void XFA_DrawBox(CXFA_BoxData boxData,
const CFX_RectF& rtWidget,
const CFX_Matrix& matrix,
uint32_t dwFlags) {
- if (!boxData || boxData.GetPresence() != XFA_ATTRIBUTEENUM_Visible)
+ if (!boxData.HasValidNode() ||
+ boxData.GetPresence() != XFA_ATTRIBUTEENUM_Visible) {
return;
+ }
XFA_Element eType = boxData.GetElementType();
if (eType != XFA_Element::Arc && eType != XFA_Element::Border &&
@@ -980,12 +984,12 @@ void CXFA_FFWidget::RenderWidget(CXFA_Graphics* pGS,
return;
CXFA_BorderData borderData = m_pDataAcc->GetBorderData(false);
- if (!borderData)
+ if (!borderData.HasValidNode())
return;
CFX_RectF rtBorder = GetRectWithoutRotate();
CXFA_MarginData marginData = borderData.GetMarginData();
- if (marginData)
+ if (marginData.HasValidNode())
XFA_RectWidthoutMargin(rtBorder, marginData);
rtBorder.Normalize();
@@ -2019,7 +2023,7 @@ RetainPtr<CFX_DIBitmap> XFA_LoadImageFromBuffer(
void XFA_RectWidthoutMargin(CFX_RectF& rt,
const CXFA_MarginData& marginData,
bool bUI) {
- if (!marginData)
+ if (!marginData.HasValidNode())
return;
float fLeftInset;