| 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 2443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2454 if (rcAnnot1.top > rcAnnot2.top) | 2454 if (rcAnnot1.top > rcAnnot2.top) |
| 2455 return 1; | 2455 return 1; |
| 2456 return 0; | 2456 return 0; |
| 2457 } | 2457 } |
| 2458 | 2458 |
| 2459 void CBA_AnnotIterator::GenerateResults() { | 2459 void CBA_AnnotIterator::GenerateResults() { |
| 2460 ASSERT(m_pPageView != NULL); | 2460 ASSERT(m_pPageView != NULL); |
| 2461 | 2461 |
| 2462 switch (m_nTabs) { | 2462 switch (m_nTabs) { |
| 2463 case BAI_STRUCTURE: { | 2463 case BAI_STRUCTURE: { |
| 2464 for (int i = 0, sz = m_pPageView->CountAnnots(); i < sz; i++) { | 2464 for (size_t i = 0; i < m_pPageView->CountAnnots(); ++i) { |
| 2465 CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); | 2465 CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); |
| 2466 ASSERT(pAnnot != NULL); | 2466 ASSERT(pAnnot != NULL); |
| 2467 | 2467 |
| 2468 if (pAnnot->GetType() == m_sType && pAnnot->GetSubType() == m_sSubType) | 2468 if (pAnnot->GetType() == m_sType && pAnnot->GetSubType() == m_sSubType) |
| 2469 m_Annots.Add(pAnnot); | 2469 m_Annots.Add(pAnnot); |
| 2470 } | 2470 } |
| 2471 } break; | 2471 } break; |
| 2472 case BAI_ROW: { | 2472 case BAI_ROW: { |
| 2473 CPDFSDK_SortAnnots sa; | 2473 CPDFSDK_SortAnnots sa; |
| 2474 | 2474 |
| 2475 { | 2475 { |
| 2476 for (int i = 0, sz = m_pPageView->CountAnnots(); i < sz; i++) { | 2476 for (size_t i = 0; i < m_pPageView->CountAnnots(); ++i) { |
| 2477 CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); | 2477 CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); |
| 2478 ASSERT(pAnnot != NULL); | 2478 ASSERT(pAnnot != NULL); |
| 2479 | 2479 |
| 2480 if (pAnnot->GetType() == m_sType && | 2480 if (pAnnot->GetType() == m_sType && |
| 2481 pAnnot->GetSubType() == m_sSubType) | 2481 pAnnot->GetSubType() == m_sSubType) |
| 2482 sa.Add(pAnnot); | 2482 sa.Add(pAnnot); |
| 2483 } | 2483 } |
| 2484 } | 2484 } |
| 2485 | 2485 |
| 2486 if (sa.GetSize() > 0) { | 2486 if (sa.GetSize() > 0) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2545 | 2545 |
| 2546 aSelect.RemoveAll(); | 2546 aSelect.RemoveAll(); |
| 2547 } | 2547 } |
| 2548 } | 2548 } |
| 2549 sa.RemoveAll(); | 2549 sa.RemoveAll(); |
| 2550 } break; | 2550 } break; |
| 2551 case BAI_COLUMN: { | 2551 case BAI_COLUMN: { |
| 2552 CPDFSDK_SortAnnots sa; | 2552 CPDFSDK_SortAnnots sa; |
| 2553 | 2553 |
| 2554 { | 2554 { |
| 2555 for (int i = 0, sz = m_pPageView->CountAnnots(); i < sz; i++) { | 2555 for (size_t i = 0; i < m_pPageView->CountAnnots(); ++i) { |
| 2556 CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); | 2556 CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); |
| 2557 ASSERT(pAnnot != NULL); | 2557 ASSERT(pAnnot != NULL); |
| 2558 | 2558 |
| 2559 if (pAnnot->GetType() == m_sType && | 2559 if (pAnnot->GetType() == m_sType && |
| 2560 pAnnot->GetSubType() == m_sSubType) | 2560 pAnnot->GetSubType() == m_sSubType) |
| 2561 sa.Add(pAnnot); | 2561 sa.Add(pAnnot); |
| 2562 } | 2562 } |
| 2563 } | 2563 } |
| 2564 | 2564 |
| 2565 if (sa.GetSize() > 0) { | 2565 if (sa.GetSize() > 0) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2637 ASSERT(pAnnot != NULL); | 2637 ASSERT(pAnnot != NULL); |
| 2638 | 2638 |
| 2639 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); | 2639 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); |
| 2640 ASSERT(pPDFAnnot != NULL); | 2640 ASSERT(pPDFAnnot != NULL); |
| 2641 | 2641 |
| 2642 CPDF_Rect rcAnnot; | 2642 CPDF_Rect rcAnnot; |
| 2643 pPDFAnnot->GetRect(rcAnnot); | 2643 pPDFAnnot->GetRect(rcAnnot); |
| 2644 | 2644 |
| 2645 return rcAnnot; | 2645 return rcAnnot; |
| 2646 } | 2646 } |
| OLD | NEW |