summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-10 18:39:14 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-10 18:39:14 +0000
commitb353f8c32b2d17cbea5ace6eb5f7edb8663e37be (patch)
treead10260cd60754e1b9aa521db6a524b48462b5e9 /fpdfsdk/formfiller
parent461acb276e1c38c9ebb3546c5b3254fa5cf9c585 (diff)
downloadpdfium-b353f8c32b2d17cbea5ace6eb5f7edb8663e37be.tar.xz
Use pdfium::Optional in CPDFSDK_Widget.
Also make some methods const. Change-Id: Ie2d0f7e691ad9448b4e77227ce3c0b2b065e0da0 Reviewed-on: https://pdfium-review.googlesource.com/c/43602 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/formfiller')
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index 4b94bde271..94d80cae01 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -340,16 +340,18 @@ CPWL_Wnd::CreateParams CFFL_FormFiller::GetCreateParam() {
if (dwFieldFlag & FIELDFLAG_READONLY)
dwCreateFlags |= PWS_READONLY;
- FX_COLORREF color;
- if (m_pWidget->GetFillColor(color))
- cp.sBackgroundColor = CFX_Color(color);
- if (m_pWidget->GetBorderColor(color))
- cp.sBorderColor = CFX_Color(color);
+ Optional<FX_COLORREF> color = m_pWidget->GetFillColor();
+ if (color.has_value())
+ cp.sBackgroundColor = CFX_Color(color.value());
+ color = m_pWidget->GetBorderColor();
+ if (color.has_value())
+ cp.sBorderColor = CFX_Color(color.value());
cp.sTextColor = CFX_Color(CFX_Color::kGray, 0);
- if (m_pWidget->GetTextColor(color))
- cp.sTextColor = CFX_Color(color);
+ color = m_pWidget->GetTextColor();
+ if (color.has_value())
+ cp.sTextColor = CFX_Color(color.value());
cp.fFontSize = m_pWidget->GetFontSize();
cp.dwBorderWidth = m_pWidget->GetBorderWidth();