summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-10 19:34:57 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-10 19:34:57 +0000
commit1e6490da6fb813930d1073ac05ace8a21fa9ca28 (patch)
treed1849bda5efcb3b3cd7c4a39580d36228b4ab696 /xfa/fxfa/parser
parenta74e75d69594e469906e2a95b5f2394c88acbe7a (diff)
downloadpdfium-1e6490da6fb813930d1073ac05ace8a21fa9ca28.tar.xz
Rename GetCaption to GetCaptionIfExists
This CL renames GetCaption to GetCaptionIfExists to make it clear the value returned can be a nullptr. The various callsites have been fixed which used the caption without validating. Change-Id: I9b600ac9ab5b9e04dfa6e8cee95ef3e9d629688d Reviewed-on: https://pdfium-review.googlesource.com/22670 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_node.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 02d1c0f6f3..b04e427a10 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -1538,7 +1538,7 @@ CXFA_Border* CXFA_Node::GetOrCreateBorder() {
return JSObject()->GetOrCreateProperty<CXFA_Border>(0, XFA_Element::Border);
}
-CXFA_Caption* CXFA_Node::GetCaption() const {
+CXFA_Caption* CXFA_Node::GetCaptionIfExists() const {
return JSObject()->GetProperty<CXFA_Caption>(0, XFA_Element::Caption);
}
@@ -1917,7 +1917,7 @@ WideString CXFA_Node::GetValidateCaptionName(bool bVersionFlag) {
WideString wsCaptionName;
if (!bVersionFlag) {
- CXFA_Caption* caption = GetCaption();
+ CXFA_Caption* caption = GetCaptionIfExists();
if (caption) {
CXFA_Value* capValue = caption->GetValue();
if (capValue) {
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h
index b175a83a84..2ada0083a0 100644
--- a/xfa/fxfa/parser/cxfa_node.h
+++ b/xfa/fxfa/parser/cxfa_node.h
@@ -238,7 +238,7 @@ class CXFA_Node : public CXFA_Object {
CXFA_Border* GetBorderIfExists() const;
CXFA_Border* GetOrCreateBorder();
- CXFA_Caption* GetCaption() const;
+ CXFA_Caption* GetCaptionIfExists() const;
CXFA_Font* GetFont() const;
CXFA_Font* GetOrCreateFont();