From e844cccc8419dae40720aad57c3bcd7ced14a925 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 10 Jan 2018 19:43:36 +0000 Subject: Rename GetOrCreateBorder to GetOrCreateBorderIfPossible This CL makes it explicit that GetOrCreateBorderIfPossible can return a nullptr. Change-Id: I41d5e7ee506e95d95349e1e06198e40e8afa073c Reviewed-on: https://pdfium-review.googlesource.com/22672 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- fxjs/xfa/cjx_object.cpp | 6 +++--- xfa/fxfa/parser/cxfa_node.cpp | 2 +- xfa/fxfa/parser/cxfa_node.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp index f1b863ddc1..8f528c8544 100644 --- a/fxjs/xfa/cjx_object.cpp +++ b/fxjs/xfa/cjx_object.cpp @@ -1322,7 +1322,7 @@ void CJX_Object::Script_Som_FontColor(CFXJSE_Value* pValue, void CJX_Object::Script_Som_FillColor(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { - CXFA_Border* border = ToNode(object_.Get())->GetOrCreateBorder(); + CXFA_Border* border = ToNode(object_.Get())->GetOrCreateBorderIfPossible(); CXFA_Fill* borderfill = border->GetOrCreateFill(); if (!borderfill) return; @@ -1350,7 +1350,7 @@ void CJX_Object::Script_Som_FillColor(CFXJSE_Value* pValue, void CJX_Object::Script_Som_BorderColor(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { - CXFA_Border* border = ToNode(object_.Get())->GetOrCreateBorder(); + CXFA_Border* border = ToNode(object_.Get())->GetOrCreateBorderIfPossible(); int32_t iSize = border->CountEdges(); if (bSetting) { int32_t r = 0; @@ -1377,7 +1377,7 @@ void CJX_Object::Script_Som_BorderColor(CFXJSE_Value* pValue, void CJX_Object::Script_Som_BorderWidth(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { - CXFA_Border* border = ToNode(object_.Get())->GetOrCreateBorder(); + CXFA_Border* border = ToNode(object_.Get())->GetOrCreateBorderIfPossible(); if (bSetting) { CXFA_Measurement thickness = border->GetEdge(0)->GetMSThickness(); pValue->SetString(thickness.ToString().UTF8Encode().AsStringView()); diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index b04e427a10..a8de4907e0 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -1534,7 +1534,7 @@ CXFA_Border* CXFA_Node::GetBorderIfExists() const { return JSObject()->GetProperty(0, XFA_Element::Border); } -CXFA_Border* CXFA_Node::GetOrCreateBorder() { +CXFA_Border* CXFA_Node::GetOrCreateBorderIfPossible() { return JSObject()->GetOrCreateProperty(0, XFA_Element::Border); } diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index 2ada0083a0..57ab3cae8c 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h @@ -237,7 +237,7 @@ class CXFA_Node : public CXFA_Object { bool IsOpenAccess(); CXFA_Border* GetBorderIfExists() const; - CXFA_Border* GetOrCreateBorder(); + CXFA_Border* GetOrCreateBorderIfPossible(); CXFA_Caption* GetCaptionIfExists() const; CXFA_Font* GetFont() const; -- cgit v1.2.3