OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/fpdfdoc/cpdf_formcontrol.h" | 7 #include "core/fpdfdoc/cpdf_formcontrol.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 CFX_ByteString csAS = m_pWidgetDict->GetStringFor("AS", "Off"); | 62 CFX_ByteString csAS = m_pWidgetDict->GetStringFor("AS", "Off"); |
63 if (csAS != "Off") | 63 if (csAS != "Off") |
64 m_pWidgetDict->SetNameFor("AS", csValue); | 64 m_pWidgetDict->SetNameFor("AS", csValue); |
65 | 65 |
66 CPDF_Dictionary* pAP = m_pWidgetDict->GetDictFor("AP"); | 66 CPDF_Dictionary* pAP = m_pWidgetDict->GetDictFor("AP"); |
67 if (!pAP) | 67 if (!pAP) |
68 return; | 68 return; |
69 | 69 |
70 for (const auto& it : *pAP) { | 70 for (const auto& it : *pAP) { |
71 CPDF_Object* pObj1 = it.second.get(); | 71 CPDF_Object* pObj1 = it.second; |
72 if (!pObj1) | 72 if (!pObj1) |
73 continue; | 73 continue; |
74 | 74 |
75 CPDF_Object* pObjDirect1 = pObj1->GetDirect(); | 75 CPDF_Object* pObjDirect1 = pObj1->GetDirect(); |
76 CPDF_Dictionary* pSubDict = pObjDirect1->AsDictionary(); | 76 CPDF_Dictionary* pSubDict = pObjDirect1->AsDictionary(); |
77 if (!pSubDict) | 77 if (!pSubDict) |
78 continue; | 78 continue; |
79 | 79 |
80 auto subdict_it = pSubDict->begin(); | 80 auto subdict_it = pSubDict->begin(); |
81 while (subdict_it != pSubDict->end()) { | 81 while (subdict_it != pSubDict->end()) { |
82 const CFX_ByteString& csKey2 = subdict_it->first; | 82 const CFX_ByteString& csKey2 = subdict_it->first; |
83 CPDF_Object* pObj2 = subdict_it->second.get(); | 83 CPDF_Object* pObj2 = subdict_it->second; |
84 ++subdict_it; | 84 ++subdict_it; |
85 if (!pObj2) | 85 if (!pObj2) |
86 continue; | 86 continue; |
87 if (csKey2 != "Off") { | 87 if (csKey2 != "Off") { |
88 pSubDict->ReplaceKey(csKey2, csValue); | 88 pSubDict->ReplaceKey(csKey2, csValue); |
89 break; | 89 break; |
90 } | 90 } |
91 } | 91 } |
92 } | 92 } |
93 } | 93 } |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 if (!m_pWidgetDict) | 321 if (!m_pWidgetDict) |
322 return 0; | 322 return 0; |
323 if (m_pWidgetDict->KeyExist("Q")) | 323 if (m_pWidgetDict->KeyExist("Q")) |
324 return m_pWidgetDict->GetIntegerFor("Q", 0); | 324 return m_pWidgetDict->GetIntegerFor("Q", 0); |
325 | 325 |
326 CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "Q"); | 326 CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "Q"); |
327 if (pObj) | 327 if (pObj) |
328 return pObj->GetInteger(); | 328 return pObj->GetInteger(); |
329 return m_pField->m_pForm->GetFormAlignment(); | 329 return m_pField->m_pForm->GetFormAlignment(); |
330 } | 330 } |
OLD | NEW |