summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_boxdata.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/parser/cxfa_boxdata.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/parser/cxfa_boxdata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_boxdata.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/xfa/fxfa/parser/cxfa_boxdata.cpp b/xfa/fxfa/parser/cxfa_boxdata.cpp
index 5545494aac..a9f7ace13e 100644
--- a/xfa/fxfa/parser/cxfa_boxdata.cpp
+++ b/xfa/fxfa/parser/cxfa_boxdata.cpp
@@ -22,7 +22,7 @@ std::vector<CXFA_StrokeData> GetStrokesInternal(CXFA_Node* pNode, bool bNull) {
for (i = 0, j = 0; i < 4; i++) {
CXFA_CornerData cornerData = CXFA_CornerData(
pNode->JSNode()->GetProperty(i, XFA_Element::Corner, i == 0));
- if (cornerData || i == 0) {
+ if (cornerData.HasValidNode() || i == 0) {
strokes[j] = cornerData;
} else if (!bNull) {
if (i == 1 || i == 2)
@@ -33,7 +33,7 @@ std::vector<CXFA_StrokeData> GetStrokesInternal(CXFA_Node* pNode, bool bNull) {
j++;
CXFA_EdgeData edgeData = CXFA_EdgeData(
pNode->JSNode()->GetProperty(i, XFA_Element::Edge, i == 0));
- if (edgeData || i == 0) {
+ if (edgeData.HasValidNode() || i == 0) {
strokes[j] = edgeData;
} else if (!bNull) {
if (i == 1 || i == 2)
@@ -54,10 +54,10 @@ static int32_t Style3D(const std::vector<CXFA_StrokeData>& strokes,
strokeData = strokes[0];
for (size_t i = 1; i < strokes.size(); i++) {
CXFA_StrokeData find = strokes[i];
- if (!find)
+ if (!find.HasValidNode())
continue;
- if (!strokeData)
+ if (!strokeData.HasValidNode())
strokeData = find;
else if (strokeData.GetStrokeType() != find.GetStrokeType())
strokeData = find;