summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxfa/cxfa_textparser.cpp16
-rw-r--r--xfa/fxfa/cxfa_textparser.h4
-rw-r--r--xfa/fxfa/cxfa_textprovider.cpp6
-rw-r--r--xfa/fxfa/cxfa_textprovider.h4
4 files changed, 11 insertions, 19 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(
diff --git a/xfa/fxfa/cxfa_textparser.h b/xfa/fxfa/cxfa_textparser.h
index 591606074e..70c153bfab 100644
--- a/xfa/fxfa/cxfa_textparser.h
+++ b/xfa/fxfa/cxfa_textparser.h
@@ -80,8 +80,8 @@ class CXFA_TextParser {
bool bFirst,
float fVerScale) const;
- Optional<WideString> GetEmbeddedObj(CXFA_TextProvider* pTextProvider,
- CFX_XMLNode* pXMLNode);
+ Optional<WideString> GetEmbeddedObj(const CXFA_TextProvider* pTextProvider,
+ const CFX_XMLNode* pXMLNode);
CXFA_TextParseContext* GetParseContextFromMap(CFX_XMLNode* pXMLNode);
protected:
diff --git a/xfa/fxfa/cxfa_textprovider.cpp b/xfa/fxfa/cxfa_textprovider.cpp
index b46bf345f9..53a70a2f65 100644
--- a/xfa/fxfa/cxfa_textprovider.cpp
+++ b/xfa/fxfa/cxfa_textprovider.cpp
@@ -137,10 +137,8 @@ bool CXFA_TextProvider::IsCheckButtonAndAutoWidth() const {
}
Optional<WideString> CXFA_TextProvider::GetEmbeddedObj(
- bool bURI,
- bool bRaw,
- const WideString& wsAttr) {
- if (m_eType != XFA_TEXTPROVIDERTYPE_Text || !bURI)
+ const WideString& wsAttr) const {
+ if (m_eType != XFA_TEXTPROVIDERTYPE_Text)
return {};
CXFA_Node* pParent = m_pNode->GetParent();
diff --git a/xfa/fxfa/cxfa_textprovider.h b/xfa/fxfa/cxfa_textprovider.h
index d6f00056f0..eb16fe227b 100644
--- a/xfa/fxfa/cxfa_textprovider.h
+++ b/xfa/fxfa/cxfa_textprovider.h
@@ -35,9 +35,7 @@ class CXFA_TextProvider {
CXFA_Para* GetParaIfExists();
CXFA_Font* GetFontIfExists();
bool IsCheckButtonAndAutoWidth() const;
- Optional<WideString> GetEmbeddedObj(bool bURI,
- bool bRaw,
- const WideString& wsAttr);
+ Optional<WideString> GetEmbeddedObj(const WideString& wsAttr) const;
private:
CXFA_Node* m_pNode; // Raw, this class owned by tree node.