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

Unified Diff: fpdfsdk/fpdf_ext.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/formfiller/cffl_iformfiller.cpp ('k') | fpdfsdk/fsdk_baseform_embeddertest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdf_ext.cpp
diff --git a/fpdfsdk/fpdf_ext.cpp b/fpdfsdk/fpdf_ext.cpp
index d03b4383ca3655daf66d26c784a441448fbd5e72..46bc7e57a48108c6e2636afb5b38dbbf7a083dee 100644
--- a/fpdfsdk/fpdf_ext.cpp
+++ b/fpdfsdk/fpdf_ext.cpp
@@ -46,33 +46,31 @@ FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info) {
}
void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot) {
- CFX_ByteString cbSubType = pPDFAnnot->GetSubtype();
- if (cbSubType.Compare("3D") == 0) {
+ CPDF_Annot::Subtype nAnnotSubtype = pPDFAnnot->GetSubtype();
+ if (nAnnotSubtype == CPDF_Annot::Subtype::THREED) {
FPDF_UnSupportError(FPDF_UNSP_ANNOT_3DANNOT);
- } else if (cbSubType.Compare("Screen") == 0) {
+ } else if (nAnnotSubtype == CPDF_Annot::Subtype::SCREEN) {
const CPDF_Dictionary* pAnnotDict = pPDFAnnot->GetAnnotDict();
CFX_ByteString cbString;
if (pAnnotDict->KeyExist("IT"))
cbString = pAnnotDict->GetStringBy("IT");
if (cbString.Compare("Img") != 0)
FPDF_UnSupportError(FPDF_UNSP_ANNOT_SCREEN_MEDIA);
- } else if (cbSubType.Compare("Movie") == 0) {
+ } else if (nAnnotSubtype == CPDF_Annot::Subtype::MOVIE) {
FPDF_UnSupportError(FPDF_UNSP_ANNOT_MOVIE);
- } else if (cbSubType.Compare("Sound") == 0) {
+ } else if (nAnnotSubtype == CPDF_Annot::Subtype::SOUND) {
FPDF_UnSupportError(FPDF_UNSP_ANNOT_SOUND);
- } else if (cbSubType.Compare("RichMedia") == 0) {
+ } else if (nAnnotSubtype == CPDF_Annot::Subtype::RICHMEDIA) {
FPDF_UnSupportError(FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA);
- } else if (cbSubType.Compare("FileAttachment") == 0) {
+ } else if (nAnnotSubtype == CPDF_Annot::Subtype::FILEATTACHMENT) {
FPDF_UnSupportError(FPDF_UNSP_ANNOT_ATTACHMENT);
- } else if (cbSubType.Compare("Widget") == 0) {
+ } else if (nAnnotSubtype == CPDF_Annot::Subtype::WIDGET) {
const CPDF_Dictionary* pAnnotDict = pPDFAnnot->GetAnnotDict();
CFX_ByteString cbString;
- if (pAnnotDict->KeyExist("FT")) {
+ if (pAnnotDict->KeyExist("FT"))
cbString = pAnnotDict->GetStringBy("FT");
- }
- if (cbString.Compare("Sig") == 0) {
+ if (cbString.Compare("Sig") == 0)
FPDF_UnSupportError(FPDF_UNSP_ANNOT_SIG);
- }
}
}
« no previous file with comments | « fpdfsdk/formfiller/cffl_iformfiller.cpp ('k') | fpdfsdk/fsdk_baseform_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698