Rename pFormFiller variables to pFormField Same with GetFormFiller methods. Fixed: pdfium:1673 Change-Id: I156c9dc219dbf22e11b1b5f879833a2dc86fa0c8 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/81170 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp index 2ba3aec..427fb27 100644 --- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp +++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -110,16 +110,16 @@ } void CPDFSDK_FormFillEnvironment::OutputSelectedRect( - CFFL_FormField* pFormFiller, + CFFL_FormField* pFormField, const CFX_FloatRect& rect) { - if (!pFormFiller || !m_pInfo || !m_pInfo->FFI_OutputSelectedRect) + if (!pFormField || !m_pInfo || !m_pInfo->FFI_OutputSelectedRect) return; - auto* pPage = FPDFPageFromIPDFPage(pFormFiller->GetSDKAnnot()->GetPage()); + auto* pPage = FPDFPageFromIPDFPage(pFormField->GetSDKAnnot()->GetPage()); DCHECK(pPage); - CFX_PointF ptA = pFormFiller->PWLtoFFL(CFX_PointF(rect.left, rect.bottom)); - CFX_PointF ptB = pFormFiller->PWLtoFFL(CFX_PointF(rect.right, rect.top)); + CFX_PointF ptA = pFormField->PWLtoFFL(CFX_PointF(rect.left, rect.bottom)); + CFX_PointF ptB = pFormField->PWLtoFFL(CFX_PointF(rect.right, rect.top)); m_pInfo->FFI_OutputSelectedRect(m_pInfo, pPage, ptA.x, ptB.y, ptB.x, ptA.y); }
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.h b/fpdfsdk/cpdfsdk_formfillenvironment.h index fa76a56..78a35f0 100644 --- a/fpdfsdk/cpdfsdk_formfillenvironment.h +++ b/fpdfsdk/cpdfsdk_formfillenvironment.h
@@ -61,7 +61,7 @@ // IPWL_SystemHandler: void InvalidateRect(PerWindowData* pWidgetData, const CFX_FloatRect& rect) override; - void OutputSelectedRect(CFFL_FormField* pFormFiller, + void OutputSelectedRect(CFFL_FormField* pFormField, const CFX_FloatRect& rect) override; bool IsSelectionImplemented() const override; void SetCursor(CursorStyle nCursorType) override;
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp index 88bcc45..38004b2 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -42,8 +42,8 @@ FX_RECT CFFL_InteractiveFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) { - if (CFFL_FormField* pFormFiller = GetFormFiller(pAnnot)) - return pFormFiller->GetViewBBox(pPageView); + if (CFFL_FormField* pFormField = GetFormField(pAnnot)) + return pFormField->GetViewBBox(pPageView); DCHECK(pPageView); @@ -65,13 +65,13 @@ if (!IsVisible(pWidget)) return; - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot); - if (pFormFiller && pFormFiller->IsValid()) { - pFormFiller->OnDraw(pPageView, pAnnot, pDevice, mtUser2Device); + CFFL_FormField* pFormField = GetFormField(pAnnot); + if (pFormField && pFormField->IsValid()) { + pFormField->OnDraw(pPageView, pAnnot, pDevice, mtUser2Device); if (m_pFormFillEnv->GetFocusAnnot() != pAnnot) return; - CFX_FloatRect rcFocus = pFormFiller->GetFocusBox(pPageView); + CFX_FloatRect rcFocus = pFormField->GetFocusBox(pPageView); if (rcFocus.IsEmpty()) return; @@ -80,8 +80,8 @@ return; } - if (pFormFiller) { - pFormFiller->OnDrawDeactive(pPageView, pAnnot, pDevice, mtUser2Device); + if (pFormField) { + pFormField->OnDrawDeactive(pPageView, pAnnot, pDevice, mtUser2Device); } else { pWidget->DrawAppearance(pDevice, mtUser2Device, CPDF_Annot::Normal, nullptr); @@ -92,7 +92,7 @@ } void CFFL_InteractiveFormFiller::OnDelete(CPDFSDK_Annot* pAnnot) { - UnRegisterFormFiller(pAnnot); + UnregisterFormField(pAnnot); } void CFFL_InteractiveFormFiller::OnMouseEnter( @@ -119,15 +119,15 @@ return; if (pWidget->IsAppModified()) { - if (CFFL_FormField* pFormFiller = GetFormFiller(pWidget)) { - pFormFiller->ResetPWLWindow(pPageView, - pWidget->GetValueAge() == nValueAge); + if (CFFL_FormField* pFormField = GetFormField(pWidget)) { + pFormField->ResetPWLWindow(pPageView, + pWidget->GetValueAge() == nValueAge); } } } } - if (CFFL_FormField* pFormFiller = GetOrCreateFormFiller(pAnnot->Get())) - pFormFiller->OnMouseEnter(pPageView); + if (CFFL_FormField* pFormField = GetOrCreateFormField(pAnnot->Get())) + pFormField->OnMouseEnter(pPageView); } void CFFL_InteractiveFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, @@ -153,15 +153,15 @@ return; if (pWidget->IsAppModified()) { - if (CFFL_FormField* pFormFiller = GetFormFiller(pWidget)) { - pFormFiller->ResetPWLWindow(pPageView, - nValueAge == pWidget->GetValueAge()); + if (CFFL_FormField* pFormField = GetFormField(pWidget)) { + pFormField->ResetPWLWindow(pPageView, + nValueAge == pWidget->GetValueAge()); } } } } - if (CFFL_FormField* pFormFiller = GetFormFiller(pAnnot->Get())) - pFormFiller->OnMouseExit(pPageView); + if (CFFL_FormField* pFormField = GetFormField(pAnnot->Get())) + pFormField->OnMouseExit(pPageView); } bool CFFL_InteractiveFormFiller::OnLButtonDown( @@ -193,16 +193,16 @@ return true; if (pWidget->IsAppModified()) { - if (CFFL_FormField* pFormFiller = GetFormFiller(pWidget)) { - pFormFiller->ResetPWLWindow(pPageView, - nValueAge == pWidget->GetValueAge()); + if (CFFL_FormField* pFormField = GetFormField(pWidget)) { + pFormField->ResetPWLWindow(pPageView, + nValueAge == pWidget->GetValueAge()); } } } } - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot->Get()); - return pFormFiller && - pFormFiller->OnLButtonDown(pPageView, pAnnot->Get(), nFlags, point); + CFFL_FormField* pFormField = GetFormField(pAnnot->Get()); + return pFormField && + pFormField->OnLButtonDown(pPageView, pAnnot->Get(), nFlags, point); } bool CFFL_InteractiveFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, @@ -230,9 +230,9 @@ if (bSetFocus) m_pFormFillEnv->SetFocusAnnot(pAnnot); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot->Get()); - bool bRet = pFormFiller && - pFormFiller->OnLButtonUp(pPageView, pAnnot->Get(), nFlags, point); + CFFL_FormField* pFormField = GetFormField(pAnnot->Get()); + bool bRet = pFormField && + pFormField->OnLButtonUp(pPageView, pAnnot->Get(), nFlags, point); if (m_pFormFillEnv->GetFocusAnnot() != pAnnot->Get()) return bRet; if (OnButtonUp(pAnnot, pPageView, nFlags) || !pAnnot) @@ -270,9 +270,9 @@ if (nAge == pWidget->GetAppearanceAge()) return false; - CFFL_FormField* pFormFiller = GetFormFiller(pWidget); - if (pFormFiller) - pFormFiller->ResetPWLWindow(pPageView, nValueAge == pWidget->GetValueAge()); + CFFL_FormField* pFormField = GetFormField(pWidget); + if (pFormField) + pFormField->ResetPWLWindow(pPageView, nValueAge == pWidget->GetValueAge()); return true; } @@ -283,8 +283,8 @@ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot->Get()); - return pFormFiller && pFormFiller->SetIndexSelected(index, selected); + CFFL_FormField* pFormField = GetFormField(pAnnot->Get()); + return pFormField && pFormField->SetIndexSelected(index, selected); } bool CFFL_InteractiveFormFiller::IsIndexSelected( @@ -293,8 +293,8 @@ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot->Get()); - return pFormFiller && pFormFiller->IsIndexSelected(index); + CFFL_FormField* pFormField = GetFormField(pAnnot->Get()); + return pFormField && pFormField->IsIndexSelected(index); } bool CFFL_InteractiveFormFiller::OnLButtonDblClk( @@ -304,8 +304,8 @@ const CFX_PointF& point) { DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot->Get()); - return pFormFiller && pFormFiller->OnLButtonDblClk(pPageView, nFlags, point); + CFFL_FormField* pFormField = GetFormField(pAnnot->Get()); + return pFormField && pFormField->OnLButtonDblClk(pPageView, nFlags, point); } bool CFFL_InteractiveFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, @@ -314,8 +314,8 @@ const CFX_PointF& point) { DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetOrCreateFormFiller(pAnnot->Get()); - return pFormFiller && pFormFiller->OnMouseMove(pPageView, nFlags, point); + CFFL_FormField* pFormField = GetOrCreateFormField(pAnnot->Get()); + return pFormField && pFormField->OnMouseMove(pPageView, nFlags, point); } bool CFFL_InteractiveFormFiller::OnMouseWheel( @@ -326,9 +326,9 @@ const CFX_Vector& delta) { DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot->Get()); - return pFormFiller && - pFormFiller->OnMouseWheel(pPageView, nFlags, point, delta); + CFFL_FormField* pFormField = GetFormField(pAnnot->Get()); + return pFormField && + pFormField->OnMouseWheel(pPageView, nFlags, point, delta); } bool CFFL_InteractiveFormFiller::OnRButtonDown( @@ -338,8 +338,8 @@ const CFX_PointF& point) { DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot->Get()); - return pFormFiller && pFormFiller->OnRButtonDown(pPageView, nFlags, point); + CFFL_FormField* pFormField = GetFormField(pAnnot->Get()); + return pFormField && pFormField->OnRButtonDown(pPageView, nFlags, point); } bool CFFL_InteractiveFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, @@ -348,8 +348,8 @@ const CFX_PointF& point) { DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot->Get()); - return pFormFiller && pFormFiller->OnRButtonUp(pPageView, nFlags, point); + CFFL_FormField* pFormField = GetFormField(pAnnot->Get()); + return pFormField && pFormField->OnRButtonUp(pPageView, nFlags, point); } bool CFFL_InteractiveFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, @@ -357,8 +357,8 @@ uint32_t nFlags) { DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot); - return pFormFiller && pFormFiller->OnKeyDown(nKeyCode, nFlags); + CFFL_FormField* pFormField = GetFormField(pAnnot); + return pFormField && pFormField->OnKeyDown(nKeyCode, nFlags); } bool CFFL_InteractiveFormFiller::OnChar(CPDFSDK_Annot* pAnnot, @@ -368,8 +368,8 @@ if (nChar == FWL_VKEY_Tab) return true; - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot); - return pFormFiller && pFormFiller->OnChar(pAnnot, nChar, nFlags); + CFFL_FormField* pFormField = GetFormField(pAnnot); + return pFormField && pFormField->OnChar(pAnnot, nChar, nFlags); } bool CFFL_InteractiveFormFiller::OnSetFocus(ObservedPtr<CPDFSDK_Annot>* pAnnot, @@ -387,8 +387,8 @@ uint32_t nValueAge = pWidget->GetValueAge(); pWidget->ClearAppModified(); - CFFL_FormField* pFormFiller = GetOrCreateFormFiller(pWidget); - if (!pFormFiller) + CFFL_FormField* pFormField = GetOrCreateFormField(pWidget); + if (!pFormField) return false; CPDFSDK_PageView* pPageView = (*pAnnot)->GetPageView(); @@ -397,14 +397,14 @@ CPDFSDK_FieldAction fa; fa.bModifier = CPWL_Wnd::IsCTRLKeyDown(nFlag); fa.bShift = CPWL_Wnd::IsSHIFTKeyDown(nFlag); - pFormFiller->GetActionData(pPageView, CPDF_AAction::kGetFocus, fa); + pFormField->GetActionData(pPageView, CPDF_AAction::kGetFocus, fa); pWidget->OnAAction(CPDF_AAction::kGetFocus, &fa, pPageView); m_bNotifying = false; if (!pAnnot->HasObservable()) return false; if (pWidget->IsAppModified()) { - if (CFFL_FormField* pFiller = GetFormFiller(pWidget)) { + if (CFFL_FormField* pFiller = GetFormField(pWidget)) { pFiller->ResetPWLWindow(pPageView, nValueAge == pWidget->GetValueAge()); } @@ -412,8 +412,8 @@ } } - if (CFFL_FormField* pFormFiller = GetOrCreateFormFiller(pAnnot->Get())) - pFormFiller->SetFocusForAnnot(pAnnot->Get(), nFlag); + if (CFFL_FormField* pFormField = GetOrCreateFormField(pAnnot->Get())) + pFormField->SetFocusForAnnot(pAnnot->Get(), nFlag); return true; } @@ -425,11 +425,11 @@ DCHECK_EQ((*pAnnot)->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot->Get()); - if (!pFormFiller) + CFFL_FormField* pFormField = GetFormField(pAnnot->Get()); + if (!pFormField) return true; - pFormFiller->KillFocusForAnnot(nFlag); + pFormField->KillFocusForAnnot(nFlag); if (!pAnnot->HasObservable()) return false; @@ -449,7 +449,7 @@ CPDFSDK_FieldAction fa; fa.bModifier = CPWL_Wnd::IsCTRLKeyDown(nFlag); fa.bShift = CPWL_Wnd::IsSHIFTKeyDown(nFlag); - pFormFiller->GetActionData(pPageView, CPDF_AAction::kLoseFocus, fa); + pFormField->GetActionData(pPageView, CPDF_AAction::kLoseFocus, fa); pWidget->OnAAction(CPDF_AAction::kLoseFocus, &fa, pPageView); m_bNotifying = false; return pAnnot->HasObservable(); @@ -475,43 +475,43 @@ pdfium::access_permissions::kModifyContent); } -CFFL_FormField* CFFL_InteractiveFormFiller::GetFormFiller( +CFFL_FormField* CFFL_InteractiveFormFiller::GetFormField( CPDFSDK_Annot* pAnnot) { auto it = m_Map.find(pAnnot); return it != m_Map.end() ? it->second.get() : nullptr; } -CFFL_FormField* CFFL_InteractiveFormFiller::GetOrCreateFormFiller( +CFFL_FormField* CFFL_InteractiveFormFiller::GetOrCreateFormField( CPDFSDK_Annot* pAnnot) { - CFFL_FormField* result = GetFormFiller(pAnnot); + CFFL_FormField* result = GetFormField(pAnnot); if (result) return result; CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot); - std::unique_ptr<CFFL_FormField> pFormFiller; + std::unique_ptr<CFFL_FormField> pFormField; switch (pWidget->GetFieldType()) { case FormFieldType::kPushButton: - pFormFiller = + pFormField = std::make_unique<CFFL_PushButton>(m_pFormFillEnv.Get(), pWidget); break; case FormFieldType::kCheckBox: - pFormFiller = + pFormField = std::make_unique<CFFL_CheckBox>(m_pFormFillEnv.Get(), pWidget); break; case FormFieldType::kRadioButton: - pFormFiller = + pFormField = std::make_unique<CFFL_RadioButton>(m_pFormFillEnv.Get(), pWidget); break; case FormFieldType::kTextField: - pFormFiller = + pFormField = std::make_unique<CFFL_TextField>(m_pFormFillEnv.Get(), pWidget); break; case FormFieldType::kListBox: - pFormFiller = + pFormField = std::make_unique<CFFL_ListBox>(m_pFormFillEnv.Get(), pWidget); break; case FormFieldType::kComboBox: - pFormFiller = + pFormField = std::make_unique<CFFL_ComboBox>(m_pFormFillEnv.Get(), pWidget); break; case FormFieldType::kUnknown: @@ -519,64 +519,64 @@ return nullptr; } - result = pFormFiller.get(); - m_Map[pAnnot] = std::move(pFormFiller); + result = pFormField.get(); + m_Map[pAnnot] = std::move(pFormField); return result; } WideString CFFL_InteractiveFormFiller::GetText(CPDFSDK_Annot* pAnnot) { DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot); - return pFormFiller ? pFormFiller->GetText() : WideString(); + CFFL_FormField* pFormField = GetFormField(pAnnot); + return pFormField ? pFormField->GetText() : WideString(); } WideString CFFL_InteractiveFormFiller::GetSelectedText(CPDFSDK_Annot* pAnnot) { DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot); - return pFormFiller ? pFormFiller->GetSelectedText() : WideString(); + CFFL_FormField* pFormField = GetFormField(pAnnot); + return pFormField ? pFormField->GetSelectedText() : WideString(); } void CFFL_InteractiveFormFiller::ReplaceSelection(CPDFSDK_Annot* pAnnot, const WideString& text) { DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot); - if (!pFormFiller) + CFFL_FormField* pFormField = GetFormField(pAnnot); + if (!pFormField) return; - pFormFiller->ReplaceSelection(text); + pFormField->ReplaceSelection(text); } bool CFFL_InteractiveFormFiller::SelectAllText(CPDFSDK_Annot* pAnnot) { DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot); - return pAnnot && pFormFiller->SelectAllText(); + CFFL_FormField* pFormField = GetFormField(pAnnot); + return pAnnot && pFormField->SelectAllText(); } bool CFFL_InteractiveFormFiller::CanUndo(CPDFSDK_Annot* pAnnot) { DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot); - return pFormFiller && pFormFiller->CanUndo(); + CFFL_FormField* pFormField = GetFormField(pAnnot); + return pFormField && pFormField->CanUndo(); } bool CFFL_InteractiveFormFiller::CanRedo(CPDFSDK_Annot* pAnnot) { DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot); - return pFormFiller && pFormFiller->CanRedo(); + CFFL_FormField* pFormField = GetFormField(pAnnot); + return pFormField && pFormField->CanRedo(); } bool CFFL_InteractiveFormFiller::Undo(CPDFSDK_Annot* pAnnot) { DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot); - return pFormFiller && pFormFiller->Undo(); + CFFL_FormField* pFormField = GetFormField(pAnnot); + return pFormField && pFormField->Undo(); } bool CFFL_InteractiveFormFiller::Redo(CPDFSDK_Annot* pAnnot) { DCHECK_EQ(pAnnot->GetPDFAnnot()->GetSubtype(), CPDF_Annot::Subtype::WIDGET); - CFFL_FormField* pFormFiller = GetFormFiller(pAnnot); - return pFormFiller && pFormFiller->Redo(); + CFFL_FormField* pFormField = GetFormField(pAnnot); + return pFormField && pFormField->Redo(); } -void CFFL_InteractiveFormFiller::UnRegisterFormFiller(CPDFSDK_Annot* pAnnot) { +void CFFL_InteractiveFormFiller::UnregisterFormField(CPDFSDK_Annot* pAnnot) { auto it = m_Map.find(pAnnot); if (it == m_Map.end()) return; @@ -667,9 +667,9 @@ fa.bKeyDown = true; fa.bRC = true; - CFFL_FormField* pFormFiller = GetFormFiller(pWidget); - pFormFiller->GetActionData(pPageView, CPDF_AAction::kKeyStroke, fa); - pFormFiller->SaveState(pPageView); + CFFL_FormField* pFormField = GetFormField(pWidget); + pFormField->GetActionData(pPageView, CPDF_AAction::kKeyStroke, fa); + pFormField->SaveState(pPageView); pWidget->OnAAction(CPDF_AAction::kKeyStroke, &fa, pPageView); if (!pAnnot->HasObservable()) return true; @@ -698,9 +698,9 @@ fa.bKeyDown = true; fa.bRC = true; - CFFL_FormField* pFormFiller = GetFormFiller(pWidget); - pFormFiller->GetActionData(pPageView, CPDF_AAction::kValidate, fa); - pFormFiller->SaveState(pPageView); + CFFL_FormField* pFormField = GetFormField(pWidget); + pFormField->GetActionData(pPageView, CPDF_AAction::kValidate, fa); + pFormField->SaveState(pPageView); pWidget->OnAAction(CPDF_AAction::kValidate, &fa, pPageView); if (!pAnnot->HasObservable()) return true; @@ -773,8 +773,8 @@ if (nAge == pWidget->GetAppearanceAge()) return false; - if (CFFL_FormField* pFormFiller = GetFormFiller(pWidget)) - pFormFiller->ResetPWLWindow(pPageView, nValueAge == pWidget->GetValueAge()); + if (CFFL_FormField* pFormField = GetFormField(pWidget)) + pFormField->ResetPWLWindow(pPageView, nValueAge == pWidget->GetValueAge()); return false; } @@ -803,8 +803,8 @@ if (nAge == pWidget->GetAppearanceAge()) return false; - if (CFFL_FormField* pFormFiller = GetFormFiller(pWidget)) - pFormFiller->ResetPWLWindow(pPageView, nValueAge == pWidget->GetValueAge()); + if (CFFL_FormField* pFormField = GetFormField(pWidget)) + pFormField->ResetPWLWindow(pPageView, nValueAge == pWidget->GetValueAge()); return true; } @@ -834,8 +834,8 @@ if (nAge == pWidget->GetAppearanceAge()) return false; - if (CFFL_FormField* pFormFiller = GetFormFiller(pWidget)) - pFormFiller->ResetPWLWindow(pPageView, nValueAge == pWidget->GetValueAge()); + if (CFFL_FormField* pFormField = GetFormField(pWidget)) + pFormField->ResetPWLWindow(pPageView, nValueAge == pWidget->GetValueAge()); return true; } @@ -865,8 +865,8 @@ if (nAge == pWidget->GetAppearanceAge()) return false; - if (CFFL_FormField* pFormFiller = GetFormFiller(pWidget)) - pFormFiller->ResetPWLWindow(pPageView, nValueAge == pWidget->GetValueAge()); + if (CFFL_FormField* pFormField = GetFormField(pWidget)) + pFormField->ResetPWLWindow(pPageView, nValueAge == pWidget->GetValueAge()); return true; } @@ -891,10 +891,10 @@ ObservedPtr<CPDFSDK_Widget> pWidget(pPrivateData->GetWidget()); DCHECK(pWidget); - CFFL_FormField* pFormFiller = GetFormFiller(pWidget.Get()); + CFFL_FormField* pFormField = GetFormField(pWidget.Get()); #ifdef PDF_ENABLE_XFA - if (pFormFiller->IsFieldFull(pPageView)) { + if (pFormField->IsFieldFull(pPageView)) { if (OnFull(&pWidget, pPageView, nFlag) || !pWidget) return {true, true}; } @@ -922,8 +922,8 @@ fa.bRC = true; fa.nSelStart = nSelStart; fa.nSelEnd = nSelEnd; - pFormFiller->GetActionData(pPageView, CPDF_AAction::kKeyStroke, fa); - pFormFiller->SaveState(pPageView); + pFormField->GetActionData(pPageView, CPDF_AAction::kKeyStroke, fa); + pFormField->SaveState(pPageView); bool action_status = pWidget->OnAAction(CPDF_AAction::kKeyStroke, &fa, pPageView); @@ -936,7 +936,7 @@ bool bExit = false; if (nAge != pWidget->GetAppearanceAge()) { - CPWL_Wnd* pWnd = pFormFiller->ResetPWLWindow( + CPWL_Wnd* pWnd = pFormField->ResetPWLWindow( pPageView, nValueAge == pWidget->GetValueAge()); if (!pWnd) return {true, true}; @@ -948,14 +948,14 @@ bExit = true; } if (fa.bRC) { - pFormFiller->SetActionData(pPageView, CPDF_AAction::kKeyStroke, fa); + pFormField->SetActionData(pPageView, CPDF_AAction::kKeyStroke, fa); } else { - pFormFiller->RestoreState(pPageView); + pFormField->RestoreState(pPageView); } if (pFormFillEnv->GetFocusAnnot() == pWidget) return {false, bExit}; - pFormFiller->CommitData(pPageView, nFlag); + pFormField->CommitData(pPageView, nFlag); return {false, true}; }
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.h b/fpdfsdk/formfiller/cffl_interactiveformfiller.h index faeb651..40b84f8 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.h +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
@@ -81,8 +81,8 @@ bool OnSetFocus(ObservedPtr<CPDFSDK_Annot>* pAnnot, uint32_t nFlag); bool OnKillFocus(ObservedPtr<CPDFSDK_Annot>* pAnnot, uint32_t nFlag); - CFFL_FormField* GetFormFillerForTesting(CPDFSDK_Annot* pAnnot) { - return GetFormFiller(pAnnot); + CFFL_FormField* GetFormFieldForTesting(CPDFSDK_Annot* pAnnot) { + return GetFormField(pAnnot); } WideString GetText(CPDFSDK_Annot* pAnnot); @@ -161,9 +161,9 @@ #endif // PDF_ENABLE_XFA bool IsFillingAllowed(CPDFSDK_Widget* pWidget) const; - CFFL_FormField* GetFormFiller(CPDFSDK_Annot* pAnnot); - CFFL_FormField* GetOrCreateFormFiller(CPDFSDK_Annot* pAnnot); - void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot); + CFFL_FormField* GetFormField(CPDFSDK_Annot* pAnnot); + CFFL_FormField* GetOrCreateFormField(CPDFSDK_Annot* pAnnot); + void UnregisterFormField(CPDFSDK_Annot* pAnnot); UnownedPtr<CPDFSDK_FormFillEnvironment> const m_pFormFillEnv; WidgetToFormFillerMap m_Map;
diff --git a/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp b/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp index 16b93ea..33ac34f 100644 --- a/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp +++ b/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp
@@ -61,7 +61,7 @@ } m_pFormFiller = - pInteractiveFormFiller->GetFormFillerForTesting(pAnnotCombobox); + pInteractiveFormFiller->GetFormFieldForTesting(pAnnotCombobox); ASSERT_TRUE(m_pFormFiller); CPWL_Wnd* pWindow = m_pFormFiller->GetPWLWindow(
diff --git a/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp b/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp index ee16a06..8f566ea 100644 --- a/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp +++ b/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
@@ -67,7 +67,7 @@ } m_pFormFiller = - pInteractiveFormFiller->GetFormFillerForTesting(pAnnotTextField); + pInteractiveFormFiller->GetFormFieldForTesting(pAnnotTextField); ASSERT_TRUE(m_pFormFiller); CPWL_Wnd* pWindow = m_pFormFiller->GetPWLWindow(
diff --git a/fpdfsdk/pwl/cpwl_special_button_embeddertest.cpp b/fpdfsdk/pwl/cpwl_special_button_embeddertest.cpp index 7761e29..55238df 100644 --- a/fpdfsdk/pwl/cpwl_special_button_embeddertest.cpp +++ b/fpdfsdk/pwl/cpwl_special_button_embeddertest.cpp
@@ -71,7 +71,7 @@ EXPECT_TRUE(interactive_formfiller->OnSetFocus(&observed, 0)); } - form_filler_ = interactive_formfiller->GetFormFillerForTesting(annot); + form_filler_ = interactive_formfiller->GetFormFieldForTesting(annot); ASSERT_TRUE(form_filler_); window_ =
diff --git a/fpdfsdk/pwl/ipwl_systemhandler.h b/fpdfsdk/pwl/ipwl_systemhandler.h index c949f77..0724e62 100644 --- a/fpdfsdk/pwl/ipwl_systemhandler.h +++ b/fpdfsdk/pwl/ipwl_systemhandler.h
@@ -36,7 +36,7 @@ virtual void InvalidateRect(PerWindowData* pWidgetData, const CFX_FloatRect& rect) = 0; - virtual void OutputSelectedRect(CFFL_FormField* pFormFiller, + virtual void OutputSelectedRect(CFFL_FormField* pFormField, const CFX_FloatRect& rect) = 0; virtual bool IsSelectionImplemented() const = 0; virtual void SetCursor(CursorStyle nCursorStyle) = 0;