summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Document.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-11 10:39:49 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-11 10:39:49 -0700
commit3a7741a2d9391fdbc54900695a980344dddf1692 (patch)
treec84367c005b25ad7a6cbba0ca6db53662455dd35 /fpdfsdk/javascript/Document.cpp
parentb402b1738d665561dd1bb7ffba0c3f3d49425086 (diff)
downloadpdfium-3a7741a2d9391fdbc54900695a980344dddf1692.tar.xz
Convert Field to use CPDFSDK_FormFillEnvironment
This CL changes Field from using a CPDFSDK_Document to using a CPDFSDK_FormFillEnvironment. Review-Url: https://codereview.chromium.org/2400443005
Diffstat (limited to 'fpdfsdk/javascript/Document.cpp')
-rw-r--r--fpdfsdk/javascript/Document.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index f5779aa438..bd9e540cf3 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -887,8 +887,10 @@ FX_BOOL Document::delay(IJS_Context* cc,
} else {
std::list<std::unique_ptr<CJS_DelayData>> DelayDataToProcess;
DelayDataToProcess.swap(m_DelayData);
- for (const auto& pData : DelayDataToProcess)
- Field::DoDelay(m_pDocument.Get(), pData.get());
+ for (const auto& pData : DelayDataToProcess) {
+ if (m_pDocument.Get())
+ Field::DoDelay(m_pDocument->GetEnv(), pData.get());
+ }
}
}
return TRUE;
@@ -1721,8 +1723,10 @@ void Document::DoFieldDelay(const CFX_WideString& sFieldName,
}
}
- for (const auto& pData : DelayDataForFieldAndControlIndex)
- Field::DoDelay(m_pDocument.Get(), pData.get());
+ for (const auto& pData : DelayDataForFieldAndControlIndex) {
+ if (m_pDocument.Get())
+ Field::DoDelay(m_pDocument->GetEnv(), pData.get());
+ }
}
CJS_Document* Document::GetCJSDoc() const {