OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../third_party/base/nonstd_unique_ptr.h" |
8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
9 #include "../include/fsdk_mgr.h" | 9 #include "../include/fsdk_mgr.h" |
10 #include "../include/fsdk_baseannot.h" | 10 #include "../include/fsdk_baseannot.h" |
(...skipping 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2424 if (rcAnnot1.top > rcAnnot2.top) | 2424 if (rcAnnot1.top > rcAnnot2.top) |
2425 return 1; | 2425 return 1; |
2426 return 0; | 2426 return 0; |
2427 } | 2427 } |
2428 | 2428 |
2429 void CBA_AnnotIterator::GenerateResults() { | 2429 void CBA_AnnotIterator::GenerateResults() { |
2430 ASSERT(m_pPageView != NULL); | 2430 ASSERT(m_pPageView != NULL); |
2431 | 2431 |
2432 switch (m_nTabs) { | 2432 switch (m_nTabs) { |
2433 case BAI_STRUCTURE: { | 2433 case BAI_STRUCTURE: { |
2434 for (int i = 0, sz = m_pPageView->CountAnnots(); i < sz; i++) { | 2434 for (size_t i = 0; i < m_pPageView->CountAnnots(); ++i) { |
2435 CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); | 2435 CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); |
2436 ASSERT(pAnnot != NULL); | 2436 ASSERT(pAnnot != NULL); |
2437 | 2437 |
2438 if (pAnnot->GetType() == m_sType && pAnnot->GetSubType() == m_sSubType) | 2438 if (pAnnot->GetType() == m_sType && pAnnot->GetSubType() == m_sSubType) |
2439 m_Annots.Add(pAnnot); | 2439 m_Annots.Add(pAnnot); |
2440 } | 2440 } |
2441 } break; | 2441 } break; |
2442 case BAI_ROW: { | 2442 case BAI_ROW: { |
2443 CPDFSDK_SortAnnots sa; | 2443 CPDFSDK_SortAnnots sa; |
2444 | 2444 |
2445 { | 2445 { |
2446 for (int i = 0, sz = m_pPageView->CountAnnots(); i < sz; i++) { | 2446 for (size_t i = 0; i < m_pPageView->CountAnnots(); ++i) { |
2447 CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); | 2447 CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); |
2448 ASSERT(pAnnot != NULL); | 2448 ASSERT(pAnnot != NULL); |
2449 | 2449 |
2450 if (pAnnot->GetType() == m_sType && | 2450 if (pAnnot->GetType() == m_sType && |
2451 pAnnot->GetSubType() == m_sSubType) | 2451 pAnnot->GetSubType() == m_sSubType) |
2452 sa.Add(pAnnot); | 2452 sa.Add(pAnnot); |
2453 } | 2453 } |
2454 } | 2454 } |
2455 | 2455 |
2456 if (sa.GetSize() > 0) { | 2456 if (sa.GetSize() > 0) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2515 | 2515 |
2516 aSelect.RemoveAll(); | 2516 aSelect.RemoveAll(); |
2517 } | 2517 } |
2518 } | 2518 } |
2519 sa.RemoveAll(); | 2519 sa.RemoveAll(); |
2520 } break; | 2520 } break; |
2521 case BAI_COLUMN: { | 2521 case BAI_COLUMN: { |
2522 CPDFSDK_SortAnnots sa; | 2522 CPDFSDK_SortAnnots sa; |
2523 | 2523 |
2524 { | 2524 { |
2525 for (int i = 0, sz = m_pPageView->CountAnnots(); i < sz; i++) { | 2525 for (size_t i = 0; i < m_pPageView->CountAnnots(); ++i) { |
2526 CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); | 2526 CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); |
2527 ASSERT(pAnnot != NULL); | 2527 ASSERT(pAnnot != NULL); |
2528 | 2528 |
2529 if (pAnnot->GetType() == m_sType && | 2529 if (pAnnot->GetType() == m_sType && |
2530 pAnnot->GetSubType() == m_sSubType) | 2530 pAnnot->GetSubType() == m_sSubType) |
2531 sa.Add(pAnnot); | 2531 sa.Add(pAnnot); |
2532 } | 2532 } |
2533 } | 2533 } |
2534 | 2534 |
2535 if (sa.GetSize() > 0) { | 2535 if (sa.GetSize() > 0) { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2607 ASSERT(pAnnot != NULL); | 2607 ASSERT(pAnnot != NULL); |
2608 | 2608 |
2609 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); | 2609 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); |
2610 ASSERT(pPDFAnnot != NULL); | 2610 ASSERT(pPDFAnnot != NULL); |
2611 | 2611 |
2612 CPDF_Rect rcAnnot; | 2612 CPDF_Rect rcAnnot; |
2613 pPDFAnnot->GetRect(rcAnnot); | 2613 pPDFAnnot->GetRect(rcAnnot); |
2614 | 2614 |
2615 return rcAnnot; | 2615 return rcAnnot; |
2616 } | 2616 } |
OLD | NEW |