Index: fpdfsdk/src/fsdk_annothandler.cpp |
diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp |
index 30abd0816fcb6a9d781ee0de280f415a223b42f7..daea4045d4e09a68b9faa126abefdf27f357044d 100644 |
--- a/fpdfsdk/src/fsdk_annothandler.cpp |
+++ b/fpdfsdk/src/fsdk_annothandler.cpp |
@@ -384,25 +384,19 @@ FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) |
return FALSE; |
} |
-CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) |
+CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) |
{ |
- ASSERT(pPage != NULL); |
- pPage->GetPDFDocument(); |
- |
- CPDFSDK_Document* pSDKDoc = m_pApp->GetCurrentDoc(); |
- ASSERT(pSDKDoc); |
+ CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument(); |
Lei Zhang
2015/07/16 17:05:06
kill tabs
Tom Sepez
2015/07/16 18:01:28
Untabified file.
|
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterForm(); |
- ASSERT(pInterForm != NULL); |
- |
- CPDFSDK_Widget* pWidget = NULL; |
- if (CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(pInterForm->GetInterForm(), pAnnot->GetAnnotDict())) |
- { |
- pWidget = new CPDFSDK_Widget(pAnnot, pPage, pInterForm); |
- pInterForm->AddMap(pCtrl, pWidget); |
- CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); |
- if(pPDFInterForm && pPDFInterForm->NeedConstructAP()) |
- pWidget->ResetAppearance(NULL,FALSE); |
- } |
+ CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(pInterForm->GetInterForm(), pAnnot->GetAnnotDict()); |
+ if (!pCtrl) |
+ return nullptr; |
+ |
+ CPDFSDK_Widget* pWidget = new CPDFSDK_Widget(pAnnot, pPage, pInterForm); |
+ pInterForm->AddMap(pCtrl, pWidget); |
+ CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); |
+ if (pPDFInterForm && pPDFInterForm->NeedConstructAP()) |
+ pWidget->ResetAppearance(NULL, FALSE); |
Lei Zhang
2015/07/16 17:05:06
NULL -> nullptr
Tom Sepez
2015/07/16 18:01:28
Done.
|
return pWidget; |
} |