| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "core/include/fpdfdoc/fpdf_doc.h" | 9 #include "core/include/fpdfdoc/fpdf_doc.h" |
| 10 | 10 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 CFX_Matrix form_matrix = pStream->GetDict()->GetMatrix("Matrix"); | 163 CFX_Matrix form_matrix = pStream->GetDict()->GetMatrix("Matrix"); |
| 164 form_matrix.TransformRect(form_bbox); | 164 form_matrix.TransformRect(form_bbox); |
| 165 CFX_FloatRect arect = m_pWidgetDict->GetRect("Rect"); | 165 CFX_FloatRect arect = m_pWidgetDict->GetRect("Rect"); |
| 166 CFX_Matrix matrix; | 166 CFX_Matrix matrix; |
| 167 matrix.MatchRect(arect, form_bbox); | 167 matrix.MatchRect(arect, form_bbox); |
| 168 matrix.Concat(*pMatrix); | 168 matrix.Concat(*pMatrix); |
| 169 CPDF_Form form(m_pField->m_pForm->m_pDocument, | 169 CPDF_Form form(m_pField->m_pForm->m_pDocument, |
| 170 m_pField->m_pForm->m_pFormDict->GetDict("DR"), pStream); | 170 m_pField->m_pForm->m_pFormDict->GetDict("DR"), pStream); |
| 171 form.ParseContent(NULL, NULL, NULL, NULL); | 171 form.ParseContent(NULL, NULL, NULL, NULL); |
| 172 CPDF_RenderContext context(pPage); | 172 CPDF_RenderContext context(pPage); |
| 173 context.DrawObjectList(pDevice, &form, &matrix, pOptions); | 173 context.AppendLayer(&form, &matrix); |
| 174 context.Render(pDevice, pOptions, nullptr); |
| 174 } | 175 } |
| 175 static const FX_CHAR* const g_sHighlightingMode[] = { | 176 static const FX_CHAR* const g_sHighlightingMode[] = { |
| 176 // Must match order of HiglightingMode enum. | 177 // Must match order of HiglightingMode enum. |
| 177 "N", "I", "O", "P", "T", nullptr}; | 178 "N", "I", "O", "P", "T", nullptr}; |
| 178 CPDF_FormControl::HighlightingMode CPDF_FormControl::GetHighlightingMode() { | 179 CPDF_FormControl::HighlightingMode CPDF_FormControl::GetHighlightingMode() { |
| 179 if (!m_pWidgetDict) { | 180 if (!m_pWidgetDict) { |
| 180 return Invert; | 181 return Invert; |
| 181 } | 182 } |
| 182 CFX_ByteString csH = m_pWidgetDict->GetString("H", "I"); | 183 CFX_ByteString csH = m_pWidgetDict->GetString("H", "I"); |
| 183 for (int i = 0; g_sHighlightingMode[i]; ++i) { | 184 for (int i = 0; g_sHighlightingMode[i]; ++i) { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 return m_pDict ? m_pDict->GetStream(csEntry) : nullptr; | 417 return m_pDict ? m_pDict->GetStream(csEntry) : nullptr; |
| 417 } | 418 } |
| 418 | 419 |
| 419 CPDF_IconFit CPDF_ApSettings::GetIconFit() const { | 420 CPDF_IconFit CPDF_ApSettings::GetIconFit() const { |
| 420 return m_pDict ? m_pDict->GetDict("IF") : nullptr; | 421 return m_pDict ? m_pDict->GetDict("IF") : nullptr; |
| 421 } | 422 } |
| 422 | 423 |
| 423 int CPDF_ApSettings::GetTextPosition() const { | 424 int CPDF_ApSettings::GetTextPosition() const { |
| 424 return m_pDict ? m_pDict->GetInteger("TP", TEXTPOS_CAPTION) : TEXTPOS_CAPTION; | 425 return m_pDict ? m_pDict->GetInteger("TP", TEXTPOS_CAPTION) : TEXTPOS_CAPTION; |
| 425 } | 426 } |
| OLD | NEW |