summaryrefslogtreecommitdiff
path: root/fpdfsdk/cba_annotiterator.cpp
diff options
context:
space:
mode:
authorjaepark <jaepark@google.com>2016-08-26 16:16:10 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-26 16:16:10 -0700
commit9ed91376d562f3c6e7ca0a99035a74502f648776 (patch)
treed164689b94d520448de46c8e4dbc9ea0abf788cf /fpdfsdk/cba_annotiterator.cpp
parent987f3ee94c3cb8e4a6113ad05453a2948469386c (diff)
downloadpdfium-9ed91376d562f3c6e7ca0a99035a74502f648776.tar.xz
Rename CPDFSDK_Annot::GetType to CPDFSDK_Annot::GetAnnotSubtype.
CPDFSDK_Annot::GetType should be renamed to GetAnnotSubtype as it returns annotation subtype. Also, CPDFSDK_Annot::GetSubType is only used to check if the annotation is signature widget. Thus, change the method to IsSignatureWidget. Lastly, rename CPDF_Annot::GetSubType to CPDF_Annot::GetSubtype to match with spec. Review-Url: https://codereview.chromium.org/2287703002
Diffstat (limited to 'fpdfsdk/cba_annotiterator.cpp')
-rw-r--r--fpdfsdk/cba_annotiterator.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/fpdfsdk/cba_annotiterator.cpp b/fpdfsdk/cba_annotiterator.cpp
index bd68997ad9..773fe610cd 100644
--- a/fpdfsdk/cba_annotiterator.cpp
+++ b/fpdfsdk/cba_annotiterator.cpp
@@ -23,12 +23,10 @@ bool CBA_AnnotIterator::CompareByTopDescending(const CPDFSDK_Annot* p1,
}
CBA_AnnotIterator::CBA_AnnotIterator(CPDFSDK_PageView* pPageView,
- const CFX_ByteString& sType,
- const CFX_ByteString& sSubType)
+ const CFX_ByteString& sAnnotSubtype)
: m_eTabOrder(STRUCTURE),
m_pPageView(pPageView),
- m_sType(sType),
- m_sSubType(sSubType) {
+ m_sAnnotSubtype(sAnnotSubtype) {
CPDF_Page* pPDFPage = m_pPageView->GetPDFPage();
CFX_ByteString sTabs = pPDFPage->m_pFormDict->GetStringBy("Tabs");
if (sTabs == "R")
@@ -73,7 +71,8 @@ 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->GetType() == m_sType && pAnnot->GetSubType() == m_sSubType)
+ if (pAnnot->GetAnnotSubtype() == m_sAnnotSubtype &&
+ !pAnnot->IsSignatureWidget())
m_Annots.push_back(pAnnot);
}
break;
@@ -82,7 +81,8 @@ 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->GetType() == m_sType && pAnnot->GetSubType() == m_sSubType)
+ if (pAnnot->GetAnnotSubtype() == m_sAnnotSubtype &&
+ !pAnnot->IsSignatureWidget())
sa.push_back(pAnnot);
}
@@ -123,7 +123,8 @@ 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->GetType() == m_sType && pAnnot->GetSubType() == m_sSubType)
+ if (pAnnot->GetAnnotSubtype() == m_sAnnotSubtype &&
+ !pAnnot->IsSignatureWidget())
sa.push_back(pAnnot);
}