| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium 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 #include "pdf/pdfium/pdfium_page.h" | 5 #include "pdf/pdfium/pdfium_page.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 if (engine_->form()) { | 111 if (engine_->form()) { |
| 112 FORM_OnBeforeClosePage(page_, engine_->form()); | 112 FORM_OnBeforeClosePage(page_, engine_->form()); |
| 113 } | 113 } |
| 114 FPDF_ClosePage(page_); | 114 FPDF_ClosePage(page_); |
| 115 page_ = nullptr; | 115 page_ = nullptr; |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 FPDF_PAGE PDFiumPage::GetPage() { | 119 FPDF_PAGE PDFiumPage::GetPage() { |
| 120 ScopedUnsupportedFeature scoped_unsupported_feature(engine_); | 120 ScopedUnsupportedFeature scoped_unsupported_feature(engine_); |
| 121 ScopedSubstFont scoped_subst_font(engine_); |
| 121 if (!available_) | 122 if (!available_) |
| 122 return nullptr; | 123 return nullptr; |
| 123 if (!page_) { | 124 if (!page_) { |
| 124 ScopedLoadCounter scoped_load(this); | 125 ScopedLoadCounter scoped_load(this); |
| 125 page_ = FPDF_LoadPage(engine_->doc(), index_); | 126 page_ = FPDF_LoadPage(engine_->doc(), index_); |
| 126 if (page_ && engine_->form()) { | 127 if (page_ && engine_->form()) { |
| 127 FORM_OnAfterLoadPage(page_, engine_->form()); | 128 FORM_OnAfterLoadPage(page_, engine_->form()); |
| 128 } | 129 } |
| 129 } | 130 } |
| 130 return page_; | 131 return page_; |
| 131 } | 132 } |
| 132 | 133 |
| 133 FPDF_PAGE PDFiumPage::GetPrintPage() { | 134 FPDF_PAGE PDFiumPage::GetPrintPage() { |
| 134 ScopedUnsupportedFeature scoped_unsupported_feature(engine_); | 135 ScopedUnsupportedFeature scoped_unsupported_feature(engine_); |
| 136 ScopedSubstFont scoped_subst_font(engine_); |
| 135 if (!available_) | 137 if (!available_) |
| 136 return nullptr; | 138 return nullptr; |
| 137 if (!page_) { | 139 if (!page_) { |
| 138 ScopedLoadCounter scoped_load(this); | 140 ScopedLoadCounter scoped_load(this); |
| 139 page_ = FPDF_LoadPage(engine_->doc(), index_); | 141 page_ = FPDF_LoadPage(engine_->doc(), index_); |
| 140 } | 142 } |
| 141 return page_; | 143 return page_; |
| 142 } | 144 } |
| 143 | 145 |
| 144 void PDFiumPage::ClosePrintPage() { | 146 void PDFiumPage::ClosePrintPage() { |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 page_->loading_count_--; | 518 page_->loading_count_--; |
| 517 } | 519 } |
| 518 | 520 |
| 519 PDFiumPage::Link::Link() = default; | 521 PDFiumPage::Link::Link() = default; |
| 520 | 522 |
| 521 PDFiumPage::Link::Link(const Link& that) = default; | 523 PDFiumPage::Link::Link(const Link& that) = default; |
| 522 | 524 |
| 523 PDFiumPage::Link::~Link() = default; | 525 PDFiumPage::Link::~Link() = default; |
| 524 | 526 |
| 525 } // namespace chrome_pdf | 527 } // namespace chrome_pdf |
| OLD | NEW |