diff options
author | Hans Wennborg <hans@chromium.org> | 2018-10-22 18:28:52 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-22 18:28:52 +0000 |
commit | c320e9c7ad01ab48625e51fb3b6476d98b6167de (patch) | |
tree | 4ef9b9083a5969b60c445340a47500c46c5ce623 | |
parent | 8298d25cf3ac41d71a8533700d929cadac1c360d (diff) | |
download | pdfium-c320e9c7ad01ab48625e51fb3b6476d98b6167de.tar.xz |
Add k prefixes to CPDF_AAction::AActionType enumerators
The GetFocus enumerator was shadowing the GetFocus function in winuser.h.
Change the enumerators to all have a k prefix to avoid the warning, and since I
believe pdfium wants to move towards that style anyway.
Bug: chromium:895475
Change-Id: I740afa4f29d895e7e3cbb488fd311a7487d67a82
Reviewed-on: https://pdfium-review.googlesource.com/c/44470
Commit-Queue: Hans Wennborg <hans@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
-rw-r--r-- | core/fpdfdoc/cpdf_aaction.cpp | 50 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_aaction.h | 46 | ||||
-rw-r--r-- | fpdfsdk/cpdfsdk_actionhandler.cpp | 40 | ||||
-rw-r--r-- | fpdfsdk/cpdfsdk_baannot.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/cpdfsdk_interactiveform.cpp | 20 | ||||
-rw-r--r-- | fpdfsdk/cpdfsdk_widget.cpp | 76 | ||||
-rw-r--r-- | fpdfsdk/formfiller/cffl_combobox.cpp | 12 | ||||
-rw-r--r-- | fpdfsdk/formfiller/cffl_interactiveformfiller.cpp | 48 | ||||
-rw-r--r-- | fpdfsdk/formfiller/cffl_listbox.cpp | 6 | ||||
-rw-r--r-- | fpdfsdk/formfiller/cffl_textfield.cpp | 12 | ||||
-rw-r--r-- | fpdfsdk/fpdf_formfill.cpp | 14 |
11 files changed, 163 insertions, 163 deletions
diff --git a/core/fpdfdoc/cpdf_aaction.cpp b/core/fpdfdoc/cpdf_aaction.cpp index 109e82b406..633161e724 100644 --- a/core/fpdfdoc/cpdf_aaction.cpp +++ b/core/fpdfdoc/cpdf_aaction.cpp @@ -11,32 +11,32 @@ namespace { constexpr const char* g_sAATypes[] = { - "E", // CursorEnter - "X", // CursorExit - "D", // ButtonDown - "U", // ButtonUp - "Fo", // GetFocus - "Bl", // LoseFocus - "PO", // PageOpen - "PC", // PageClose - "PV", // PageVisible - "PI", // PageInvisible - "O", // OpenPage - "C", // ClosePage - "K", // KeyStroke - "F", // Format - "V", // Validate - "C", // Calculate - "WC", // CloseDocument - "WS", // SaveDocument - "DS", // DocumentSaved - "WP", // PrintDocument - "DP", // DocumentPrinted + "E", // kCursorEnter + "X", // kCursorExit + "D", // kButtonDown + "U", // kButtonUp + "Fo", // kGetFocus + "Bl", // kLoseFocus + "PO", // kPageOpen + "PC", // kPageClose + "PV", // kPageVisible + "PI", // kPageInvisible + "O", // kOpenPage + "C", // kClosePage + "K", // kKeyStroke + "F", // kFormat + "V", // kValidate + "C", // kCalculate + "WC", // kCloseDocument + "WS", // kSaveDocument + "DS", // kDocumentSaved + "WP", // kPrintDocument + "DP", // kDocumentPrinted }; // |g_sAATypes| should have one less element than enum AActionType due to -// DocumentOpen, which is an artificial type. -static_assert(FX_ArraySize(g_sAATypes) == CPDF_AAction::NumberOfActions - 1, +// kDocumentOpen, which is an artificial type. +static_assert(FX_ArraySize(g_sAATypes) == CPDF_AAction::kNumberOfActions - 1, "g_sAATypes count mismatch"); } // namespace @@ -59,8 +59,8 @@ CPDF_Action CPDF_AAction::GetAction(AActionType eType) const { // static bool CPDF_AAction::IsUserClick(AActionType eType) { switch (eType) { - case ButtonUp: - case ButtonDown: + case kButtonUp: + case kButtonDown: return true; default: return false; diff --git a/core/fpdfdoc/cpdf_aaction.h b/core/fpdfdoc/cpdf_aaction.h index 90049f5ac4..edd3539745 100644 --- a/core/fpdfdoc/cpdf_aaction.h +++ b/core/fpdfdoc/cpdf_aaction.h @@ -14,29 +14,29 @@ class CPDF_Dictionary; class CPDF_AAction { public: enum AActionType { - CursorEnter = 0, - CursorExit, - ButtonDown, - ButtonUp, - GetFocus, - LoseFocus, - PageOpen, - PageClose, - PageVisible, - PageInvisible, - OpenPage, - ClosePage, - KeyStroke, - Format, - Validate, - Calculate, - CloseDocument, - SaveDocument, - DocumentSaved, - PrintDocument, - DocumentPrinted, - DocumentOpen, - NumberOfActions // Must be last. + kCursorEnter = 0, + kCursorExit, + kButtonDown, + kButtonUp, + kGetFocus, + kLoseFocus, + kPageOpen, + kPageClose, + kPageVisible, + kPageInvisible, + kOpenPage, + kClosePage, + kKeyStroke, + kFormat, + kValidate, + kCalculate, + kCloseDocument, + kSaveDocument, + kDocumentSaved, + kPrintDocument, + kDocumentPrinted, + kDocumentOpen, + kNumberOfActions // Must be last. }; explicit CPDF_AAction(const CPDF_Dictionary* pDict); diff --git a/fpdfsdk/cpdfsdk_actionhandler.cpp b/fpdfsdk/cpdfsdk_actionhandler.cpp index a3df789f2d..1816c94c6c 100644 --- a/fpdfsdk/cpdfsdk_actionhandler.cpp +++ b/fpdfsdk/cpdfsdk_actionhandler.cpp @@ -131,7 +131,7 @@ bool CPDFSDK_ActionHandler::ExecuteDocumentOpenAction( RunDocumentOpenJavaScript(pFormFillEnv, L"", swJS); } } else { - DoAction_NoJs(action, CPDF_AAction::AActionType::DocumentOpen, + DoAction_NoJs(action, CPDF_AAction::AActionType::kDocumentOpen, pFormFillEnv); } @@ -405,44 +405,44 @@ void CPDFSDK_ActionHandler::RunFieldJavaScript( CPDF_AAction::AActionType type, CPDFSDK_FieldAction* data, const WideString& script) { - ASSERT(type != CPDF_AAction::Calculate); - ASSERT(type != CPDF_AAction::Format); + ASSERT(type != CPDF_AAction::kCalculate); + ASSERT(type != CPDF_AAction::kFormat); RunScript( pFormFillEnv, script, [type, data, pFormField](IJS_EventContext* context) { switch (type) { - case CPDF_AAction::CursorEnter: + case CPDF_AAction::kCursorEnter: context->OnField_MouseEnter(data->bModifier, data->bShift, pFormField); break; - case CPDF_AAction::CursorExit: + case CPDF_AAction::kCursorExit: context->OnField_MouseExit(data->bModifier, data->bShift, pFormField); break; - case CPDF_AAction::ButtonDown: + case CPDF_AAction::kButtonDown: context->OnField_MouseDown(data->bModifier, data->bShift, pFormField); break; - case CPDF_AAction::ButtonUp: + case CPDF_AAction::kButtonUp: context->OnField_MouseUp(data->bModifier, data->bShift, pFormField); break; - case CPDF_AAction::GetFocus: + case CPDF_AAction::kGetFocus: context->OnField_Focus(data->bModifier, data->bShift, pFormField, &data->sValue); break; - case CPDF_AAction::LoseFocus: + case CPDF_AAction::kLoseFocus: context->OnField_Blur(data->bModifier, data->bShift, pFormField, &data->sValue); break; - case CPDF_AAction::KeyStroke: + case CPDF_AAction::kKeyStroke: context->OnField_Keystroke( &data->sChange, data->sChangeEx, data->bKeyDown, data->bModifier, &data->nSelEnd, &data->nSelStart, data->bShift, pFormField, &data->sValue, data->bWillCommit, data->bFieldFull, &data->bRC); break; - case CPDF_AAction::Validate: + case CPDF_AAction::kValidate: context->OnField_Validate(&data->sChange, data->sChangeEx, data->bKeyDown, data->bModifier, data->bShift, pFormField, &data->sValue, @@ -472,31 +472,31 @@ void CPDFSDK_ActionHandler::RunDocumentPageJavaScript( RunScript(pFormFillEnv, script, [type, pFormFillEnv](IJS_EventContext* context) { switch (type) { - case CPDF_AAction::OpenPage: + case CPDF_AAction::kOpenPage: context->OnPage_Open(pFormFillEnv); break; - case CPDF_AAction::ClosePage: + case CPDF_AAction::kClosePage: context->OnPage_Close(pFormFillEnv); break; - case CPDF_AAction::CloseDocument: + case CPDF_AAction::kCloseDocument: context->OnDoc_WillClose(pFormFillEnv); break; - case CPDF_AAction::SaveDocument: + case CPDF_AAction::kSaveDocument: context->OnDoc_WillSave(pFormFillEnv); break; - case CPDF_AAction::DocumentSaved: + case CPDF_AAction::kDocumentSaved: context->OnDoc_DidSave(pFormFillEnv); break; - case CPDF_AAction::PrintDocument: + case CPDF_AAction::kPrintDocument: context->OnDoc_WillPrint(pFormFillEnv); break; - case CPDF_AAction::DocumentPrinted: + case CPDF_AAction::kDocumentPrinted: context->OnDoc_DidPrint(pFormFillEnv); break; - case CPDF_AAction::PageVisible: + case CPDF_AAction::kPageVisible: context->OnPage_InView(pFormFillEnv); break; - case CPDF_AAction::PageInvisible: + case CPDF_AAction::kPageInvisible: context->OnPage_OutView(pFormFillEnv); break; default: diff --git a/fpdfsdk/cpdfsdk_baannot.cpp b/fpdfsdk/cpdfsdk_baannot.cpp index 5a0d4be6f1..962d189966 100644 --- a/fpdfsdk/cpdfsdk_baannot.cpp +++ b/fpdfsdk/cpdfsdk_baannot.cpp @@ -220,7 +220,7 @@ CPDF_Action CPDFSDK_BAAnnot::GetAAction(CPDF_AAction::AActionType eAAT) { if (AAction.ActionExist(eAAT)) return AAction.GetAction(eAAT); - if (eAAT == CPDF_AAction::ButtonUp) + if (eAAT == CPDF_AAction::kButtonUp) return GetAction(); return CPDF_Action(nullptr); diff --git a/fpdfsdk/cpdfsdk_interactiveform.cpp b/fpdfsdk/cpdfsdk_interactiveform.cpp index 76df3c93e0..c48ff70e47 100644 --- a/fpdfsdk/cpdfsdk_interactiveform.cpp +++ b/fpdfsdk/cpdfsdk_interactiveform.cpp @@ -303,10 +303,10 @@ void CPDFSDK_InteractiveForm::OnCalculate(CPDF_FormField* pFormField) { continue; CPDF_AAction aAction = pField->GetAdditionalAction(); - if (!aAction.GetDict() || !aAction.ActionExist(CPDF_AAction::Calculate)) + if (!aAction.GetDict() || !aAction.ActionExist(CPDF_AAction::kCalculate)) continue; - CPDF_Action action = aAction.GetAction(CPDF_AAction::Calculate); + CPDF_Action action = aAction.GetAction(CPDF_AAction::kCalculate); if (!action.GetDict()) continue; @@ -341,8 +341,8 @@ Optional<WideString> CPDFSDK_InteractiveForm::OnFormat( } CPDF_AAction aAction = pFormField->GetAdditionalAction(); - if (aAction.GetDict() && aAction.ActionExist(CPDF_AAction::Format)) { - CPDF_Action action = aAction.GetAction(CPDF_AAction::Format); + if (aAction.GetDict() && aAction.ActionExist(CPDF_AAction::kFormat)) { + CPDF_Action action = aAction.GetAction(CPDF_AAction::kFormat); if (action.GetDict()) { WideString script = action.GetJavaScript(); if (!script.IsEmpty()) { @@ -388,10 +388,10 @@ void CPDFSDK_InteractiveForm::UpdateField(CPDF_FormField* pFormField) { bool CPDFSDK_InteractiveForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, const WideString& csValue) { CPDF_AAction aAction = pFormField->GetAdditionalAction(); - if (!aAction.GetDict() || !aAction.ActionExist(CPDF_AAction::KeyStroke)) + if (!aAction.GetDict() || !aAction.ActionExist(CPDF_AAction::kKeyStroke)) return true; - CPDF_Action action = aAction.GetAction(CPDF_AAction::KeyStroke); + CPDF_Action action = aAction.GetAction(CPDF_AAction::kKeyStroke); if (!action.GetDict()) return true; @@ -400,17 +400,17 @@ bool CPDFSDK_InteractiveForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, fa.bShift = false; fa.sValue = csValue; m_pFormFillEnv->GetActionHandler()->DoAction_FieldJavaScript( - action, CPDF_AAction::KeyStroke, m_pFormFillEnv.Get(), pFormField, &fa); + action, CPDF_AAction::kKeyStroke, m_pFormFillEnv.Get(), pFormField, &fa); return fa.bRC; } bool CPDFSDK_InteractiveForm::OnValidate(CPDF_FormField* pFormField, const WideString& csValue) { CPDF_AAction aAction = pFormField->GetAdditionalAction(); - if (!aAction.GetDict() || !aAction.ActionExist(CPDF_AAction::Validate)) + if (!aAction.GetDict() || !aAction.ActionExist(CPDF_AAction::kValidate)) return true; - CPDF_Action action = aAction.GetAction(CPDF_AAction::Validate); + CPDF_Action action = aAction.GetAction(CPDF_AAction::kValidate); if (!action.GetDict()) return true; @@ -419,7 +419,7 @@ bool CPDFSDK_InteractiveForm::OnValidate(CPDF_FormField* pFormField, fa.bShift = false; fa.sValue = csValue; m_pFormFillEnv->GetActionHandler()->DoAction_FieldJavaScript( - action, CPDF_AAction::Validate, m_pFormFillEnv.Get(), pFormField, &fa); + action, CPDF_AAction::kValidate, m_pFormFillEnv.Get(), pFormField, &fa); return fa.bRC; } diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp index c30ce6ec86..c3e1eb9ed8 100644 --- a/fpdfsdk/cpdfsdk_widget.cpp +++ b/fpdfsdk/cpdfsdk_widget.cpp @@ -125,48 +125,48 @@ static XFA_EVENTTYPE GetXFAEventType(CPDF_AAction::AActionType eAAT, XFA_EVENTTYPE eEventType = XFA_EVENT_Unknown; switch (eAAT) { - case CPDF_AAction::CursorEnter: + case CPDF_AAction::kCursorEnter: eEventType = XFA_EVENT_MouseEnter; break; - case CPDF_AAction::CursorExit: + case CPDF_AAction::kCursorExit: eEventType = XFA_EVENT_MouseExit; break; - case CPDF_AAction::ButtonDown: + case CPDF_AAction::kButtonDown: eEventType = XFA_EVENT_MouseDown; break; - case CPDF_AAction::ButtonUp: + case CPDF_AAction::kButtonUp: eEventType = XFA_EVENT_MouseUp; break; - case CPDF_AAction::GetFocus: + case CPDF_AAction::kGetFocus: eEventType = XFA_EVENT_Enter; break; - case CPDF_AAction::LoseFocus: + case CPDF_AAction::kLoseFocus: eEventType = XFA_EVENT_Exit; break; - case CPDF_AAction::PageOpen: - case CPDF_AAction::PageClose: - case CPDF_AAction::PageVisible: - case CPDF_AAction::PageInvisible: + case CPDF_AAction::kPageOpen: + case CPDF_AAction::kPageClose: + case CPDF_AAction::kPageVisible: + case CPDF_AAction::kPageInvisible: break; - case CPDF_AAction::KeyStroke: + case CPDF_AAction::kKeyStroke: if (!bWillCommit) eEventType = XFA_EVENT_Change; break; - case CPDF_AAction::Validate: + case CPDF_AAction::kValidate: eEventType = XFA_EVENT_Validate; break; - case CPDF_AAction::OpenPage: - case CPDF_AAction::ClosePage: - case CPDF_AAction::Format: - case CPDF_AAction::Calculate: - case CPDF_AAction::CloseDocument: - case CPDF_AAction::SaveDocument: - case CPDF_AAction::DocumentSaved: - case CPDF_AAction::PrintDocument: - case CPDF_AAction::DocumentPrinted: - break; - case CPDF_AAction::DocumentOpen: - case CPDF_AAction::NumberOfActions: + case CPDF_AAction::kOpenPage: + case CPDF_AAction::kClosePage: + case CPDF_AAction::kFormat: + case CPDF_AAction::kCalculate: + case CPDF_AAction::kCloseDocument: + case CPDF_AAction::kSaveDocument: + case CPDF_AAction::kDocumentSaved: + case CPDF_AAction::kPrintDocument: + case CPDF_AAction::kDocumentPrinted: + break; + case CPDF_AAction::kDocumentOpen: + case CPDF_AAction::kNumberOfActions: NOTREACHED(); break; } @@ -846,22 +846,22 @@ bool CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, CPDF_Action CPDFSDK_Widget::GetAAction(CPDF_AAction::AActionType eAAT) { switch (eAAT) { - case CPDF_AAction::CursorEnter: - case CPDF_AAction::CursorExit: - case CPDF_AAction::ButtonDown: - case CPDF_AAction::ButtonUp: - case CPDF_AAction::GetFocus: - case CPDF_AAction::LoseFocus: - case CPDF_AAction::PageOpen: - case CPDF_AAction::PageClose: - case CPDF_AAction::PageVisible: - case CPDF_AAction::PageInvisible: + case CPDF_AAction::kCursorEnter: + case CPDF_AAction::kCursorExit: + case CPDF_AAction::kButtonDown: + case CPDF_AAction::kButtonUp: + case CPDF_AAction::kGetFocus: + case CPDF_AAction::kLoseFocus: + case CPDF_AAction::kPageOpen: + case CPDF_AAction::kPageClose: + case CPDF_AAction::kPageVisible: + case CPDF_AAction::kPageInvisible: return CPDFSDK_BAAnnot::GetAAction(eAAT); - case CPDF_AAction::KeyStroke: - case CPDF_AAction::Format: - case CPDF_AAction::Validate: - case CPDF_AAction::Calculate: { + case CPDF_AAction::kKeyStroke: + case CPDF_AAction::kFormat: + case CPDF_AAction::kValidate: + case CPDF_AAction::kCalculate: { CPDF_FormField* pField = GetFormField(); if (pField->GetAdditionalAction().GetDict()) return pField->GetAdditionalAction().GetAction(eAAT); diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp index 8de88a66f3..830e64713a 100644 --- a/fpdfsdk/formfiller/cffl_combobox.cpp +++ b/fpdfsdk/formfiller/cffl_combobox.cpp @@ -124,7 +124,7 @@ void CFFL_ComboBox::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, CPDFSDK_FieldAction& fa) { switch (type) { - case CPDF_AAction::KeyStroke: + case CPDF_AAction::kKeyStroke: if (CPWL_ComboBox* pComboBox = static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, false))) { if (CPWL_Edit* pEdit = pComboBox->GetEdit()) { @@ -144,7 +144,7 @@ void CFFL_ComboBox::GetActionData(CPDFSDK_PageView* pPageView, } } break; - case CPDF_AAction::Validate: + case CPDF_AAction::kValidate: if (CPWL_ComboBox* pComboBox = static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, false))) { if (CPWL_Edit* pEdit = pComboBox->GetEdit()) { @@ -152,8 +152,8 @@ void CFFL_ComboBox::GetActionData(CPDFSDK_PageView* pPageView, } } break; - case CPDF_AAction::LoseFocus: - case CPDF_AAction::GetFocus: + case CPDF_AAction::kLoseFocus: + case CPDF_AAction::kGetFocus: fa.sValue = m_pWidget->GetValue(); break; default: @@ -165,7 +165,7 @@ void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const CPDFSDK_FieldAction& fa) { switch (type) { - case CPDF_AAction::KeyStroke: + case CPDF_AAction::kKeyStroke: if (CPWL_ComboBox* pComboBox = static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, false))) { if (CPWL_Edit* pEdit = pComboBox->GetEdit()) { @@ -183,7 +183,7 @@ bool CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const CPDFSDK_FieldAction& faOld, const CPDFSDK_FieldAction& faNew) { switch (type) { - case CPDF_AAction::KeyStroke: + case CPDF_AAction::kKeyStroke: return (!faOld.bFieldFull && faOld.nSelEnd != faNew.nSelEnd) || faOld.nSelStart != faNew.nSelStart || faOld.sChange != faNew.sChange; diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp index 3d5590af6d..c712610dcc 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp @@ -118,7 +118,7 @@ void CFFL_InteractiveFormFiller::OnMouseEnter( ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); if (!m_bNotifying) { CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get()); - if (pWidget->GetAAction(CPDF_AAction::CursorEnter).GetDict()) { + if (pWidget->GetAAction(CPDF_AAction::kCursorEnter).GetDict()) { m_bNotifying = true; uint32_t nValueAge = pWidget->GetValueAge(); @@ -128,7 +128,7 @@ void CFFL_InteractiveFormFiller::OnMouseEnter( CPDFSDK_FieldAction fa; fa.bModifier = CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag); fa.bShift = CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag); - pWidget->OnAAction(CPDF_AAction::CursorEnter, &fa, pPageView); + pWidget->OnAAction(CPDF_AAction::kCursorEnter, &fa, pPageView); m_bNotifying = false; if (!pAnnot->HasObservable()) return; @@ -151,7 +151,7 @@ void CFFL_InteractiveFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); if (!m_bNotifying) { CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get()); - if (pWidget->GetAAction(CPDF_AAction::CursorExit).GetDict()) { + if (pWidget->GetAAction(CPDF_AAction::kCursorExit).GetDict()) { m_bNotifying = true; uint32_t nValueAge = pWidget->GetValueAge(); @@ -161,7 +161,7 @@ void CFFL_InteractiveFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_FieldAction fa; fa.bModifier = CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag); fa.bShift = CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag); - pWidget->OnAAction(CPDF_AAction::CursorExit, &fa, pPageView); + pWidget->OnAAction(CPDF_AAction::kCursorExit, &fa, pPageView); m_bNotifying = false; if (!pAnnot->HasObservable()) return; @@ -187,7 +187,7 @@ bool CFFL_InteractiveFormFiller::OnLButtonDown( if (!m_bNotifying) { CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get()); if (Annot_HitTest(pPageView, pAnnot->Get(), point) && - pWidget->GetAAction(CPDF_AAction::ButtonDown).GetDict()) { + pWidget->GetAAction(CPDF_AAction::kButtonDown).GetDict()) { m_bNotifying = true; uint32_t nValueAge = pWidget->GetValueAge(); @@ -197,7 +197,7 @@ bool CFFL_InteractiveFormFiller::OnLButtonDown( CPDFSDK_FieldAction fa; fa.bModifier = CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlags); fa.bShift = CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlags); - pWidget->OnAAction(CPDF_AAction::ButtonDown, &fa, pPageView); + pWidget->OnAAction(CPDF_AAction::kButtonDown, &fa, pPageView); m_bNotifying = false; if (!pAnnot->HasObservable()) return true; @@ -263,7 +263,7 @@ bool CFFL_InteractiveFormFiller::OnButtonUp(CPDFSDK_Annot::ObservedPtr* pAnnot, return false; CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get()); - if (!pWidget->GetAAction(CPDF_AAction::ButtonUp).GetDict()) + if (!pWidget->GetAAction(CPDF_AAction::kButtonUp).GetDict()) return false; m_bNotifying = true; @@ -275,7 +275,7 @@ bool CFFL_InteractiveFormFiller::OnButtonUp(CPDFSDK_Annot::ObservedPtr* pAnnot, CPDFSDK_FieldAction fa; fa.bModifier = CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag); fa.bShift = CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag); - pWidget->OnAAction(CPDF_AAction::ButtonUp, &fa, pPageView); + pWidget->OnAAction(CPDF_AAction::kButtonUp, &fa, pPageView); m_bNotifying = false; if (!pAnnot->HasObservable() || !IsValidAnnot(pPageView, pWidget)) return true; @@ -371,7 +371,7 @@ bool CFFL_InteractiveFormFiller::OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); if (!m_bNotifying) { CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get()); - if (pWidget->GetAAction(CPDF_AAction::GetFocus).GetDict()) { + if (pWidget->GetAAction(CPDF_AAction::kGetFocus).GetDict()) { m_bNotifying = true; uint32_t nValueAge = pWidget->GetValueAge(); @@ -387,8 +387,8 @@ bool CFFL_InteractiveFormFiller::OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, CPDFSDK_FieldAction fa; fa.bModifier = CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag); fa.bShift = CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag); - pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa); - pWidget->OnAAction(CPDF_AAction::GetFocus, &fa, pPageView); + pFormFiller->GetActionData(pPageView, CPDF_AAction::kGetFocus, fa); + pWidget->OnAAction(CPDF_AAction::kGetFocus, &fa, pPageView); m_bNotifying = false; if (!pAnnot->HasObservable()) return false; @@ -426,7 +426,7 @@ bool CFFL_InteractiveFormFiller::OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, return true; CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get()); - if (!pWidget->GetAAction(CPDF_AAction::LoseFocus).GetDict()) + if (!pWidget->GetAAction(CPDF_AAction::kLoseFocus).GetDict()) return true; m_bNotifying = true; @@ -438,8 +438,8 @@ bool CFFL_InteractiveFormFiller::OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, CPDFSDK_FieldAction fa; fa.bModifier = CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag); fa.bShift = CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag); - pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa); - pWidget->OnAAction(CPDF_AAction::LoseFocus, &fa, pPageView); + pFormFiller->GetActionData(pPageView, CPDF_AAction::kLoseFocus, fa); + pWidget->OnAAction(CPDF_AAction::kLoseFocus, &fa, pPageView); m_bNotifying = false; return pAnnot->HasObservable(); } @@ -638,7 +638,7 @@ bool CFFL_InteractiveFormFiller::OnKeyStrokeCommit( return true; CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get()); - if (!pWidget->GetAAction(CPDF_AAction::KeyStroke).GetDict()) + if (!pWidget->GetAAction(CPDF_AAction::kKeyStroke).GetDict()) return true; ASSERT(pPageView); @@ -653,9 +653,9 @@ bool CFFL_InteractiveFormFiller::OnKeyStrokeCommit( fa.bRC = true; CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false); - pFormFiller->GetActionData(pPageView, CPDF_AAction::KeyStroke, fa); + pFormFiller->GetActionData(pPageView, CPDF_AAction::kKeyStroke, fa); pFormFiller->SaveState(pPageView); - pWidget->OnAAction(CPDF_AAction::KeyStroke, &fa, pPageView); + pWidget->OnAAction(CPDF_AAction::kKeyStroke, &fa, pPageView); if (!pAnnot->HasObservable()) return true; @@ -670,7 +670,7 @@ bool CFFL_InteractiveFormFiller::OnValidate(CPDFSDK_Annot::ObservedPtr* pAnnot, return true; CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get()); - if (!pWidget->GetAAction(CPDF_AAction::Validate).GetDict()) + if (!pWidget->GetAAction(CPDF_AAction::kValidate).GetDict()) return true; ASSERT(pPageView); @@ -684,9 +684,9 @@ bool CFFL_InteractiveFormFiller::OnValidate(CPDFSDK_Annot::ObservedPtr* pAnnot, fa.bRC = true; CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false); - pFormFiller->GetActionData(pPageView, CPDF_AAction::Validate, fa); + pFormFiller->GetActionData(pPageView, CPDF_AAction::kValidate, fa); pFormFiller->SaveState(pPageView); - pWidget->OnAAction(CPDF_AAction::Validate, &fa, pPageView); + pWidget->OnAAction(CPDF_AAction::kValidate, &fa, pPageView); if (!pAnnot->HasObservable()) return true; @@ -907,7 +907,7 @@ std::pair<bool, bool> CFFL_InteractiveFormFiller::OnBeforeKeyStroke( #endif // PDF_ENABLE_XFA if (m_bNotifying || - !privateData.pWidget->GetAAction(CPDF_AAction::KeyStroke).GetDict()) { + !privateData.pWidget->GetAAction(CPDF_AAction::kKeyStroke).GetDict()) { return {true, false}; } @@ -929,13 +929,13 @@ std::pair<bool, bool> CFFL_InteractiveFormFiller::OnBeforeKeyStroke( fa.bRC = true; fa.nSelStart = nSelStart; fa.nSelEnd = nSelEnd; - pFormFiller->GetActionData(privateData.pPageView, CPDF_AAction::KeyStroke, + pFormFiller->GetActionData(privateData.pPageView, CPDF_AAction::kKeyStroke, fa); pFormFiller->SaveState(privateData.pPageView); CPDFSDK_Annot::ObservedPtr pObserved(privateData.pWidget); bool action_status = privateData.pWidget->OnAAction( - CPDF_AAction::KeyStroke, &fa, privateData.pPageView); + CPDF_AAction::kKeyStroke, &fa, privateData.pPageView); if (!pObserved || !IsValidAnnot(privateData.pPageView, privateData.pWidget)) return {true, true}; @@ -953,7 +953,7 @@ std::pair<bool, bool> CFFL_InteractiveFormFiller::OnBeforeKeyStroke( bExit = true; } if (fa.bRC) { - pFormFiller->SetActionData(privateData.pPageView, CPDF_AAction::KeyStroke, + pFormFiller->SetActionData(privateData.pPageView, CPDF_AAction::kKeyStroke, fa); } else { pFormFiller->RestoreState(privateData.pPageView); diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp index 472501df2c..3ca95a89d4 100644 --- a/fpdfsdk/formfiller/cffl_listbox.cpp +++ b/fpdfsdk/formfiller/cffl_listbox.cpp @@ -140,7 +140,7 @@ void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, CPDFSDK_FieldAction& fa) { switch (type) { - case CPDF_AAction::Validate: + case CPDF_AAction::kValidate: if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) { fa.sValue = L""; } else { @@ -153,8 +153,8 @@ void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView, } } break; - case CPDF_AAction::LoseFocus: - case CPDF_AAction::GetFocus: + case CPDF_AAction::kLoseFocus: + case CPDF_AAction::kGetFocus: if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) { fa.sValue = L""; } else { diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp index 6f9ec03f44..65f28fef11 100644 --- a/fpdfsdk/formfiller/cffl_textfield.cpp +++ b/fpdfsdk/formfiller/cffl_textfield.cpp @@ -158,7 +158,7 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, CPDFSDK_FieldAction& fa) { switch (type) { - case CPDF_AAction::KeyStroke: + case CPDF_AAction::kKeyStroke: if (CPWL_Edit* pWnd = GetEdit(pPageView, false)) { fa.bFieldFull = pWnd->IsTextFull(); @@ -170,13 +170,13 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView, } } break; - case CPDF_AAction::Validate: + case CPDF_AAction::kValidate: if (CPWL_Edit* pWnd = GetEdit(pPageView, false)) { fa.sValue = pWnd->GetText(); } break; - case CPDF_AAction::LoseFocus: - case CPDF_AAction::GetFocus: + case CPDF_AAction::kLoseFocus: + case CPDF_AAction::kGetFocus: fa.sValue = m_pWidget->GetValue(); break; default: @@ -188,7 +188,7 @@ void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const CPDFSDK_FieldAction& fa) { switch (type) { - case CPDF_AAction::KeyStroke: + case CPDF_AAction::kKeyStroke: if (CPWL_Edit* pEdit = GetEdit(pPageView, false)) { pEdit->SetFocus(); pEdit->SetSelection(fa.nSelStart, fa.nSelEnd); @@ -204,7 +204,7 @@ bool CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const CPDFSDK_FieldAction& faOld, const CPDFSDK_FieldAction& faNew) { switch (type) { - case CPDF_AAction::KeyStroke: + case CPDF_AAction::kKeyStroke: return (!faOld.bFieldFull && faOld.nSelEnd != faNew.nSelEnd) || faOld.nSelStart != faNew.nSelStart || faOld.sChange != faNew.sChange; diff --git a/fpdfsdk/fpdf_formfill.cpp b/fpdfsdk/fpdf_formfill.cpp index 966ed097e9..54cfa2b37e 100644 --- a/fpdfsdk/fpdf_formfill.cpp +++ b/fpdfsdk/fpdf_formfill.cpp @@ -141,19 +141,19 @@ static_assert(static_cast<int>(FormFieldType::kXFA_TextField) == static_assert(kFormFieldTypeCount == FPDF_FORMFIELD_COUNT, "Number of form field types must match"); -static_assert(static_cast<int>(CPDF_AAction::CloseDocument) == +static_assert(static_cast<int>(CPDF_AAction::kCloseDocument) == FPDFDOC_AACTION_WC, "CloseDocument action must match"); -static_assert(static_cast<int>(CPDF_AAction::SaveDocument) == +static_assert(static_cast<int>(CPDF_AAction::kSaveDocument) == FPDFDOC_AACTION_WS, "SaveDocument action must match"); -static_assert(static_cast<int>(CPDF_AAction::DocumentSaved) == +static_assert(static_cast<int>(CPDF_AAction::kDocumentSaved) == FPDFDOC_AACTION_DS, "DocumentSaved action must match"); -static_assert(static_cast<int>(CPDF_AAction::PrintDocument) == +static_assert(static_cast<int>(CPDF_AAction::kPrintDocument) == FPDFDOC_AACTION_WP, "PrintDocument action must match"); -static_assert(static_cast<int>(CPDF_AAction::DocumentPrinted) == +static_assert(static_cast<int>(CPDF_AAction::kDocumentPrinted) == FPDFDOC_AACTION_DP, "DocumentPrinted action must match"); @@ -724,8 +724,8 @@ FPDF_EXPORT void FPDF_CALLCONV FORM_DoPageAAction(FPDF_PAGE page, CPDF_Dictionary* pPageDict = pPDFPage->GetDict(); CPDF_AAction aa(pPageDict->GetDictFor("AA")); CPDF_AAction::AActionType type = aaType == FPDFPAGE_AACTION_OPEN - ? CPDF_AAction::OpenPage - : CPDF_AAction::ClosePage; + ? CPDF_AAction::kOpenPage + : CPDF_AAction::kClosePage; if (aa.ActionExist(type)) { CPDF_Action action = aa.GetAction(type); pActionHandler->DoAction_Page(action, type, pFormFillEnv); |