summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_mgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fsdk_mgr.cpp')
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index dfd39541fc..53a774edcd 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -664,7 +664,8 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice,
CPDF_Annot* CPDFSDK_PageView::GetPDFAnnotAtPoint(FX_FLOAT pageX,
FX_FLOAT pageY) {
- for (size_t i = 0; i < CountAnnots(); ++i) {
+ int nCount = CountAnnots();
+ for (int i = 0; i < nCount; i++) {
CPDF_Annot* pAnnot = m_pAnnotList->GetAt(i);
CFX_FloatRect annotRect;
pAnnot->GetRect(annotRect);
@@ -676,7 +677,8 @@ CPDF_Annot* CPDFSDK_PageView::GetPDFAnnotAtPoint(FX_FLOAT pageX,
CPDF_Annot* CPDFSDK_PageView::GetPDFWidgetAtPoint(FX_FLOAT pageX,
FX_FLOAT pageY) {
- for (size_t i = 0; i < CountAnnots(); ++i) {
+ int nCount = CountAnnots();
+ for (int i = 0; i < nCount; ++i) {
CPDF_Annot* pAnnot = m_pAnnotList->GetAt(i);
if (pAnnot->GetSubType() == "Widget") {
CFX_FloatRect annotRect;
@@ -762,8 +764,8 @@ CPDF_Document* CPDFSDK_PageView::GetPDFDocument() {
return NULL;
}
-size_t CPDFSDK_PageView::CountAnnots() const {
- return m_fxAnnotArray.size();
+int CPDFSDK_PageView::CountAnnots() const {
+ return m_pAnnotList->Count();
}
CPDFSDK_Annot* CPDFSDK_PageView::GetAnnot(size_t nIndex) {
@@ -897,8 +899,9 @@ void CPDFSDK_PageView::LoadFXAnnots() {
CPDF_InterForm::EnableUpdateAP(FALSE);
m_pAnnotList.reset(new CPDF_AnnotList(m_page));
CPDF_InterForm::EnableUpdateAP(enableAPUpdate);
+ int nCount = CountAnnots();
SetLock(TRUE);
- for (size_t i = 0; i < CountAnnots(); ++i) {
+ for (int i = 0; i < nCount; ++i) {
CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i);
CPDF_Document* pDoc = GetPDFDocument();
@@ -949,7 +952,8 @@ FX_BOOL CPDFSDK_PageView::IsValidAnnot(CPDF_Annot* p) const {
if (!p)
return FALSE;
- for (size_t i = 0; i < CountAnnots(); ++i) {
+ int nCount = CountAnnots();
+ for (int i = 0; i < nCount; ++i) {
if (m_pAnnotList->GetAt(i) == p)
return TRUE;
}