OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_engine.h" | 5 #include "pdf/pdfium/pdfium_engine.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2428 case PERMISSION_PRINT_HIGH_QUALITY: | 2428 case PERMISSION_PRINT_HIGH_QUALITY: |
2429 // With security handler revision 2 rules, check the same bit for high | 2429 // With security handler revision 2 rules, check the same bit for high |
2430 // and low quality. See table 3.20 in the PDF 1.7 spec. | 2430 // and low quality. See table 3.20 in the PDF 1.7 spec. |
2431 return (permissions_ & kPDFPermissionPrintLowQualityMask) != 0; | 2431 return (permissions_ & kPDFPermissionPrintLowQualityMask) != 0; |
2432 default: | 2432 default: |
2433 return true; | 2433 return true; |
2434 } | 2434 } |
2435 } | 2435 } |
2436 | 2436 |
2437 void PDFiumEngine::SelectAll() { | 2437 void PDFiumEngine::SelectAll() { |
| 2438 if (in_form_text_area_) |
| 2439 return; |
| 2440 |
2438 SelectionChangeInvalidator selection_invalidator(this); | 2441 SelectionChangeInvalidator selection_invalidator(this); |
2439 | 2442 |
2440 selection_.clear(); | 2443 selection_.clear(); |
2441 for (const auto& page : pages_) { | 2444 for (const auto& page : pages_) { |
2442 if (page->available()) | 2445 if (page->available()) |
2443 selection_.push_back(PDFiumRange(page.get(), 0, page->GetCharCount())); | 2446 selection_.push_back(PDFiumRange(page.get(), 0, page->GetCharCount())); |
2444 } | 2447 } |
2445 } | 2448 } |
2446 | 2449 |
2447 int PDFiumEngine::GetNumberOfPages() { | 2450 int PDFiumEngine::GetNumberOfPages() { |
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4208 FPDF_DOCUMENT doc = | 4211 FPDF_DOCUMENT doc = |
4209 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); | 4212 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); |
4210 if (!doc) | 4213 if (!doc) |
4211 return false; | 4214 return false; |
4212 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 4215 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
4213 FPDF_CloseDocument(doc); | 4216 FPDF_CloseDocument(doc); |
4214 return success; | 4217 return success; |
4215 } | 4218 } |
4216 | 4219 |
4217 } // namespace chrome_pdf | 4220 } // namespace chrome_pdf |
OLD | NEW |