| 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 "core/fpdfapi/fpdf_page/include/cpdf_form.h" | 7 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" |
| 8 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 8 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
| 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 return pStream; | 176 return pStream; |
| 177 | 177 |
| 178 if (CPDF_Dictionary* pDict = psub->AsDictionary()) { | 178 if (CPDF_Dictionary* pDict = psub->AsDictionary()) { |
| 179 CFX_ByteString as = pAnnotDict->GetStringBy("AS"); | 179 CFX_ByteString as = pAnnotDict->GetStringBy("AS"); |
| 180 if (as.IsEmpty()) { | 180 if (as.IsEmpty()) { |
| 181 CFX_ByteString value = pAnnotDict->GetStringBy("V"); | 181 CFX_ByteString value = pAnnotDict->GetStringBy("V"); |
| 182 if (value.IsEmpty()) { | 182 if (value.IsEmpty()) { |
| 183 CPDF_Dictionary* pDict = pAnnotDict->GetDictBy("Parent"); | 183 CPDF_Dictionary* pDict = pAnnotDict->GetDictBy("Parent"); |
| 184 value = pDict ? pDict->GetStringBy("V") : CFX_ByteString(); | 184 value = pDict ? pDict->GetStringBy("V") : CFX_ByteString(); |
| 185 } | 185 } |
| 186 if (value.IsEmpty() || !pDict->KeyExist(value.AsStringC())) | 186 if (value.IsEmpty() || !pDict->KeyExist(value)) |
| 187 as = "Off"; | 187 as = "Off"; |
| 188 else | 188 else |
| 189 as = value; | 189 as = value; |
| 190 } | 190 } |
| 191 return pDict->GetStreamBy(as.AsStringC()); | 191 return pDict->GetStreamBy(as); |
| 192 } | 192 } |
| 193 return nullptr; | 193 return nullptr; |
| 194 } | 194 } |
| 195 | 195 |
| 196 CPDF_Form* CPDF_Annot::GetAPForm(const CPDF_Page* pPage, AppearanceMode mode) { | 196 CPDF_Form* CPDF_Annot::GetAPForm(const CPDF_Page* pPage, AppearanceMode mode) { |
| 197 CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(m_pAnnotDict, mode); | 197 CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(m_pAnnotDict, mode); |
| 198 if (!pStream) | 198 if (!pStream) |
| 199 return nullptr; | 199 return nullptr; |
| 200 | 200 |
| 201 auto it = m_APMap.find(pStream); | 201 auto it = m_APMap.find(pStream); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 CFX_PathData path; | 349 CFX_PathData path; |
| 350 width /= 2; | 350 width /= 2; |
| 351 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, | 351 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, |
| 352 rect.top - width); | 352 rect.top - width); |
| 353 int fill_type = 0; | 353 int fill_type = 0; |
| 354 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { | 354 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { |
| 355 fill_type |= FXFILL_NOPATHSMOOTH; | 355 fill_type |= FXFILL_NOPATHSMOOTH; |
| 356 } | 356 } |
| 357 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); | 357 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); |
| 358 } | 358 } |
| OLD | NEW |