diff options
author | Lei Zhang <thestig@chromium.org> | 2018-08-22 14:38:30 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-22 14:38:30 +0000 |
commit | d4f4ce4b9c35db40d2dc3720ba07a83cff1b547d (patch) | |
tree | a9da9c73d0c59a492ef5ed48b6e3c4e85821b5fa /xfa/fxfa/cxfa_textparser.cpp | |
parent | 3caad939aeadce0d4278c130ce19dfd0692a8b98 (diff) | |
download | pdfium-d4f4ce4b9c35db40d2dc3720ba07a83cff1b547d.tar.xz |
Simplify GetEmbeddedObj() methods.
Change-Id: I976a8841f1519310cbf934103336dc050a7c293d
Reviewed-on: https://pdfium-review.googlesource.com/40773
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_textparser.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_textparser.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/xfa/fxfa/cxfa_textparser.cpp b/xfa/fxfa/cxfa_textparser.cpp index 0d1c52fab7..b2b47474bf 100644 --- a/xfa/fxfa/cxfa_textparser.cpp +++ b/xfa/fxfa/cxfa_textparser.cpp @@ -496,12 +496,12 @@ float CXFA_TextParser::GetLineHeight(CXFA_TextProvider* pTextProvider, } Optional<WideString> CXFA_TextParser::GetEmbeddedObj( - CXFA_TextProvider* pTextProvider, - CFX_XMLNode* pXMLNode) { + const CXFA_TextProvider* pTextProvider, + const CFX_XMLNode* pXMLNode) { if (!pXMLNode) return {}; - CFX_XMLElement* pElement = ToXMLElement(pXMLNode); + const CFX_XMLElement* pElement = ToXMLElement(pXMLNode); if (!pElement) return {}; @@ -517,9 +517,7 @@ Optional<WideString> CXFA_TextParser::GetEmbeddedObj( ws = L"som"; else ws.MakeLower(); - - bool bURI = (ws == L"uri"); - if (!bURI && ws != L"som") + if (ws != L"uri") return {}; ws = pElement->GetAttribute(L"xfa:embedMode"); @@ -527,12 +525,10 @@ Optional<WideString> CXFA_TextParser::GetEmbeddedObj( ws = L"formatted"; else ws.MakeLower(); - - bool bRaw = (ws == L"raw"); - if (!bRaw && ws != L"formatted") + if (ws != L"raw" && ws != L"formatted") return {}; - return pTextProvider->GetEmbeddedObj(bURI, bRaw, wsAttr); + return pTextProvider->GetEmbeddedObj(wsAttr); } CXFA_TextParseContext* CXFA_TextParser::GetParseContextFromMap( |