From c320e9c7ad01ab48625e51fb3b6476d98b6167de Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Mon, 22 Oct 2018 18:28:52 +0000 Subject: 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 Commit-Queue: Tom Sepez Reviewed-by: Tom Sepez --- core/fpdfdoc/cpdf_aaction.cpp | 50 +++++++++++++++++++++---------------------- core/fpdfdoc/cpdf_aaction.h | 46 +++++++++++++++++++-------------------- 2 files changed, 48 insertions(+), 48 deletions(-) (limited to 'core') 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); -- cgit v1.2.3