From ccd7899b2d662c0a1be6cd52c6b6068472c27375 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 10 Jan 2018 19:44:16 +0000 Subject: Rename GetOrCreateFont to GetOrCreateFontIfPossible This CL makes it explicit that GetOrCreateFontIfPossible can return nullptr. Change-Id: Ib5be6995e4225ad596dfb78a94f0bc56802716cc Reviewed-on: https://pdfium-review.googlesource.com/22674 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- fxjs/xfa/cjx_object.cpp | 2 +- xfa/fxfa/parser/cxfa_node.cpp | 2 +- xfa/fxfa/parser/cxfa_node.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp index 8f528c8544..a1d9dafd7b 100644 --- a/fxjs/xfa/cjx_object.cpp +++ b/fxjs/xfa/cjx_object.cpp @@ -1297,7 +1297,7 @@ void CJX_Object::Script_Attribute_Integer(CFXJSE_Value* pValue, void CJX_Object::Script_Som_FontColor(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { - CXFA_Font* font = ToNode(object_.Get())->GetOrCreateFont(); + CXFA_Font* font = ToNode(object_.Get())->GetOrCreateFontIfPossible(); if (!font) return; diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 8c0b1956fe..d44b203f8c 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -1542,7 +1542,7 @@ CXFA_Caption* CXFA_Node::GetCaptionIfExists() const { return JSObject()->GetProperty(0, XFA_Element::Caption); } -CXFA_Font* CXFA_Node::GetOrCreateFont() { +CXFA_Font* CXFA_Node::GetOrCreateFontIfPossible() { return JSObject()->GetOrCreateProperty(0, XFA_Element::Font); } diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index 673c430dbb..69cd12c86b 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h @@ -241,7 +241,7 @@ class CXFA_Node : public CXFA_Object { CXFA_Caption* GetCaptionIfExists() const; CXFA_Font* GetFontIfExists() const; - CXFA_Font* GetOrCreateFont(); + CXFA_Font* GetOrCreateFontIfPossible(); float GetFontSize() const; FX_ARGB GetTextColor() const; float GetLineHeight() const; -- cgit v1.2.3