summaryrefslogtreecommitdiff
path: root/fpdfsdk/cba_annotiterator.cpp
diff options
context:
space:
mode:
authorjaepark <jaepark@google.com>2016-08-31 06:49:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-31 06:49:27 -0700
commit956553e715787cfc4dd8423d5e9a04a0131878c3 (patch)
tree08622d504322d5dae37b5bb5025a90c81ebdee6b /fpdfsdk/cba_annotiterator.cpp
parent87dffc0315477150c9c1964913b65bc97bdf654f (diff)
downloadpdfium-956553e715787cfc4dd8423d5e9a04a0131878c3.tar.xz
Use enum class for subtypes of CPDF_Annot.
Comparing CFX_ByteString for annotation subtypes is inefficient and error-prone. This CL uses enum class to compare annotation subtypes. Also, remove unused IPDFSDK_AnnotHandler::GetType() and FSDK_XFAWIDGET_TYPENAME. Review-Url: https://codereview.chromium.org/2295953002
Diffstat (limited to 'fpdfsdk/cba_annotiterator.cpp')
-rw-r--r--fpdfsdk/cba_annotiterator.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/fpdfsdk/cba_annotiterator.cpp b/fpdfsdk/cba_annotiterator.cpp
index 773fe610cd..b99fabfabe 100644
--- a/fpdfsdk/cba_annotiterator.cpp
+++ b/fpdfsdk/cba_annotiterator.cpp
@@ -23,10 +23,10 @@ bool CBA_AnnotIterator::CompareByTopDescending(const CPDFSDK_Annot* p1,
}
CBA_AnnotIterator::CBA_AnnotIterator(CPDFSDK_PageView* pPageView,
- const CFX_ByteString& sAnnotSubtype)
+ CPDF_Annot::Subtype nAnnotSubtype)
: m_eTabOrder(STRUCTURE),
m_pPageView(pPageView),
- m_sAnnotSubtype(sAnnotSubtype) {
+ m_nAnnotSubtype(nAnnotSubtype) {
CPDF_Page* pPDFPage = m_pPageView->GetPDFPage();
CFX_ByteString sTabs = pPDFPage->m_pFormDict->GetStringBy("Tabs");
if (sTabs == "R")
@@ -71,7 +71,7 @@ void CBA_AnnotIterator::GenerateResults() {
case STRUCTURE: {
for (size_t i = 0; i < m_pPageView->CountAnnots(); ++i) {
CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i);
- if (pAnnot->GetAnnotSubtype() == m_sAnnotSubtype &&
+ if (pAnnot->GetAnnotSubtype() == m_nAnnotSubtype &&
!pAnnot->IsSignatureWidget())
m_Annots.push_back(pAnnot);
}
@@ -81,7 +81,7 @@ void CBA_AnnotIterator::GenerateResults() {
std::vector<CPDFSDK_Annot*> sa;
for (size_t i = 0; i < m_pPageView->CountAnnots(); ++i) {
CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i);
- if (pAnnot->GetAnnotSubtype() == m_sAnnotSubtype &&
+ if (pAnnot->GetAnnotSubtype() == m_nAnnotSubtype &&
!pAnnot->IsSignatureWidget())
sa.push_back(pAnnot);
}
@@ -123,7 +123,7 @@ void CBA_AnnotIterator::GenerateResults() {
std::vector<CPDFSDK_Annot*> sa;
for (size_t i = 0; i < m_pPageView->CountAnnots(); ++i) {
CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i);
- if (pAnnot->GetAnnotSubtype() == m_sAnnotSubtype &&
+ if (pAnnot->GetAnnotSubtype() == m_nAnnotSubtype &&
!pAnnot->IsSignatureWidget())
sa.push_back(pAnnot);
}