| 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 #define IsFloatZero(f) ((f) < 0.01 && (f) > -0.01) | 19 #define IsFloatZero(f) ((f) < 0.01 && (f) > -0.01) |
| 18 #define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb))) | 20 #define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb))) |
| 19 #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) | 21 #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) |
| 20 #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb)) | 22 #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb)) |
| 21 | 23 |
| 22 CPDFSDK_Widget::CPDFSDK_Widget(CPDF_Annot* pAnnot, | 24 CPDFSDK_Widget::CPDFSDK_Widget(CPDF_Annot* pAnnot, |
| 23 CPDFSDK_PageView* pPageView, | 25 CPDFSDK_PageView* pPageView, |
| 24 CPDFSDK_InterForm* pInterForm) | 26 CPDFSDK_InterForm* pInterForm) |
| 25 : CPDFSDK_BAAnnot(pAnnot, pPageView), | 27 : CPDFSDK_BAAnnot(pAnnot, pPageView), |
| (...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2127 } | 2129 } |
| 2128 | 2130 |
| 2129 FX_COLORREF CPDFSDK_InterForm::GetHighlightColor(int nFieldType) { | 2131 FX_COLORREF CPDFSDK_InterForm::GetHighlightColor(int nFieldType) { |
| 2130 if (nFieldType < 0 || nFieldType > kNumFieldTypes) | 2132 if (nFieldType < 0 || nFieldType > kNumFieldTypes) |
| 2131 return FXSYS_RGB(255, 255, 255); | 2133 return FXSYS_RGB(255, 255, 255); |
| 2132 if (nFieldType == 0) | 2134 if (nFieldType == 0) |
| 2133 return m_aHighlightColor[0]; | 2135 return m_aHighlightColor[0]; |
| 2134 return m_aHighlightColor[nFieldType - 1]; | 2136 return m_aHighlightColor[nFieldType - 1]; |
| 2135 } | 2137 } |
| 2136 | 2138 |
| 2137 /* ------------------------- CBA_AnnotIterator ------------------------- */ | |
| 2138 | |
| 2139 CBA_AnnotIterator::CBA_AnnotIterator(CPDFSDK_PageView* pPageView, | 2139 CBA_AnnotIterator::CBA_AnnotIterator(CPDFSDK_PageView* pPageView, |
| 2140 const CFX_ByteString& sType, | 2140 const CFX_ByteString& sType, |
| 2141 const CFX_ByteString& sSubType) | 2141 const CFX_ByteString& sSubType) |
| 2142 : m_pPageView(pPageView), | 2142 : m_pPageView(pPageView), |
| 2143 m_sType(sType), | 2143 m_sType(sType), |
| 2144 m_sSubType(sSubType), | 2144 m_sSubType(sSubType), |
| 2145 m_nTabs(BAI_STRUCTURE) { | 2145 m_nTabs(BAI_STRUCTURE) { |
| 2146 CPDF_Page* pPDFPage = m_pPageView->GetPDFPage(); | 2146 CPDF_Page* pPDFPage = m_pPageView->GetPDFPage(); |
| 2147 CFX_ByteString sTabs = pPDFPage->m_pFormDict->GetString("Tabs"); | 2147 CFX_ByteString sTabs = pPDFPage->m_pFormDict->GetString("Tabs"); |
| 2148 | 2148 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2352 break; | 2352 break; |
| 2353 } | 2353 } |
| 2354 } | 2354 } |
| 2355 } | 2355 } |
| 2356 | 2356 |
| 2357 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { | 2357 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { |
| 2358 CPDF_Rect rcAnnot; | 2358 CPDF_Rect rcAnnot; |
| 2359 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); | 2359 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); |
| 2360 return rcAnnot; | 2360 return rcAnnot; |
| 2361 } | 2361 } |
| OLD | NEW |