summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_textprovider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/cxfa_textprovider.cpp')
-rw-r--r--xfa/fxfa/cxfa_textprovider.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/xfa/fxfa/cxfa_textprovider.cpp b/xfa/fxfa/cxfa_textprovider.cpp
index e23fdec01a..544a5c26b9 100644
--- a/xfa/fxfa/cxfa_textprovider.cpp
+++ b/xfa/fxfa/cxfa_textprovider.cpp
@@ -45,10 +45,9 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(bool& bRichText) {
CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild);
if (pChildNode && pChildNode->GetElementType() == XFA_Element::ExData) {
- WideString wsContentType;
- pChildNode->JSNode()->GetAttribute(XFA_Attribute::ContentType,
- wsContentType, false);
- if (wsContentType == L"text/html")
+ pdfium::Optional<WideString> contentType =
+ pChildNode->JSNode()->TryAttribute(XFA_Attribute::ContentType, false);
+ if (contentType && *contentType == L"text/html")
bRichText = true;
}
return pChildNode;
@@ -84,10 +83,9 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(bool& bRichText) {
CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild);
if (pChildNode && pChildNode->GetElementType() == XFA_Element::ExData) {
- WideString wsContentType;
- pChildNode->JSNode()->GetAttribute(XFA_Attribute::ContentType,
- wsContentType, false);
- if (wsContentType == L"text/html")
+ pdfium::Optional<WideString> contentType =
+ pChildNode->JSNode()->TryAttribute(XFA_Attribute::ContentType, false);
+ if (contentType && *contentType == L"text/html")
bRichText = true;
}
return pChildNode;