summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/javascript')
-rw-r--r--fpdfsdk/javascript/Document.cpp6
-rw-r--r--fpdfsdk/javascript/Field.h13
2 files changed, 9 insertions, 10 deletions
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index e7dee1cefa..10947c8032 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -1805,18 +1805,18 @@ void Document::AddDelayData(CJS_DelayData* pData) {
}
void Document::DoFieldDelay(const WideString& sFieldName, int nControlIndex) {
- std::vector<std::unique_ptr<CJS_DelayData>> DelayDataForFieldAndControlIndex;
+ std::vector<std::unique_ptr<CJS_DelayData>> delayed_data;
auto iter = m_DelayData.begin();
while (iter != m_DelayData.end()) {
auto old = iter++;
if ((*old)->sFieldName == sFieldName &&
(*old)->nControlIndex == nControlIndex) {
- DelayDataForFieldAndControlIndex.push_back(std::move(*old));
+ delayed_data.push_back(std::move(*old));
m_DelayData.erase(old);
}
}
- for (const auto& pData : DelayDataForFieldAndControlIndex)
+ for (const auto& pData : delayed_data)
Field::DoDelay(m_pFormFillEnv.Get(), pData.get());
}
diff --git a/fpdfsdk/javascript/Field.h b/fpdfsdk/javascript/Field.h
index bd90ff74df..7284153352 100644
--- a/fpdfsdk/javascript/Field.h
+++ b/fpdfsdk/javascript/Field.h
@@ -74,6 +74,9 @@ struct CJS_DelayData {
class Field : public CJS_EmbedObj {
public:
+ static void DoDelay(CPDFSDK_FormFillEnvironment* pFormFillEnv,
+ CJS_DelayData* pData);
+
explicit Field(CJS_Object* pJSObject);
~Field() override;
@@ -522,6 +525,9 @@ class Field : public CJS_EmbedObj {
CJS_Value& vRet,
WideString& sError);
+ bool AttachField(Document* pDocument, const WideString& csFieldName);
+
+ private:
static void SetAlignment(CPDFSDK_FormFillEnvironment* pFormFillEnv,
const WideString& swFieldName,
int nControlIndex,
@@ -677,13 +683,7 @@ class Field : public CJS_EmbedObj {
CPDFSDK_FormFillEnvironment* pFormFillEnv,
const WideString& csFieldName);
- static void DoDelay(CPDFSDK_FormFillEnvironment* pFormFillEnv,
- CJS_DelayData* pData);
-
- bool AttachField(Document* pDocument, const WideString& csFieldName);
void SetDelay(bool bDelay);
-
- protected:
void ParseFieldName(const std::wstring& strFieldNameParsed,
std::wstring& strFieldName,
int& iControlNo);
@@ -704,7 +704,6 @@ class Field : public CJS_EmbedObj {
void DoDelay();
- public:
Document* m_pJSDoc;
CPDFSDK_FormFillEnvironment::ObservedPtr m_pFormFillEnv;
WideString m_FieldName;