diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-20 21:19:13 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-20 21:19:13 +0000 |
commit | 2501ae2474c1f097a06634d647de2eb3fb730864 (patch) | |
tree | 3ac7d386a3e73f3c848c203c3f0e61af9d284c1f /xfa/fxfa/parser/cxfa_widgetdata.cpp | |
parent | 89453e92d5d0b7aaf9e0c3890a90a21adc94a0ce (diff) | |
download | pdfium-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/parser/cxfa_widgetdata.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_widgetdata.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index cff2d6b004..b5ceb4a4d4 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -364,19 +364,21 @@ CFX_RectF CXFA_WidgetData::GetUIMargin() { pUIChild ? pUIChild->JSNode()->GetProperty(0, XFA_Element::Margin, false) : nullptr); - if (!mgUI) + if (!mgUI.HasValidNode()) return CFX_RectF(); CXFA_BorderData borderData = GetUIBorderData(); - if (borderData && borderData.GetPresence() != XFA_ATTRIBUTEENUM_Visible) + if (borderData.HasValidNode() && + borderData.GetPresence() != XFA_ATTRIBUTEENUM_Visible) { return CFX_RectF(); + } float fLeftInset, fTopInset, fRightInset, fBottomInset; bool bLeft = mgUI.GetLeftInset(fLeftInset); bool bTop = mgUI.GetTopInset(fTopInset); bool bRight = mgUI.GetRightInset(fRightInset); bool bBottom = mgUI.GetBottomInset(fBottomInset); - if (borderData) { + if (borderData.HasValidNode()) { bool bVisible = false; float fThickness = 0; int32_t iType = 0; @@ -492,7 +494,7 @@ XFA_CHECKSTATE CXFA_WidgetData::GetCheckState() { void CXFA_WidgetData::SetCheckState(XFA_CHECKSTATE eCheckState, bool bNotify) { CXFA_WidgetData exclGroup(GetExclGroupNode()); - if (exclGroup) { + if (exclGroup.HasValidNode()) { WideString wsValue; if (eCheckState != XFA_CHECKSTATE_Off) { if (CXFA_Node* pItems = m_pNode->GetChild(0, XFA_Element::Items, false)) { @@ -1504,7 +1506,7 @@ WideString CXFA_WidgetData::GetPictureContent(XFA_VALUEPICTURE ePicture) { } case XFA_VALUEPICTURE_DataBind: { CXFA_BindData bindData = GetBindData(); - if (bindData) + if (bindData.HasValidNode()) return bindData.GetPicture(); break; } |