summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_boxdata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-14 21:04:13 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-14 21:04:13 +0000
commit8eb2722e764fff0a39d0d1dc0c59473aa938b31f (patch)
tree0141be0ac4398c1c57b5ab2ed1ca0a77b1f11dc2 /xfa/fxfa/parser/cxfa_boxdata.cpp
parentdf4f30eaaa469c3703118f89579d506209a49237 (diff)
downloadpdfium-8eb2722e764fff0a39d0d1dc0c59473aa938b31f.tar.xz
Add type information to CJX_Object::GetProperty
This CL adds a type template to the CJX_Object::GetProperty method so we can have the correct types returned. Change-Id: Ieda8ec4bd31d26a1e71af30f08b48eb826f5993d Reviewed-on: https://pdfium-review.googlesource.com/21250 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_boxdata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_boxdata.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/xfa/fxfa/parser/cxfa_boxdata.cpp b/xfa/fxfa/parser/cxfa_boxdata.cpp
index 7ada3bf00b..6e27c71e56 100644
--- a/xfa/fxfa/parser/cxfa_boxdata.cpp
+++ b/xfa/fxfa/parser/cxfa_boxdata.cpp
@@ -6,7 +6,10 @@
#include "xfa/fxfa/parser/cxfa_boxdata.h"
+#include "xfa/fxfa/parser/cxfa_corner.h"
#include "xfa/fxfa/parser/cxfa_cornerdata.h"
+#include "xfa/fxfa/parser/cxfa_edge.h"
+#include "xfa/fxfa/parser/cxfa_fill.h"
#include "xfa/fxfa/parser/cxfa_margin.h"
#include "xfa/fxfa/parser/cxfa_measurement.h"
#include "xfa/fxfa/parser/cxfa_node.h"
@@ -21,8 +24,9 @@ std::vector<CXFA_StrokeData> GetStrokesInternal(CXFA_Node* pNode, bool bNull) {
strokes.resize(8);
int32_t i, j;
for (i = 0, j = 0; i < 4; i++) {
- CXFA_CornerData cornerData = CXFA_CornerData(
- pNode->JSObject()->GetProperty(i, XFA_Element::Corner, i == 0));
+ CXFA_CornerData cornerData =
+ CXFA_CornerData(pNode->JSObject()->GetProperty<CXFA_Corner>(
+ i, XFA_Element::Corner, i == 0));
if (cornerData.HasValidNode() || i == 0) {
strokes[j] = cornerData;
} else if (!bNull) {
@@ -32,8 +36,9 @@ std::vector<CXFA_StrokeData> GetStrokesInternal(CXFA_Node* pNode, bool bNull) {
strokes[j] = strokes[2];
}
j++;
- CXFA_EdgeData edgeData = CXFA_EdgeData(
- pNode->JSObject()->GetProperty(i, XFA_Element::Edge, i == 0));
+ CXFA_EdgeData edgeData =
+ CXFA_EdgeData(pNode->JSObject()->GetProperty<CXFA_Edge>(
+ i, XFA_Element::Edge, i == 0));
if (edgeData.HasValidNode() || i == 0) {
strokes[j] = edgeData;
} else if (!bNull) {
@@ -98,7 +103,7 @@ int32_t CXFA_BoxData::CountEdges() const {
}
CXFA_EdgeData CXFA_BoxData::GetEdgeData(int32_t nIndex) const {
- return CXFA_EdgeData(m_pNode ? m_pNode->JSObject()->GetProperty(
+ return CXFA_EdgeData(m_pNode ? m_pNode->JSObject()->GetProperty<CXFA_Edge>(
nIndex, XFA_Element::Edge, nIndex == 0)
: nullptr);
}
@@ -129,8 +134,8 @@ CXFA_FillData CXFA_BoxData::GetFillData(bool bModified) const {
if (!m_pNode)
return CXFA_FillData(nullptr);
- CXFA_Node* pFillNode =
- m_pNode->JSObject()->GetProperty(0, XFA_Element::Fill, bModified);
+ CXFA_Node* pFillNode = m_pNode->JSObject()->GetProperty<CXFA_Fill>(
+ 0, XFA_Element::Fill, bModified);
return CXFA_FillData(pFillNode);
}