Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: fpdfsdk/cpdfsdk_annothandlermgr.cpp

Issue 2295953002: Use enum class for subtypes of CPDF_Annot. (Closed)
Patch Set: Use enum class for subtypes of CPDF_Annot. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/cpdfsdk_annot.cpp ('k') | fpdfsdk/cpdfsdk_baannot.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/cpdfsdk_annothandlermgr.cpp
diff --git a/fpdfsdk/cpdfsdk_annothandlermgr.cpp b/fpdfsdk/cpdfsdk_annothandlermgr.cpp
index 9f5a545d65efe521c51ac8acdad882f6c5b5d05d..d909f5bc0da90eea7a415f0dbcfcf9857eb5fbcd 100644
--- a/fpdfsdk/cpdfsdk_annothandlermgr.cpp
+++ b/fpdfsdk/cpdfsdk_annothandlermgr.cpp
@@ -46,7 +46,8 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CXFA_FFWidget* pAnnot,
ASSERT(pAnnot);
ASSERT(pPageView);
- return GetAnnotHandler(FSDK_XFAWIDGET_TYPENAME)->NewAnnot(pAnnot, pPageView);
+ return GetAnnotHandler(CPDF_Annot::Subtype::XFAWIDGET)
+ ->NewAnnot(pAnnot, pPageView);
}
#endif // PDF_ENABLE_XFA
@@ -77,12 +78,12 @@ IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler(
}
IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler(
- const CFX_ByteString& sType) const {
- if (sType == "Widget")
+ CPDF_Annot::Subtype nAnnotSubtype) const {
+ if (nAnnotSubtype == CPDF_Annot::Subtype::WIDGET)
return m_pWidgetHandler.get();
#ifdef PDF_ENABLE_XFA
- if (sType == FSDK_XFAWIDGET_TYPENAME)
+ if (nAnnotSubtype == CPDF_Annot::Subtype::XFAWIDGET)
return m_pXFAWidgetHandler.get();
#endif // PDF_ENABLE_XFA
@@ -242,7 +243,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChangeFocus(
if (bXFA) {
if (IPDFSDK_AnnotHandler* pXFAAnnotHandler =
- GetAnnotHandler(FSDK_XFAWIDGET_TYPENAME))
+ GetAnnotHandler(CPDF_Annot::Subtype::XFAWIDGET))
return pXFAAnnotHandler->OnXFAChangedFocus(pKillAnnot, pSetAnnot);
}
@@ -299,7 +300,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,
return pPageView->GetAnnotByXFAWidget(hNextFocus);
#else // PDF_ENABLE_XFA
- CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), "Widget");
+ CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), CPDF_Annot::Subtype::WIDGET);
return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot);
#endif // PDF_ENABLE_XFA
}
« no previous file with comments | « fpdfsdk/cpdfsdk_annot.cpp ('k') | fpdfsdk/cpdfsdk_baannot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698