Index: fpdfsdk/src/fsdk_annothandler.cpp |
diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp |
index ee06091bff1f3f1fbf90eebfbe8147cbd1ad5d5b..c29a76446fbae7c96141ba36e1936a441c6e169c 100644 |
--- a/fpdfsdk/src/fsdk_annothandler.cpp |
+++ b/fpdfsdk/src/fsdk_annothandler.cpp |
@@ -49,8 +49,7 @@ void CPDFSDK_AnnotHandlerMgr::UnRegisterAnnotHandler( |
CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CPDF_Annot* pAnnot, |
CPDFSDK_PageView* pPageView) { |
- ASSERT(pAnnot != NULL); |
- ASSERT(pPageView != NULL); |
+ ASSERT(pPageView); |
if (IPDFSDK_AnnotHandler* pAnnotHandler = |
GetAnnotHandler(pAnnot->GetSubType())) { |
@@ -61,7 +60,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CPDF_Annot* pAnnot, |
} |
void CPDFSDK_AnnotHandlerMgr::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
Tom Sepez
2015/12/14 19:14:11
nit: segv on next line.
Lei Zhang
2015/12/15 01:38:33
Done.
|
pAnnot->GetPDFPage(); |
@@ -74,8 +73,6 @@ void CPDFSDK_AnnotHandlerMgr::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { |
} |
void CPDFSDK_AnnotHandlerMgr::Annot_OnCreate(CPDFSDK_Annot* pAnnot) { |
- ASSERT(pAnnot != NULL); |
- |
CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); |
CPDFSDK_DateTime curTime; |
@@ -88,7 +85,7 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnCreate(CPDFSDK_Annot* pAnnot) { |
} |
void CPDFSDK_AnnotHandlerMgr::Annot_OnLoad(CPDFSDK_Annot* pAnnot) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
pAnnotHandler->OnLoad(pAnnot); |
@@ -97,12 +94,8 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnLoad(CPDFSDK_Annot* pAnnot) { |
IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( |
CPDFSDK_Annot* pAnnot) const { |
- ASSERT(pAnnot != NULL); |
- |
CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); |
- if (pPDFAnnot) |
- return GetAnnotHandler(pPDFAnnot->GetSubType()); |
- return nullptr; |
+ return pPDFAnnot ? GetAnnotHandler(pPDFAnnot->GetSubType()) : nullptr; |
} |
IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( |
@@ -131,7 +124,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown( |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlags, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
return pAnnotHandler->OnLButtonDown(pPageView, pAnnot, nFlags, point); |
@@ -142,7 +135,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlags, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
return pAnnotHandler->OnLButtonUp(pPageView, pAnnot, nFlags, point); |
@@ -154,7 +147,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk( |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlags, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
return pAnnotHandler->OnLButtonDblClk(pPageView, pAnnot, nFlags, point); |
@@ -165,7 +158,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlags, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
return pAnnotHandler->OnMouseMove(pPageView, pAnnot, nFlags, point); |
@@ -177,7 +170,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(CPDFSDK_PageView* pPageView, |
FX_DWORD nFlags, |
short zDelta, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
return pAnnotHandler->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, |
@@ -190,7 +183,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown( |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlags, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
return pAnnotHandler->OnRButtonDown(pPageView, pAnnot, nFlags, point); |
@@ -201,7 +194,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlags, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
return pAnnotHandler->OnRButtonUp(pPageView, pAnnot, nFlags, point); |
@@ -212,7 +205,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView* pPageView, |
void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlag) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
pAnnotHandler->OnMouseEnter(pPageView, pAnnot, nFlag); |
@@ -223,7 +216,7 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, |
void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseExit(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlag) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
pAnnotHandler->OnMouseExit(pPageView, pAnnot, nFlag); |
@@ -271,7 +264,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, |
FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlag) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
if (pAnnotHandler->OnSetFocus(pAnnot, nFlag)) { |
@@ -361,15 +354,13 @@ CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, |
} |
void CPDFSDK_BFAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { |
- ASSERT(pAnnot != NULL); |
+ ASSERT(pAnnot); |
if (m_pFormFiller) |
m_pFormFiller->OnDelete(pAnnot); |
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm(); |
- ASSERT(pInterForm != NULL); |
- |
CPDF_FormControl* pCtrol = pWidget->GetFormControl(); |
pInterForm->RemoveMap(pCtrol); |
@@ -396,7 +387,6 @@ void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, |
void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlag) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -408,7 +398,6 @@ void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, |
void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlag) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -421,7 +410,6 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlags, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -437,7 +425,6 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlags, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -453,7 +440,6 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlags, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -469,7 +455,6 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlags, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -486,7 +471,6 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, |
FX_DWORD nFlags, |
short zDelta, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -503,7 +487,6 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlags, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -518,7 +501,6 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlags, |
const CPDF_Point& point) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -533,7 +515,6 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, |
FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, |
FX_DWORD nChar, |
FX_DWORD nFlags) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -548,7 +529,6 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, |
FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, |
int nKeyCode, |
int nFlag) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -566,7 +546,6 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, |
return FALSE; |
} |
void CPDFSDK_BFAnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -599,7 +578,6 @@ void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) { |
FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlag) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -612,7 +590,6 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, |
} |
FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, |
FX_DWORD nFlag) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |
@@ -626,7 +603,6 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, |
CPDF_Rect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, |
CPDFSDK_Annot* pAnnot) { |
- ASSERT(pAnnot != NULL); |
CFX_ByteString sSubType = pAnnot->GetSubType(); |
if (sSubType == BFFT_SIGNATURE) { |