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 "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
8 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
9 #include "../include/fpdfxfa/fpdfxfa_util.h" | 10 #include "../include/fpdfxfa/fpdfxfa_util.h" |
10 #include "../include/fsdk_mgr.h" | 11 #include "../include/fsdk_mgr.h" |
11 #include "../include/fsdk_baseannot.h" | 12 #include "../include/fsdk_baseannot.h" |
12 #include "../include/fsdk_baseform.h" | 13 #include "../include/fsdk_baseform.h" |
13 #include "../include/formfiller/FFL_FormFiller.h" | 14 #include "../include/formfiller/FFL_FormFiller.h" |
14 #include "../include/fsdk_actionhandler.h" | 15 #include "../include/fsdk_actionhandler.h" |
15 | 16 |
16 #include "../include/javascript/IJavaScript.h" | 17 #include "../include/javascript/IJavaScript.h" |
(...skipping 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2452 return m_pDocument; | 2453 return m_pDocument; |
2453 } | 2454 } |
2454 | 2455 |
2455 FX_BOOL CPDFSDK_InterForm::HighlightWidgets() | 2456 FX_BOOL CPDFSDK_InterForm::HighlightWidgets() |
2456 { | 2457 { |
2457 return FALSE; | 2458 return FALSE; |
2458 } | 2459 } |
2459 | 2460 |
2460 CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL b
Next) const | 2461 CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL b
Next) const |
2461 { | 2462 { |
2462 » ASSERT(pWidget != NULL); | 2463 nonstd::unique_ptr<CBA_AnnotIterator> pIterator( |
| 2464 new CBA_AnnotIterator(pWidget->GetPageView(), "Widget", "")); |
2463 | 2465 |
2464 » CBA_AnnotIterator* pIterator = new CBA_AnnotIterator(pWidget->GetPageVie
w(), "Widget", "");//XfA? | 2466 if (bNext) { |
2465 » ASSERT(pIterator != NULL); | 2467 return (CPDFSDK_Widget*)pIterator->GetNextAnnot(pWidget); |
2466 | 2468 } |
2467 » CPDFSDK_Widget* pRet = NULL; | 2469 return (CPDFSDK_Widget*)pIterator->GetPrevAnnot(pWidget); |
2468 | |
2469 » if (bNext) | |
2470 » » pRet = (CPDFSDK_Widget*)pIterator->GetNextAnnot(pWidget); | |
2471 » else | |
2472 » » pRet = (CPDFSDK_Widget*)pIterator->GetPrevAnnot(pWidget); | |
2473 | |
2474 » pIterator->Release(); | |
2475 » | |
2476 » return pRet; | |
2477 | |
2478 } | 2470 } |
2479 | 2471 |
2480 CPDFSDK_Widget* CPDFSDK_InterForm::GetWidget(CPDF_FormControl* pControl) const | 2472 CPDFSDK_Widget* CPDFSDK_InterForm::GetWidget(CPDF_FormControl* pControl) const |
2481 { | 2473 { |
2482 if(!pControl || !m_pInterForm) return NULL; | 2474 if(!pControl || !m_pInterForm) return NULL; |
2483 | 2475 |
2484 CPDFSDK_Widget* pWidget = NULL; | 2476 CPDFSDK_Widget* pWidget = NULL; |
2485 m_Map.Lookup(pControl, pWidget); | 2477 m_Map.Lookup(pControl, pWidget); |
2486 | 2478 |
2487 if (pWidget) return pWidget; | 2479 if (pWidget) return pWidget; |
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3796 | 3788 |
3797 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); | 3789 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); |
3798 ASSERT(pPDFAnnot != NULL); | 3790 ASSERT(pPDFAnnot != NULL); |
3799 | 3791 |
3800 CPDF_Rect rcAnnot; | 3792 CPDF_Rect rcAnnot; |
3801 pPDFAnnot->GetRect(rcAnnot); | 3793 pPDFAnnot->GetRect(rcAnnot); |
3802 | 3794 |
3803 return rcAnnot; | 3795 return rcAnnot; |
3804 } | 3796 } |
3805 | 3797 |
OLD | NEW |