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 "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
8 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 8 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_string.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_string.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 case DOCTYPE_PDF: | 137 case DOCTYPE_PDF: |
138 case DOCTYPE_STATIC_XFA: | 138 case DOCTYPE_STATIC_XFA: |
139 if (m_pPDFDoc) | 139 if (m_pPDFDoc) |
140 return m_pPDFDoc->GetPageCount(); | 140 return m_pPDFDoc->GetPageCount(); |
141 case DOCTYPE_DYNAMIC_XFA: | 141 case DOCTYPE_DYNAMIC_XFA: |
142 if (m_pXFADoc) | 142 if (m_pXFADoc) |
143 return m_pXFADocView->CountPageViews(); | 143 return m_pXFADocView->CountPageViews(); |
144 default: | 144 default: |
145 return 0; | 145 return 0; |
146 } | 146 } |
147 | |
148 return 0; | |
149 } | 147 } |
150 | 148 |
151 CPDFXFA_Page* CPDFXFA_Document::GetPage(int page_index) { | 149 CPDFXFA_Page* CPDFXFA_Document::GetPage(int page_index) { |
152 if (page_index < 0) | 150 if (page_index < 0) |
153 return nullptr; | 151 return nullptr; |
154 CPDFXFA_Page* pPage = nullptr; | 152 CPDFXFA_Page* pPage = nullptr; |
155 int nCount = m_XFAPageList.GetSize(); | 153 int nCount = m_XFAPageList.GetSize(); |
156 if (nCount > 0 && page_index < nCount) { | 154 if (nCount > 0 && page_index < nCount) { |
157 pPage = m_XFAPageList.GetAt(page_index); | 155 pPage = m_XFAPageList.GetAt(page_index); |
158 if (pPage) | 156 if (pPage) |
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 } | 1278 } |
1281 | 1279 |
1282 return _GetHValueByName(szPropName, hValue, | 1280 return _GetHValueByName(szPropName, hValue, |
1283 m_pSDKDoc->GetEnv()->GetJSRuntime()); | 1281 m_pSDKDoc->GetEnv()->GetJSRuntime()); |
1284 } | 1282 } |
1285 FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name, | 1283 FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name, |
1286 FXJSE_HVALUE hValue, | 1284 FXJSE_HVALUE hValue, |
1287 IJS_Runtime* runTime) { | 1285 IJS_Runtime* runTime) { |
1288 return runTime->GetHValueByName(utf8Name, hValue); | 1286 return runTime->GetHValueByName(utf8Name, hValue); |
1289 } | 1287 } |
OLD | NEW |