| 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/fpdfapi/fpdf_page/include/cpdf_form.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 169 } |
| 170 CFX_FloatRect form_bbox = pStream->GetDict()->GetRectBy("BBox"); | 170 CFX_FloatRect form_bbox = pStream->GetDict()->GetRectBy("BBox"); |
| 171 CFX_Matrix form_matrix = pStream->GetDict()->GetMatrixBy("Matrix"); | 171 CFX_Matrix form_matrix = pStream->GetDict()->GetMatrixBy("Matrix"); |
| 172 form_matrix.TransformRect(form_bbox); | 172 form_matrix.TransformRect(form_bbox); |
| 173 CFX_FloatRect arect = m_pWidgetDict->GetRectBy("Rect"); | 173 CFX_FloatRect arect = m_pWidgetDict->GetRectBy("Rect"); |
| 174 CFX_Matrix matrix; | 174 CFX_Matrix matrix; |
| 175 matrix.MatchRect(arect, form_bbox); | 175 matrix.MatchRect(arect, form_bbox); |
| 176 matrix.Concat(*pMatrix); | 176 matrix.Concat(*pMatrix); |
| 177 CPDF_Form form(m_pField->m_pForm->m_pDocument, | 177 CPDF_Form form(m_pField->m_pForm->m_pDocument, |
| 178 m_pField->m_pForm->m_pFormDict->GetDictBy("DR"), pStream); | 178 m_pField->m_pForm->m_pFormDict->GetDictBy("DR"), pStream); |
| 179 form.ParseContent(NULL, NULL, NULL, NULL); | 179 form.ParseContent(nullptr, nullptr, nullptr); |
| 180 CPDF_RenderContext context(pPage); | 180 CPDF_RenderContext context(pPage); |
| 181 context.AppendLayer(&form, &matrix); | 181 context.AppendLayer(&form, &matrix); |
| 182 context.Render(pDevice, pOptions, nullptr); | 182 context.Render(pDevice, pOptions, nullptr); |
| 183 } | 183 } |
| 184 static const FX_CHAR* const g_sHighlightingMode[] = { | 184 static const FX_CHAR* const g_sHighlightingMode[] = { |
| 185 // Must match order of HiglightingMode enum. | 185 // Must match order of HiglightingMode enum. |
| 186 "N", "I", "O", "P", "T", nullptr}; | 186 "N", "I", "O", "P", "T", nullptr}; |
| 187 CPDF_FormControl::HighlightingMode CPDF_FormControl::GetHighlightingMode() { | 187 CPDF_FormControl::HighlightingMode CPDF_FormControl::GetHighlightingMode() { |
| 188 if (!m_pWidgetDict) { | 188 if (!m_pWidgetDict) { |
| 189 return Invert; | 189 return Invert; |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 } | 428 } |
| 429 | 429 |
| 430 CPDF_IconFit CPDF_ApSettings::GetIconFit() const { | 430 CPDF_IconFit CPDF_ApSettings::GetIconFit() const { |
| 431 return CPDF_IconFit(m_pDict ? m_pDict->GetDictBy("IF") : nullptr); | 431 return CPDF_IconFit(m_pDict ? m_pDict->GetDictBy("IF") : nullptr); |
| 432 } | 432 } |
| 433 | 433 |
| 434 int CPDF_ApSettings::GetTextPosition() const { | 434 int CPDF_ApSettings::GetTextPosition() const { |
| 435 return m_pDict ? m_pDict->GetIntegerBy("TP", TEXTPOS_CAPTION) | 435 return m_pDict ? m_pDict->GetIntegerBy("TP", TEXTPOS_CAPTION) |
| 436 : TEXTPOS_CAPTION; | 436 : TEXTPOS_CAPTION; |
| 437 } | 437 } |
| OLD | NEW |