From 640d8ffad8536c789103892c7a4e69e5d30172c8 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 10 Jan 2018 16:28:57 +0000 Subject: Make methods which create nodes more obvious This CL converts the various methods Get methods which take a boolean value to explicit Get* and GetOrCreate* methods to make the usage clearer. Change-Id: I2af68448b1b69b95713e739bf7fe14a4336d2b65 Reviewed-on: https://pdfium-review.googlesource.com/22590 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_node.h | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_node.h') diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index 1f11a2372f..374e8e55bf 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h @@ -110,7 +110,7 @@ class CXFA_Node : public CXFA_Object { void ClearFlag(uint32_t dwFlag); CXFA_Node* GetParent() { return m_pParent; } - CXFA_Node* GetChildNode() { return m_pChild; } + CXFA_Node* GetChildNode() const { return m_pChild; } CXFA_Node* CreateInstance(bool bDataMerge); int32_t GetCount(); @@ -235,25 +235,28 @@ class CXFA_Node : public CXFA_Object { bool IsOpenAccess(); - CXFA_Border* GetBorder(bool bModified); - CXFA_Caption* GetCaption(); + CXFA_Border* GetBorder() const; + CXFA_Border* GetOrCreateBorder(); + CXFA_Caption* GetCaption() const; - CXFA_Font* GetFont(bool bModified); - float GetFontSize(); - FX_ARGB GetTextColor(); - float GetLineHeight(); + CXFA_Font* GetFont() const; + CXFA_Font* GetOrCreateFont(); + float GetFontSize() const; + FX_ARGB GetTextColor() const; + float GetLineHeight() const; - CXFA_Margin* GetMargin(); - CXFA_Para* GetPara(); - CXFA_Calculate* GetCalculate(); - CXFA_Validate* GetValidate(bool bModified); + CXFA_Margin* GetMargin() const; + CXFA_Para* GetPara() const; + CXFA_Calculate* GetCalculate() const; + CXFA_Validate* GetValidate() const; + CXFA_Validate* GetOrCreateValidate(); CXFA_Value* GetDefaultValue(); - CXFA_Value* GetFormValue(); + CXFA_Value* GetFormValue() const; WideString GetRawValue(); int32_t GetRotate(); - CXFA_Bind* GetBind(); + CXFA_Bind* GetBind() const; Optional TryWidth(); Optional TryHeight(); -- cgit v1.2.3