summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_textprovider.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-21 20:52:02 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-21 20:52:02 +0000
commit7af775a00379e84c0da1ab81695583eb7daaec3a (patch)
treea302accbd2463976903b102f01db0c588b5e1859 /xfa/fxfa/cxfa_textprovider.cpp
parente4110926f26fcd9a906b2ceb722a4f3b50461130 (diff)
downloadpdfium-7af775a00379e84c0da1ab81695583eb7daaec3a.tar.xz
Change GetEmbbedObj() to return an Optional<WideString>.
Change "EmbbedObj" to "EmbeddedObj". Change-Id: Ia6a8ec45b4563b3ec64b91a10e087dbf32a8d8db Reviewed-on: https://pdfium-review.googlesource.com/40751 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_textprovider.cpp')
-rw-r--r--xfa/fxfa/cxfa_textprovider.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/xfa/fxfa/cxfa_textprovider.cpp b/xfa/fxfa/cxfa_textprovider.cpp
index ba48cd8490..b46bf345f9 100644
--- a/xfa/fxfa/cxfa_textprovider.cpp
+++ b/xfa/fxfa/cxfa_textprovider.cpp
@@ -130,21 +130,18 @@ CXFA_Font* CXFA_TextProvider::GetFontIfExists() {
return font ? font : m_pNode->GetFontIfExists();
}
-bool CXFA_TextProvider::IsCheckButtonAndAutoWidth() {
+bool CXFA_TextProvider::IsCheckButtonAndAutoWidth() const {
if (m_pNode->GetFFWidgetType() != XFA_FFWidgetType::kCheckButton)
return false;
return !m_pNode->TryWidth();
}
-bool CXFA_TextProvider::GetEmbbedObj(bool bURI,
- bool bRaw,
- const WideString& wsAttr,
- WideString& wsValue) {
- if (m_eType != XFA_TEXTPROVIDERTYPE_Text)
- return false;
-
- if (!bURI)
- return false;
+Optional<WideString> CXFA_TextProvider::GetEmbeddedObj(
+ bool bURI,
+ bool bRaw,
+ const WideString& wsAttr) {
+ if (m_eType != XFA_TEXTPROVIDERTYPE_Text || !bURI)
+ return {};
CXFA_Node* pParent = m_pNode->GetParent();
CXFA_Document* pDocument = m_pNode->GetDocument();
@@ -158,8 +155,7 @@ bool CXFA_TextProvider::GetEmbbedObj(bool bURI,
wsAttr.AsStringView());
}
if (!pIDNode || !pIDNode->IsWidgetReady())
- return false;
+ return {};
- wsValue = pIDNode->GetValue(XFA_VALUEPICTURE_Display);
- return true;
+ return pIDNode->GetValue(XFA_VALUEPICTURE_Display);
}