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_fill.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_fill.cpp') diff --git a/xfa/fxfa/parser/cxfa_fill.cpp b/xfa/fxfa/parser/cxfa_fill.cpp index 5b6c69eb24..c55dd7e0e1 100644 --- a/xfa/fxfa/parser/cxfa_fill.cpp +++ b/xfa/fxfa/parser/cxfa_fill.cpp @@ -61,7 +61,7 @@ bool CXFA_Fill::IsVisible() { void CXFA_Fill::SetColor(FX_ARGB color) { CXFA_Color* pNode = - JSObject()->GetProperty(0, XFA_Element::Color, true); + JSObject()->GetOrCreateProperty(0, XFA_Element::Color); int a; int r; int g; @@ -166,17 +166,17 @@ FX_ARGB CXFA_Fill::GetRadialColor() { } CXFA_Stipple* CXFA_Fill::GetStipple() { - return JSObject()->GetProperty(0, XFA_Element::Stipple, true); + return JSObject()->GetOrCreateProperty(0, XFA_Element::Stipple); } CXFA_Radial* CXFA_Fill::GetRadial() { - return JSObject()->GetProperty(0, XFA_Element::Radial, true); + return JSObject()->GetOrCreateProperty(0, XFA_Element::Radial); } CXFA_Linear* CXFA_Fill::GetLinear() { - return JSObject()->GetProperty(0, XFA_Element::Linear, true); + return JSObject()->GetOrCreateProperty(0, XFA_Element::Linear); } CXFA_Pattern* CXFA_Fill::GetPattern() { - return JSObject()->GetProperty(0, XFA_Element::Pattern, true); + return JSObject()->GetOrCreateProperty(0, XFA_Element::Pattern); } -- cgit v1.2.3