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 "fpdfsdk/include/fsdk_baseform.h" |
| 8 |
7 #include <memory> | 9 #include <memory> |
8 | 10 |
9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" | 11 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" |
10 #include "fpdfsdk/include/fsdk_actionhandler.h" | 12 #include "fpdfsdk/include/fsdk_actionhandler.h" |
11 #include "fpdfsdk/include/fsdk_baseannot.h" | 13 #include "fpdfsdk/include/fsdk_baseannot.h" |
12 #include "fpdfsdk/include/fsdk_baseform.h" | |
13 #include "fpdfsdk/include/fsdk_define.h" | 14 #include "fpdfsdk/include/fsdk_define.h" |
14 #include "fpdfsdk/include/fsdk_mgr.h" | 15 #include "fpdfsdk/include/fsdk_mgr.h" |
15 #include "fpdfsdk/include/javascript/IJavaScript.h" | 16 #include "fpdfsdk/include/javascript/IJavaScript.h" |
| 17 #include "fpdfsdk/include/pdfwindow/PWL_Utils.h" |
16 | 18 |
17 #ifdef PDF_ENABLE_XFA | 19 #ifdef PDF_ENABLE_XFA |
18 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 20 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
19 #include "../include/fpdfxfa/fpdfxfa_util.h" | 21 #include "../include/fpdfxfa/fpdfxfa_util.h" |
20 #endif // PDF_ENABLE_XFA | 22 #endif // PDF_ENABLE_XFA |
21 | 23 |
22 #define IsFloatZero(f) ((f) < 0.01 && (f) > -0.01) | 24 #define IsFloatZero(f) ((f) < 0.01 && (f) > -0.01) |
23 #define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb))) | 25 #define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb))) |
24 #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) | 26 #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) |
25 #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb)) | 27 #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb)) |
(...skipping 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2789 } | 2791 } |
2790 | 2792 |
2791 FX_COLORREF CPDFSDK_InterForm::GetHighlightColor(int nFieldType) { | 2793 FX_COLORREF CPDFSDK_InterForm::GetHighlightColor(int nFieldType) { |
2792 if (nFieldType < 0 || nFieldType > kNumFieldTypes) | 2794 if (nFieldType < 0 || nFieldType > kNumFieldTypes) |
2793 return FXSYS_RGB(255, 255, 255); | 2795 return FXSYS_RGB(255, 255, 255); |
2794 if (nFieldType == 0) | 2796 if (nFieldType == 0) |
2795 return m_aHighlightColor[0]; | 2797 return m_aHighlightColor[0]; |
2796 return m_aHighlightColor[nFieldType - 1]; | 2798 return m_aHighlightColor[nFieldType - 1]; |
2797 } | 2799 } |
2798 | 2800 |
2799 /* ------------------------- CBA_AnnotIterator ------------------------- */ | |
2800 | |
2801 CBA_AnnotIterator::CBA_AnnotIterator(CPDFSDK_PageView* pPageView, | 2801 CBA_AnnotIterator::CBA_AnnotIterator(CPDFSDK_PageView* pPageView, |
2802 const CFX_ByteString& sType, | 2802 const CFX_ByteString& sType, |
2803 const CFX_ByteString& sSubType) | 2803 const CFX_ByteString& sSubType) |
2804 : m_pPageView(pPageView), | 2804 : m_pPageView(pPageView), |
2805 m_sType(sType), | 2805 m_sType(sType), |
2806 m_sSubType(sSubType), | 2806 m_sSubType(sSubType), |
2807 m_nTabs(BAI_STRUCTURE) { | 2807 m_nTabs(BAI_STRUCTURE) { |
2808 CPDF_Page* pPDFPage = m_pPageView->GetPDFPage(); | 2808 CPDF_Page* pPDFPage = m_pPageView->GetPDFPage(); |
2809 CFX_ByteString sTabs = pPDFPage->m_pFormDict->GetString("Tabs"); | 2809 CFX_ByteString sTabs = pPDFPage->m_pFormDict->GetString("Tabs"); |
2810 | 2810 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3014 break; | 3014 break; |
3015 } | 3015 } |
3016 } | 3016 } |
3017 } | 3017 } |
3018 | 3018 |
3019 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { | 3019 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { |
3020 CPDF_Rect rcAnnot; | 3020 CPDF_Rect rcAnnot; |
3021 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); | 3021 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); |
3022 return rcAnnot; | 3022 return rcAnnot; |
3023 } | 3023 } |
OLD | NEW |