summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-10 18:44:45 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-10 18:44:45 +0000
commit4f261fffddddd97602e88fe462fef1a18a0b4782 (patch)
treee3a93a859d189a5fe46791d7954396b2b394cbd4 /fpdfsdk/formfiller
parentb353f8c32b2d17cbea5ace6eb5f7edb8663e37be (diff)
downloadpdfium-4f261fffddddd97602e88fe462fef1a18a0b4782.tar.xz
Get rid of non-const ref parameter in CPDFSDK_InterForm::OnFormat().
Return Optional<WideString> instead. Change the call stack to accept Optional<WideString>. Change-Id: I020589fac8a1de4974070268a19b4acad64c4092 Reviewed-on: https://pdfium-review.googlesource.com/c/43601 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_interactiveformfiller.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 329224d2b2..cb36de732e 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -718,13 +718,12 @@ void CFFL_InteractiveFormFiller::OnFormat(CPDFSDK_Annot::ObservedPtr* pAnnot,
ASSERT(pWidget);
CPDFSDK_InterForm* pInterForm = pPageView->GetFormFillEnv()->GetInterForm();
- bool bFormatted = false;
- WideString sValue = pInterForm->OnFormat(pWidget->GetFormField(), bFormatted);
+ Optional<WideString> sValue = pInterForm->OnFormat(pWidget->GetFormField());
if (!(*pAnnot))
return;
- if (bFormatted) {
- pInterForm->ResetFieldAppearance(pWidget->GetFormField(), &sValue, true);
+ if (sValue.has_value()) {
+ pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue, true);
pInterForm->UpdateField(pWidget->GetFormField());
}