Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2711)

Unified Diff: core/src/fpdfdoc/doc_formfield.cpp

Issue 396173003: Adjust null object check (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: respond to comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« core/src/fpdfdoc/doc_ap.cpp ('K') | « core/src/fpdfdoc/doc_ap.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_formfield.cpp
diff --git a/core/src/fpdfdoc/doc_formfield.cpp b/core/src/fpdfdoc/doc_formfield.cpp
index e51acf94a111a5216045773ba04e45fe918db420..5715c20fdfc48b3287c9e3defaa1626418e98432 100644
--- a/core/src/fpdfdoc/doc_formfield.cpp
+++ b/core/src/fpdfdoc/doc_formfield.cpp
@@ -1077,9 +1077,12 @@ FX_BOOL CPDF_FormField::ClearSelectedOptions(FX_BOOL bNotify)
}
void CPDF_FormField::LoadDA()
{
- CFX_ByteString DA = FPDF_GetFieldAttr(m_pDict, "DA") ? FPDF_GetFieldAttr(m_pDict, "DA")->GetString() : CFX_ByteString();
- if (DA.IsEmpty()) {
- DA = m_pForm->m_pFormDict ? m_pForm->m_pFormDict->GetString("DA") : CFX_ByteString();
+ CFX_ByteString DA;
+ if (CPDF_Object* pObj_t = FPDF_GetFieldAttr(m_pDict, "DA")){
Nico 2014/07/21 16:48:12 nit: add the same space here
Bo Xu 2014/07/21 17:01:29 Done.
+ DA = pObj_t->GetString();
+ }
+ if (DA.IsEmpty() && m_pForm->m_pFormDict) {
+ DA = m_pForm->m_pFormDict->GetString("DA");;
Nico 2014/07/21 16:48:12 nit: there's one ; too many here
Bo Xu 2014/07/21 17:01:30 Done.
}
if (DA.IsEmpty()) {
return;
« core/src/fpdfdoc/doc_ap.cpp ('K') | « core/src/fpdfdoc/doc_ap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698