summaryrefslogtreecommitdiff
path: root/fxjs/cjx_node.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-20 20:28:23 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-20 20:28:23 +0000
commite74ae8c02f6b5efa37ba11bcad6b714046cfc7b0 (patch)
tree1c5353b26b58732e5bda616ba5d9fc8f414a7037 /fxjs/cjx_node.h
parent68c77592f25f9173d2166fa01fb34b4155f4cfcb (diff)
downloadpdfium-e74ae8c02f6b5efa37ba11bcad6b714046cfc7b0.tar.xz
Convert calc data and layout item to store in CJX_Node
This CL moves the XFA_CalcData and XFA_LayoutItem out of the map'd data for a CJX_Node and stores directly on the node. This makes the object a bit bigger but makes the code a lot more understandable. Change-Id: I8897a52d61d37595181960c23928984aa5d67efc Reviewed-on: https://pdfium-review.googlesource.com/18590 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjx_node.h')
-rw-r--r--fxjs/cjx_node.h30
1 files changed, 21 insertions, 9 deletions
diff --git a/fxjs/cjx_node.h b/fxjs/cjx_node.h
index 3393a52406..d0f8279e7f 100644
--- a/fxjs/cjx_node.h
+++ b/fxjs/cjx_node.h
@@ -30,6 +30,8 @@ enum XFA_SOM_MESSAGETYPE {
};
class CFXJSE_Arguments;
+class CXFA_CalcData;
+class CXFA_LayoutItem;
class CXFA_Node;
class CXFA_WidgetData;
@@ -100,11 +102,6 @@ class CJX_Node : public CJX_Object {
bool SetMeasure(XFA_Attribute eAttr, CXFA_Measurement mValue, bool bNotify);
CXFA_Measurement GetMeasure(XFA_Attribute eAttr) const;
- bool SetUserData(void* pKey,
- void* pData,
- XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo);
- void* GetUserData(void* pKey, bool bProtoAlso);
-
void SetBindingNodes(std::vector<UnownedPtr<CXFA_Node>> nodes) {
binding_nodes_ = std::move(nodes);
}
@@ -127,6 +124,16 @@ class CJX_Node : public CJX_Object {
void SetWidgetData(std::unique_ptr<CXFA_WidgetData> data);
CXFA_WidgetData* GetWidgetData() const { return widget_data_.get(); }
+ void SetLayoutItem(CXFA_LayoutItem* item) { layout_item_ = item; }
+ CXFA_LayoutItem* GetLayoutItem() const { return layout_item_.Get(); }
+
+ void SetCalcData(std::unique_ptr<CXFA_CalcData> data);
+ CXFA_CalcData* GetCalcData() const { return calc_data_.get(); }
+ std::unique_ptr<CXFA_CalcData> ReleaseCalcData();
+
+ void SetCalcRecursionCount(size_t count) { calc_recursion_count_ = count; }
+ size_t GetCalcRecursionCount() const { return calc_recursion_count_; }
+
pdfium::Optional<WideString> TryNamespace();
void MergeAllData(CXFA_Node* pDstModule);
@@ -414,6 +421,10 @@ class CJX_Node : public CJX_Object {
XFA_Attribute eAttribute);
private:
+ bool SetUserData(void* pKey,
+ void* pData,
+ XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo);
+
void ResolveNodeList(CFXJSE_Value* pValue,
WideString wsExpression,
uint32_t dwFlag,
@@ -447,17 +458,18 @@ class CJX_Node : public CJX_Object {
bool HasMapModuleKey(void* pKey);
void ClearMapModuleBuffer();
void RemoveMapModuleKey(void* pKey);
- void MoveBufferMapData(CXFA_Node* pDstModule, void* pKey);
- void MoveBufferMapData(CXFA_Node* pSrcModule,
- CXFA_Node* pDstModule,
- void* pKey);
+ void MoveBufferMapData(CXFA_Node* pDstModule);
+ void MoveBufferMapData(CXFA_Node* pSrcModule, CXFA_Node* pDstModule);
int32_t execSingleEventByName(const WideStringView& wsEventName,
XFA_Element eType);
std::unique_ptr<XFA_MAPMODULEDATA> map_module_data_;
std::unique_ptr<CXFA_WidgetData> widget_data_;
+ std::unique_ptr<CXFA_CalcData> calc_data_;
+ UnownedPtr<CXFA_LayoutItem> layout_item_;
std::vector<UnownedPtr<CXFA_Node>> binding_nodes_;
+ size_t calc_recursion_count_ = 0;
};
#endif // FXJS_CJX_NODE_H_