| 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 "public/fpdfview.h" | 7 #include "public/fpdfview.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 } | 884 } |
| 885 const CPDF_OCContext::UsageType usage = | 885 const CPDF_OCContext::UsageType usage = |
| 886 (flags & FPDF_PRINTING) ? CPDF_OCContext::Print : CPDF_OCContext::View; | 886 (flags & FPDF_PRINTING) ? CPDF_OCContext::Print : CPDF_OCContext::View; |
| 887 pContext->m_pOptions->m_AddFlags = flags >> 8; | 887 pContext->m_pOptions->m_AddFlags = flags >> 8; |
| 888 pContext->m_pOptions->m_pOCContext = | 888 pContext->m_pOptions->m_pOCContext = |
| 889 new CPDF_OCContext(pPage->m_pDocument, usage); | 889 new CPDF_OCContext(pPage->m_pDocument, usage); |
| 890 | 890 |
| 891 CFX_Matrix matrix; | 891 CFX_Matrix matrix; |
| 892 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); | 892 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); |
| 893 | 893 |
| 894 FX_RECT clip; | |
| 895 clip.left = start_x; | |
| 896 clip.right = start_x + size_x; | |
| 897 clip.top = start_y; | |
| 898 clip.bottom = start_y + size_y; | |
| 899 pContext->m_pDevice->SaveState(); | 894 pContext->m_pDevice->SaveState(); |
| 900 pContext->m_pDevice->SetClip_Rect(&clip); | 895 pContext->m_pDevice->SetClip_Rect( |
| 896 FX_RECT(start_x, start_y, start_x + size_x, start_y + size_y)); |
| 901 | 897 |
| 902 pContext->m_pContext = new CPDF_RenderContext(pPage); | 898 pContext->m_pContext = new CPDF_RenderContext(pPage); |
| 903 pContext->m_pContext->AppendLayer(pPage, &matrix); | 899 pContext->m_pContext->AppendLayer(pPage, &matrix); |
| 904 | 900 |
| 905 if (flags & FPDF_ANNOT) { | 901 if (flags & FPDF_ANNOT) { |
| 906 pContext->m_pAnnots = new CPDF_AnnotList(pPage); | 902 pContext->m_pAnnots = new CPDF_AnnotList(pPage); |
| 907 FX_BOOL bPrinting = pContext->m_pDevice->GetDeviceClass() != FXDC_DISPLAY; | 903 FX_BOOL bPrinting = pContext->m_pDevice->GetDeviceClass() != FXDC_DISPLAY; |
| 908 pContext->m_pAnnots->DisplayAnnots(pPage, pContext->m_pContext, bPrinting, | 904 pContext->m_pAnnots->DisplayAnnots(pPage, pContext->m_pContext, bPrinting, |
| 909 &matrix, TRUE, NULL); | 905 &matrix, TRUE, NULL); |
| 910 } | 906 } |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 if (!buffer) { | 1134 if (!buffer) { |
| 1139 *buflen = len; | 1135 *buflen = len; |
| 1140 } else if (*buflen >= len) { | 1136 } else if (*buflen >= len) { |
| 1141 memcpy(buffer, utf16Name.c_str(), len); | 1137 memcpy(buffer, utf16Name.c_str(), len); |
| 1142 *buflen = len; | 1138 *buflen = len; |
| 1143 } else { | 1139 } else { |
| 1144 *buflen = -1; | 1140 *buflen = -1; |
| 1145 } | 1141 } |
| 1146 return (FPDF_DEST)pDestObj; | 1142 return (FPDF_DEST)pDestObj; |
| 1147 } | 1143 } |
| OLD | NEW |