From 111488c5e811a5888f08348ef1b4de1f728785db Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Thu, 19 Oct 2017 14:30:15 -0400 Subject: Cleanup visiblity in Field This CL shuffles some methods around in the Field declaration and cleans up the visibility as needed. Change-Id: Icff3bd791d734c3baa69fd092a2f96058eaf62fd Reviewed-on: https://pdfium-review.googlesource.com/16370 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- fpdfsdk/javascript/Document.cpp | 6 +++--- fpdfsdk/javascript/Field.h | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'fpdfsdk') 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> DelayDataForFieldAndControlIndex; + std::vector> 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; -- cgit v1.2.3