summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-07 20:59:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-07 20:59:00 +0000
commitc3ef52cf3c26d47877740dc46faa3088be44cfae (patch)
tree27cb3e37aa958fd1237fd7d314e6ac1361108461 /xfa
parent2a69b9ef97ddf46fe01de432bd0ccc1b7ce92bcb (diff)
downloadpdfium-c3ef52cf3c26d47877740dc46faa3088be44cfae.tar.xz
Rename CXFA_Occur to CXFA_OccurData
This CL renames CXFA_Occur to CXFA_OccurData to show it is part of the data hierarchy. Change-Id: I55096747338a9ff83ab24f528f6715a6f4302ba7 Reviewed-on: https://pdfium-review.googlesource.com/17988 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp7
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_occurdata.cpp (renamed from xfa/fxfa/parser/cxfa_occur.cpp)16
-rw-r--r--xfa/fxfa/parser/cxfa_occurdata.h (renamed from xfa/fxfa/parser/cxfa_occur.h)10
-rw-r--r--xfa/fxfa/parser/xfa_document_datamerger_imp.cpp9
5 files changed, 22 insertions, 22 deletions
diff --git a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
index f408ec4d58..16b0dee096 100644
--- a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
+++ b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
@@ -23,7 +23,7 @@
#include "xfa/fxfa/parser/cxfa_localemgr.h"
#include "xfa/fxfa/parser/cxfa_measurement.h"
#include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxfa/parser/cxfa_occur.h"
+#include "xfa/fxfa/parser/cxfa_occurdata.h"
#include "xfa/fxfa/parser/cxfa_traversestrategy_xfanode.h"
#include "xfa/fxfa/parser/xfa_utils.h"
@@ -2820,8 +2820,9 @@ bool CXFA_ItemLayoutProcessor::JudgeLeaderOrTrailerForOccur(
if (!pTemplate)
pTemplate = pFormNode;
- CXFA_Occur NodeOccur(pTemplate->GetFirstChildByClass(XFA_Element::Occur));
- int32_t iMax = NodeOccur.GetMax();
+ int32_t iMax =
+ CXFA_OccurData(pTemplate->GetFirstChildByClass(XFA_Element::Occur))
+ .GetMax();
if (iMax < 0)
return true;
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 475295f9dd..64beeffa03 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -32,7 +32,7 @@
#include "xfa/fxfa/parser/cxfa_document.h"
#include "xfa/fxfa/parser/cxfa_layoutprocessor.h"
#include "xfa/fxfa/parser/cxfa_measurement.h"
-#include "xfa/fxfa/parser/cxfa_occur.h"
+#include "xfa/fxfa/parser/cxfa_occurdata.h"
#include "xfa/fxfa/parser/cxfa_simple_parser.h"
#include "xfa/fxfa/parser/cxfa_traversestrategy_xfacontainernode.h"
#include "xfa/fxfa/parser/xfa_basic_data.h"
diff --git a/xfa/fxfa/parser/cxfa_occur.cpp b/xfa/fxfa/parser/cxfa_occurdata.cpp
index 6c770d2e72..3bbe00cd35 100644
--- a/xfa/fxfa/parser/cxfa_occur.cpp
+++ b/xfa/fxfa/parser/cxfa_occurdata.cpp
@@ -4,13 +4,13 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/fxfa/parser/cxfa_occur.h"
+#include "xfa/fxfa/parser/cxfa_occurdata.h"
#include "xfa/fxfa/parser/cxfa_node.h"
-CXFA_Occur::CXFA_Occur(CXFA_Node* pNode) : CXFA_Data(pNode) {}
+CXFA_OccurData::CXFA_OccurData(CXFA_Node* pNode) : CXFA_Data(pNode) {}
-int32_t CXFA_Occur::GetMax() {
+int32_t CXFA_OccurData::GetMax() {
int32_t iMax = 1;
if (m_pNode) {
if (!m_pNode->JSNode()->TryInteger(XFA_ATTRIBUTE_Max, iMax, true))
@@ -19,7 +19,7 @@ int32_t CXFA_Occur::GetMax() {
return iMax;
}
-int32_t CXFA_Occur::GetMin() {
+int32_t CXFA_OccurData::GetMin() {
int32_t iMin = 1;
if (m_pNode) {
if (!m_pNode->JSNode()->TryInteger(XFA_ATTRIBUTE_Min, iMin, true) ||
@@ -29,7 +29,9 @@ int32_t CXFA_Occur::GetMin() {
return iMin;
}
-bool CXFA_Occur::GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit) {
+bool CXFA_OccurData::GetOccurInfo(int32_t& iMin,
+ int32_t& iMax,
+ int32_t& iInit) {
if (!m_pNode)
return false;
if (!m_pNode->JSNode()->TryInteger(XFA_ATTRIBUTE_Min, iMin, false) ||
@@ -48,7 +50,7 @@ bool CXFA_Occur::GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit) {
return true;
}
-void CXFA_Occur::SetMax(int32_t iMax) {
+void CXFA_OccurData::SetMax(int32_t iMax) {
iMax = (iMax != -1 && iMax < 1) ? 1 : iMax;
m_pNode->JSNode()->SetInteger(XFA_ATTRIBUTE_Max, iMax, false);
int32_t iMin = GetMin();
@@ -58,7 +60,7 @@ void CXFA_Occur::SetMax(int32_t iMax) {
}
}
-void CXFA_Occur::SetMin(int32_t iMin) {
+void CXFA_OccurData::SetMin(int32_t iMin) {
iMin = (iMin < 0) ? 1 : iMin;
m_pNode->JSNode()->SetInteger(XFA_ATTRIBUTE_Min, iMin, false);
int32_t iMax = GetMax();
diff --git a/xfa/fxfa/parser/cxfa_occur.h b/xfa/fxfa/parser/cxfa_occurdata.h
index 69db071a11..90554bd0eb 100644
--- a/xfa/fxfa/parser/cxfa_occur.h
+++ b/xfa/fxfa/parser/cxfa_occurdata.h
@@ -4,17 +4,17 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_FXFA_PARSER_CXFA_OCCUR_H_
-#define XFA_FXFA_PARSER_CXFA_OCCUR_H_
+#ifndef XFA_FXFA_PARSER_CXFA_OCCURDATA_H_
+#define XFA_FXFA_PARSER_CXFA_OCCURDATA_H_
#include "core/fxcrt/fx_system.h"
#include "xfa/fxfa/parser/cxfa_data.h"
class CXFA_Node;
-class CXFA_Occur : public CXFA_Data {
+class CXFA_OccurData : public CXFA_Data {
public:
- explicit CXFA_Occur(CXFA_Node* pNode);
+ explicit CXFA_OccurData(CXFA_Node* pNode);
int32_t GetMax();
int32_t GetMin();
@@ -23,4 +23,4 @@ class CXFA_Occur : public CXFA_Data {
void SetMin(int32_t iMin);
};
-#endif // XFA_FXFA_PARSER_CXFA_OCCUR_H_
+#endif // XFA_FXFA_PARSER_CXFA_OCCURDATA_H_
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
index a6441a68db..f7df149ceb 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -19,7 +19,7 @@
#include "xfa/fxfa/parser/cxfa_layoutprocessor.h"
#include "xfa/fxfa/parser/cxfa_localemgr.h"
#include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxfa/parser/cxfa_occur.h"
+#include "xfa/fxfa/parser/cxfa_occurdata.h"
#include "xfa/fxfa/parser/cxfa_traversestrategy_xfacontainernode.h"
#include "xfa/fxfa/parser/cxfa_traversestrategy_xfanode.h"
#include "xfa/fxfa/parser/xfa_resolvenode_rs.h"
@@ -49,11 +49,8 @@ bool GetOccurInfo(CXFA_Node* pOccurNode,
int32_t& iMin,
int32_t& iMax,
int32_t& iInit) {
- if (!pOccurNode)
- return false;
-
- CXFA_Occur occur(pOccurNode);
- return occur.GetOccurInfo(iMin, iMax, iInit);
+ return pOccurNode &&
+ CXFA_OccurData(pOccurNode).GetOccurInfo(iMin, iMax, iInit);
}
CXFA_Node* FormValueNode_CreateChild(CXFA_Node* pValueNode, XFA_Element iType) {