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 "../../include/fpdfdoc/fpdf_doc.h" | 7 #include "../../include/fpdfdoc/fpdf_doc.h" |
8 CPDF_FormControl::CPDF_FormControl(CPDF_FormField* pField, CPDF_Dictionary* pWid
getDict) | 8 CPDF_FormControl::CPDF_FormControl(CPDF_FormField* pField, CPDF_Dictionary* pWid
getDict) |
9 { | 9 { |
10 m_pField = pField; | 10 m_pField = pField; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 CPDF_ApSettings mk = GetMK(FALSE); | 241 CPDF_ApSettings mk = GetMK(FALSE); |
242 return mk.GetIconFit(); | 242 return mk.GetIconFit(); |
243 } | 243 } |
244 int CPDF_FormControl::GetTextPosition() | 244 int CPDF_FormControl::GetTextPosition() |
245 { | 245 { |
246 CPDF_ApSettings mk = GetMK(FALSE); | 246 CPDF_ApSettings mk = GetMK(FALSE); |
247 return mk.GetTextPosition(); | 247 return mk.GetTextPosition(); |
248 } | 248 } |
249 CPDF_Action CPDF_FormControl::GetAction() | 249 CPDF_Action CPDF_FormControl::GetAction() |
250 { | 250 { |
251 if (m_pWidgetDict == NULL) { | 251 if (!m_pWidgetDict) { |
252 return NULL; | 252 return CPDF_Action(); |
253 } | 253 } |
254 if (m_pWidgetDict->KeyExist("A")) { | 254 if (m_pWidgetDict->KeyExist("A")) { |
255 return m_pWidgetDict->GetDict("A"); | 255 return CPDF_Action(m_pWidgetDict->GetDict("A")); |
256 } else { | |
257 CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "A"); | |
258 if (pObj == NULL) { | |
259 return NULL; | |
260 } | |
261 return pObj->GetDict(); | |
262 } | 256 } |
| 257 CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "A"); |
| 258 if (!pObj) { |
| 259 return CPDF_Action(); |
| 260 } |
| 261 return CPDF_Action(pObj->GetDict()); |
263 } | 262 } |
264 CPDF_AAction CPDF_FormControl::GetAdditionalAction() | 263 CPDF_AAction CPDF_FormControl::GetAdditionalAction() |
265 { | 264 { |
266 if (m_pWidgetDict == NULL) { | 265 if (m_pWidgetDict == NULL) { |
267 return NULL; | 266 return NULL; |
268 } | 267 } |
269 if (m_pWidgetDict->KeyExist("AA")) { | 268 if (m_pWidgetDict->KeyExist("AA")) { |
270 return m_pWidgetDict->GetDict("AA"); | 269 return m_pWidgetDict->GetDict("AA"); |
271 } else { | 270 } else { |
272 return m_pField->GetAdditionalAction(); | 271 return m_pField->GetAdditionalAction(); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 } | 451 } |
453 return m_pDict->GetDict(FX_BSTRC("IF")); | 452 return m_pDict->GetDict(FX_BSTRC("IF")); |
454 } | 453 } |
455 int CPDF_ApSettings::GetTextPosition() | 454 int CPDF_ApSettings::GetTextPosition() |
456 { | 455 { |
457 if (m_pDict == NULL) { | 456 if (m_pDict == NULL) { |
458 return TEXTPOS_CAPTION; | 457 return TEXTPOS_CAPTION; |
459 } | 458 } |
460 return m_pDict->GetInteger(FX_BSTRC("TP"), TEXTPOS_CAPTION); | 459 return m_pDict->GetInteger(FX_BSTRC("TP"), TEXTPOS_CAPTION); |
461 } | 460 } |
OLD | NEW |