Chromium Code Reviews| Index: xfa/src/fwl/src/core/fwl_noteimp.cpp |
| diff --git a/xfa/src/fwl/src/core/fwl_noteimp.cpp b/xfa/src/fwl/src/core/fwl_noteimp.cpp |
| index 149b80f26ca1f2b4438a0ceeafd1b656b6f53ee6..f1d099564632ae362c299d8e18a77f26a37f0068 100644 |
| --- a/xfa/src/fwl/src/core/fwl_noteimp.cpp |
| +++ b/xfa/src/fwl/src/core/fwl_noteimp.cpp |
| @@ -47,7 +47,7 @@ FX_BOOL CFWL_NoteLoop::ContinueModal() { |
| FWL_ERR CFWL_NoteLoop::EndModalLoop() { |
| m_bContinueModal = FALSE; |
| #if (_FX_OS_ == _FX_MACOSX_) |
| - CFWL_WidgetMgr* pWidgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr(); |
| + CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
| IFWL_AdapterWidgetMgr* adapterWidgetMgr = pWidgetMgr->GetAdapterWidgetMgr(); |
| adapterWidgetMgr->EndLoop(); |
| #endif |
| @@ -57,11 +57,12 @@ FX_BOOL CFWL_NoteLoop::TranslateAccelerator(CFWL_Message* pMessage) { |
| if (pMessage->GetClassID() != FWL_MSGHASH_Key) { |
| return FALSE; |
| } |
| - if (((CFWL_MsgKey*)pMessage)->m_dwCmd != FWL_MSGKEYCMD_KeyDown) { |
| + CFWL_MsgKey* pMsgKey = static_cast<CFWL_MsgKey*>(pMessage); |
| + if (pMsgKey->m_dwCmd != FWL_MSGKEYCMD_KeyDown) { |
| return FALSE; |
| } |
| - CFWL_MsgKey* pMsgKey = (CFWL_MsgKey*)pMessage; |
| - CFX_MapAccelerators& accel = ((CFWL_FormImp*)m_pForm)->GetAccelerator(); |
| + CFX_MapAccelerators& accel = |
| + static_cast<CFWL_FormImp*>(m_pForm)->GetAccelerator(); |
| FX_POSITION pos = accel.GetStartPosition(); |
| if (!pos) { |
| return FALSE; |
| @@ -102,13 +103,10 @@ CFWL_NoteDriver::CFWL_NoteDriver() |
| m_pGrab(nullptr), |
| m_hook(nullptr) { |
| m_pNoteLoop = new CFWL_NoteLoop; |
| - PushNoteLoop((IFWL_NoteLoop*)m_pNoteLoop); |
| + PushNoteLoop(m_pNoteLoop); |
| } |
| CFWL_NoteDriver::~CFWL_NoteDriver() { |
| - if (m_pNoteLoop) { |
| - delete m_pNoteLoop; |
| - m_pNoteLoop = NULL; |
| - } |
| + delete m_pNoteLoop; |
| ClearInvalidEventTargets(TRUE); |
| } |
| FX_BOOL CFWL_NoteDriver::SendNote(CFWL_Note* pNote) { |
| @@ -117,8 +115,8 @@ FX_BOOL CFWL_NoteDriver::SendNote(CFWL_Note* pNote) { |
| if (iCount < 1) { |
| return TRUE; |
| } |
| - if (FWL_EVTHASH_Mouse == ((CFWL_Event*)pNote)->GetClassID()) { |
| - CFWL_EvtMouse* pMouse = (CFWL_EvtMouse*)pNote; |
| + if (FWL_EVTHASH_Mouse == static_cast<CFWL_Event*>(pNote)->GetClassID()) { |
| + CFWL_EvtMouse* pMouse = static_cast<CFWL_EvtMouse*>(pNote); |
| if (FWL_MSGMOUSECMD_MouseHover == pMouse->m_dwCmd) { |
| if (m_pNoteLoop->GetForm() && |
| CFWL_ToolTipContainer::getInstance()->ProcessEnter( |
| @@ -140,7 +138,7 @@ FX_BOOL CFWL_NoteDriver::SendNote(CFWL_Note* pNote) { |
| CFWL_EventTarget* pEventTarget; |
| m_eventTargets.GetNextAssoc(pos, key, (void*&)pEventTarget); |
| if (pEventTarget && !pEventTarget->IsInvalid()) { |
| - pEventTarget->ProcessEvent((CFWL_Event*)pNote); |
| + pEventTarget->ProcessEvent(static_cast<CFWL_Event*>(pNote)); |
| } |
| } |
| m_sendEventCalled--; |
| @@ -149,7 +147,7 @@ FX_BOOL CFWL_NoteDriver::SendNote(CFWL_Note* pNote) { |
| return FALSE; |
| IFWL_WidgetDelegate* pDelegate = pNote->m_pDstTarget->SetDelegate(NULL); |
| if (pDelegate) { |
| - pDelegate->OnProcessMessage((CFWL_Message*)pNote); |
| + pDelegate->OnProcessMessage(static_cast<CFWL_Message*>(pNote)); |
| } |
| } |
| return TRUE; |
| @@ -213,7 +211,8 @@ IFWL_NoteLoop* CFWL_NoteDriver::PopNoteLoop() { |
| int32_t pos = m_noteLoopQueue.GetSize(); |
| if (pos <= 0) |
| return NULL; |
| - IFWL_NoteLoop* p = (IFWL_NoteLoop*)m_noteLoopQueue.GetAt(pos - 1); |
| + IFWL_NoteLoop* p = |
| + static_cast<IFWL_NoteLoop*>(m_noteLoopQueue.GetAt(pos - 1)); |
| m_noteLoopQueue.RemoveAt(pos - 1); |
| return p; |
| } |
| @@ -258,7 +257,7 @@ FX_BOOL CFWL_NoteDriver::SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify) { |
| return TRUE; |
| } |
| FWL_ERR CFWL_NoteDriver::Run() { |
| - CFWL_WidgetMgr* pWidgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr(); |
| + CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
| if (!pWidgetMgr) |
| return FWL_ERR_Indefinite; |
| #if (_FX_OS_ == _FX_MACOSX_) |
| @@ -351,7 +350,7 @@ void CFWL_NoteDriver::NotifyTargetDestroy(IFWL_Widget* pNoteTarget) { |
| UnregisterEventTarget(pNoteTarget); |
| int32_t count = m_forms.GetSize(); |
| for (int32_t nIndex = 0; nIndex < count; nIndex++) { |
| - CFWL_FormImp* pForm = (CFWL_FormImp*)m_forms[nIndex]; |
| + CFWL_FormImp* pForm = static_cast<CFWL_FormImp*>(m_forms[nIndex]); |
| if (!pForm) { |
| continue; |
| } |
| @@ -375,7 +374,8 @@ FWL_ERR CFWL_NoteDriver::RegisterForm(CFWL_WidgetImp* pForm) { |
| } |
| m_forms.Add(pForm); |
| if (m_forms.GetSize() == 1) { |
| - CFWL_NoteLoop* pLoop = (CFWL_NoteLoop*)m_noteLoopQueue.GetAt(0); |
| + CFWL_NoteLoop* pLoop = |
| + static_cast<CFWL_NoteLoop*>(m_noteLoopQueue.GetAt(0)); |
| if (!pLoop) |
| return FWL_ERR_Indefinite; |
| pLoop->SetMainForm(pForm); |
| @@ -401,7 +401,7 @@ FX_BOOL CFWL_NoteDriver::UnqueueMessage(CFWL_NoteLoop* pNoteLoop) { |
| if (m_noteQueue.GetSize() < 1) { |
| return FALSE; |
| } |
| - CFWL_Message* pMessage = (CFWL_Message*)m_noteQueue[0]; |
| + CFWL_Message* pMessage = static_cast<CFWL_Message*>(m_noteQueue[0]); |
| m_noteQueue.RemoveAt(0); |
| if (!IsValidMessage(pMessage)) { |
| pMessage->Release(); |
| @@ -421,7 +421,7 @@ CFWL_NoteLoop* CFWL_NoteDriver::GetTopLoop() { |
| int32_t size = m_noteLoopQueue.GetSize(); |
| if (size <= 0) |
| return NULL; |
| - return (CFWL_NoteLoop*)m_noteLoopQueue[size - 1]; |
| + return static_cast<CFWL_NoteLoop*>(m_noteLoopQueue[size - 1]); |
| } |
| int32_t CFWL_NoteDriver::CountLoop() { |
| return m_noteLoopQueue.GetSize(); |
| @@ -431,7 +431,7 @@ void CFWL_NoteDriver::SetHook(FWLMessageHookCallback callback, void* info) { |
| m_hookInfo = info; |
| } |
| FX_BOOL CFWL_NoteDriver::ProcessMessage(CFWL_Message* pMessage) { |
| - CFWL_WidgetMgr* pWidgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr(); |
| + CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
| IFWL_Widget* pMessageForm = pWidgetMgr->IsFormDisabled() |
| ? pMessage->m_pDstTarget |
| : GetMessageForm(pMessage->m_pDstTarget); |
| @@ -439,7 +439,7 @@ FX_BOOL CFWL_NoteDriver::ProcessMessage(CFWL_Message* pMessage) { |
| return FALSE; |
| if (DispatchMessage(pMessage, pMessageForm)) { |
| if (pMessage->GetClassID() == FWL_MSGHASH_Mouse) { |
| - MouseSecondary((CFWL_MsgMouse*)pMessage); |
| + MouseSecondary(static_cast<CFWL_MsgMouse*>(pMessage)); |
| } |
| return TRUE; |
| } |
| @@ -450,35 +450,37 @@ FX_BOOL CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage, |
| FX_BOOL bRet = FALSE; |
| switch (pMessage->GetClassID()) { |
| case FWL_MSGHASH_Activate: { |
| - bRet = DoActivate((CFWL_MsgActivate*)pMessage, pMessageForm); |
| + bRet = DoActivate(static_cast<CFWL_MsgActivate*>(pMessage), pMessageForm); |
| break; |
| } |
| case FWL_MSGHASH_Deactivate: { |
| - bRet = DoDeactivate((CFWL_MsgDeactivate*)pMessage, pMessageForm); |
| + bRet = DoDeactivate(static_cast<CFWL_MsgDeactivate*>(pMessage), |
| + pMessageForm); |
| break; |
| } |
| case FWL_MSGHASH_SetFocus: { |
| - bRet = DoSetFocus((CFWL_MsgSetFocus*)pMessage, pMessageForm); |
| + bRet = DoSetFocus(static_cast<CFWL_MsgSetFocus*>(pMessage), pMessageForm); |
| break; |
| } |
| case FWL_MSGHASH_KillFocus: { |
| - bRet = DoKillFocus((CFWL_MsgKillFocus*)pMessage, pMessageForm); |
| + bRet = |
| + DoKillFocus(static_cast<CFWL_MsgKillFocus*>(pMessage), pMessageForm); |
| break; |
| } |
| case FWL_MSGHASH_Key: { |
| - bRet = DoKey((CFWL_MsgKey*)pMessage, pMessageForm); |
| + bRet = DoKey(static_cast<CFWL_MsgKey*>(pMessage), pMessageForm); |
| break; |
| } |
| case FWL_MSGHASH_Mouse: { |
| - bRet = DoMouse((CFWL_MsgMouse*)pMessage, pMessageForm); |
| + bRet = DoMouse(static_cast<CFWL_MsgMouse*>(pMessage), pMessageForm); |
| break; |
| } |
| case FWL_MSGHASH_MouseWheel: { |
| - bRet = DoWheel((CFWL_MsgMouseWheel*)pMessage, pMessageForm); |
| + bRet = DoWheel(static_cast<CFWL_MsgMouseWheel*>(pMessage), pMessageForm); |
| break; |
| } |
| case FWL_MSGHASH_Size: { |
| - bRet = DoSize((CFWL_MsgSize*)pMessage); |
| + bRet = DoSize(static_cast<CFWL_MsgSize*>(pMessage)); |
| break; |
| } |
| case FWL_MSGHASH_Cursor: { |
| @@ -486,21 +488,17 @@ FX_BOOL CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage, |
| break; |
| } |
| case FWL_MSGHASH_WindowMove: { |
| - bRet = DoWindowMove((CFWL_MsgWindowMove*)pMessage, pMessageForm); |
| + bRet = DoWindowMove(static_cast<CFWL_MsgWindowMove*>(pMessage), |
| + pMessageForm); |
| break; |
| } |
| case FWL_MSGHASH_DropFiles: { |
| - bRet = DoDragFiles((CFWL_MsgDropFiles*)pMessage, pMessageForm); |
| - break; |
| - } |
| - case FWL_MSGHASH_TaskClicked: { |
| - bRet = TRUE; |
| - break; |
| - } |
| - case FWL_MSGHASH_Close: { |
| - bRet = TRUE; |
| + bRet = |
| + DoDragFiles(static_cast<CFWL_MsgDropFiles*>(pMessage), pMessageForm); |
| break; |
| } |
| + case FWL_MSGHASH_TaskClicked: |
|
Lei Zhang
2015/12/09 04:22:11
Why bother writing out these cases?
|
| + case FWL_MSGHASH_Close: |
| default: { |
| bRet = TRUE; |
| break; |
| @@ -557,9 +555,9 @@ FX_BOOL CFWL_NoteDriver::DoDeactivate(CFWL_MsgDeactivate* pMsg, |
| } |
| FX_BOOL CFWL_NoteDriver::DoSetFocus(CFWL_MsgSetFocus* pMsg, |
| IFWL_Widget* pMessageForm) { |
| - CFWL_WidgetMgr* pWidgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr(); |
| + CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
| if (pWidgetMgr->IsFormDisabled()) { |
| - m_pFocus = (IFWL_Widget*)pMsg->m_pDstTarget; |
| + m_pFocus = pMsg->m_pDstTarget; |
| return TRUE; |
| } else { |
| IFWL_Widget* pWidget = pMsg->m_pDstTarget; |
| @@ -580,24 +578,23 @@ FX_BOOL CFWL_NoteDriver::DoSetFocus(CFWL_MsgSetFocus* pMsg, |
| } |
| FX_BOOL CFWL_NoteDriver::DoKillFocus(CFWL_MsgKillFocus* pMsg, |
| IFWL_Widget* pMessageForm) { |
| - CFWL_WidgetMgr* pWidgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr(); |
| + CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
| if (pWidgetMgr->IsFormDisabled()) { |
| if (m_pFocus == pMsg->m_pDstTarget) { |
| m_pFocus = NULL; |
| } |
| return TRUE; |
| - } else { |
| - IFWL_Widget* pWidget = pMsg->m_pDstTarget; |
| - CFWL_FormImp* pForm = |
| - pWidget ? static_cast<CFWL_FormImp*>(pWidget->GetImpl()) : nullptr; |
| - if (pForm) { |
| - CFWL_WidgetImp* pSubFocus = pForm->GetSubFocus(); |
| - if (pSubFocus && (pSubFocus->GetStates() & FWL_WGTSTATE_Focused)) { |
| - pMsg->m_pDstTarget = pSubFocus->GetInterface(); |
| - if (m_pFocus == pMsg->m_pDstTarget) { |
| - m_pFocus = NULL; |
| - return TRUE; |
| - } |
| + } |
| + IFWL_Widget* pWidget = pMsg->m_pDstTarget; |
| + CFWL_FormImp* pForm = |
| + pWidget ? static_cast<CFWL_FormImp*>(pWidget->GetImpl()) : nullptr; |
| + if (pForm) { |
| + CFWL_WidgetImp* pSubFocus = pForm->GetSubFocus(); |
| + if (pSubFocus && (pSubFocus->GetStates() & FWL_WGTSTATE_Focused)) { |
| + pMsg->m_pDstTarget = pSubFocus->GetInterface(); |
| + if (m_pFocus == pMsg->m_pDstTarget) { |
| + m_pFocus = NULL; |
| + return TRUE; |
| } |
| } |
| } |
| @@ -607,7 +604,8 @@ FX_BOOL CFWL_NoteDriver::DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm) { |
| #if (_FX_OS_ != _FX_MACOSX_) |
| if (pMsg->m_dwCmd == FWL_MSGKEYCMD_KeyDown && |
| pMsg->m_dwKeyCode == FWL_VKEY_Tab) { |
| - CFWL_WidgetMgr* pWidgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr(); |
| + CFWL_WidgetMgr* pWidgetMgr = |
| + static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
| IFWL_Widget* pForm = GetMessageForm(pMsg->m_pDstTarget); |
| IFWL_Widget* pFocus = m_pFocus; |
| if (m_pFocus) { |
| @@ -634,7 +632,8 @@ FX_BOOL CFWL_NoteDriver::DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm) { |
| if (!m_pFocus) { |
| if (pMsg->m_dwCmd == FWL_MSGKEYCMD_KeyDown && |
| pMsg->m_dwKeyCode == FWL_VKEY_Return) { |
| - CFWL_WidgetMgr* pWidgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr(); |
| + CFWL_WidgetMgr* pWidgetMgr = |
| + static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
| IFWL_Widget* defButton = pWidgetMgr->GetDefaultButton(pMessageForm); |
| if (defButton) { |
| pMsg->m_pDstTarget = defButton; |
| @@ -663,14 +662,13 @@ FX_BOOL CFWL_NoteDriver::DoMouse(CFWL_MsgMouse* pMsg, |
| } |
| FX_BOOL CFWL_NoteDriver::DoWheel(CFWL_MsgMouseWheel* pMsg, |
| IFWL_Widget* pMessageForm) { |
| - CFWL_WidgetMgr* pWidgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr(); |
| + CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
| if (!pWidgetMgr) |
| return FALSE; |
| IFWL_Widget* pDst = |
| pWidgetMgr->GetWidgetAtPoint(pMessageForm, pMsg->m_fx, pMsg->m_fy); |
| - if (!pDst) { |
| + if (pDst) |
|
Lei Zhang
2015/12/09 04:22:11
You are missing the '!' ??
|
| return FALSE; |
| - } |
| while (pDst && pDst->GetClassID() == FWL_CLASSHASH_Grid) { |
| pDst = pDst->GetParent(); |
| } |
| @@ -679,7 +677,7 @@ FX_BOOL CFWL_NoteDriver::DoWheel(CFWL_MsgMouseWheel* pMsg, |
| return TRUE; |
| } |
| FX_BOOL CFWL_NoteDriver::DoSize(CFWL_MsgSize* pMsg) { |
| - CFWL_WidgetMgr* pWidgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr(); |
| + CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
| if (!pWidgetMgr) |
| return FALSE; |
| pWidgetMgr->NotifySizeChanged(pMsg->m_pDstTarget, (FX_FLOAT)pMsg->m_iWidth, |
| @@ -700,9 +698,8 @@ FX_BOOL CFWL_NoteDriver::DoMouseEx(CFWL_MsgMouse* pMsg, |
| if (!pWidgetMgr) |
| return FALSE; |
| IFWL_Widget* pTarget = NULL; |
| - if (m_pGrab) { |
| - { pTarget = m_pGrab; } |
| - } |
| + if (m_pGrab) |
| + pTarget = m_pGrab; |
| if (!pTarget) { |
| pTarget = |
| pWidgetMgr->GetWidgetAtPoint(pMessageForm, pMsg->m_fx, pMsg->m_fy); |
| @@ -715,9 +712,8 @@ FX_BOOL CFWL_NoteDriver::DoMouseEx(CFWL_MsgMouse* pMsg, |
| pMessageForm->TransformTo(pTarget, pMsg->m_fx, pMsg->m_fy); |
| } |
| } |
| - if (!pTarget) { |
| + if (!pTarget) |
| return FALSE; |
| - } |
| pMsg->m_pDstTarget = pTarget; |
| return TRUE; |
| } |
| @@ -755,7 +751,7 @@ FX_BOOL CFWL_NoteDriver::IsValidMessage(CFWL_Message* pMessage) { |
| } |
| int32_t iCount = m_noteLoopQueue.GetSize(); |
| for (int32_t i = 0; i < iCount; i++) { |
| - CFWL_NoteLoop* pNoteLoop = (CFWL_NoteLoop*)m_noteLoopQueue[i]; |
| + CFWL_NoteLoop* pNoteLoop = static_cast<CFWL_NoteLoop*>(m_noteLoopQueue[i]); |
| CFWL_WidgetImp* pForm = pNoteLoop->GetForm(); |
| if (pForm && (pForm->GetInterface() == pMessage->m_pDstTarget)) { |
| return TRUE; |
| @@ -763,7 +759,7 @@ FX_BOOL CFWL_NoteDriver::IsValidMessage(CFWL_Message* pMessage) { |
| } |
| iCount = m_forms.GetSize(); |
| for (int32_t j = 0; j < iCount; j++) { |
| - CFWL_FormImp* pForm = (CFWL_FormImp*)m_forms[j]; |
| + CFWL_FormImp* pForm = static_cast<CFWL_FormImp*>(m_forms[j]); |
| if (pForm->GetInterface() == pMessage->m_pDstTarget) { |
| return TRUE; |
| } |
| @@ -776,13 +772,15 @@ IFWL_Widget* CFWL_NoteDriver::GetMessageForm(IFWL_Widget* pDstTarget) { |
| return NULL; |
| IFWL_Widget* pMessageForm = NULL; |
| if (iTrackLoop > 1) { |
| - CFWL_NoteLoop* pNootLoop = (CFWL_NoteLoop*)m_noteLoopQueue[iTrackLoop - 1]; |
| + CFWL_NoteLoop* pNootLoop = |
| + static_cast<CFWL_NoteLoop*>(m_noteLoopQueue[iTrackLoop - 1]); |
| pMessageForm = pNootLoop->GetForm()->GetInterface(); |
| } else { |
| pMessageForm = (m_forms.Find(pDstTarget) < 0) ? NULL : pDstTarget; |
| } |
| if (!pMessageForm && pDstTarget) { |
| - CFWL_WidgetMgr* pWidgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr(); |
| + CFWL_WidgetMgr* pWidgetMgr = |
| + static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
| if (!pWidgetMgr) |
| return NULL; |
| pMessageForm = |
| @@ -935,7 +933,8 @@ CFWL_ToolTipContainer::CFWL_ToolTipContainer() |
| } |
| CFWL_ToolTipContainer::~CFWL_ToolTipContainer() { |
| if (m_pToolTipImp) { |
| - IFWL_ToolTip* pToolTip = (IFWL_ToolTip*)m_pToolTipImp->GetInterface(); |
| + IFWL_ToolTip* pToolTip = |
| + static_cast<IFWL_ToolTip*>(m_pToolTipImp->GetInterface()); |
| pToolTip->Finalize(); |
| pToolTip->Release(); |
| m_pToolTipImp = NULL; |
| @@ -977,7 +976,7 @@ FX_ERR CFWL_ToolTipContainer::RemoveToolTipTarget(IFWL_ToolTipTarget* pTarget) { |
| FX_BOOL CFWL_ToolTipContainer::HasToolTip(IFWL_Widget* pWedget) { |
| int32_t iCount = m_arrWidget.GetSize(); |
| for (int32_t i = 0; i < iCount; i++) { |
| - IFWL_ToolTipTarget* p = (IFWL_ToolTipTarget*)m_arrWidget[i]; |
| + IFWL_ToolTipTarget* p = static_cast<IFWL_ToolTipTarget*>(m_arrWidget[i]); |
| if (p->GetWidget() == pWedget) { |
| pCurTarget = p; |
| return TRUE; |
| @@ -1080,7 +1079,8 @@ FWL_ERR FWL_SetToolTipAutoPopDelay(int32_t nDelayTime) { |
| IFWL_Widget* FWL_GetCurrentThreadModalWidget(IFWL_NoteThread* pNoteThread) { |
| if (!pNoteThread) |
| return NULL; |
| - CFWL_NoteDriver* noteDriver = (CFWL_NoteDriver*)pNoteThread->GetNoteDriver(); |
| + CFWL_NoteDriver* noteDriver = |
| + static_cast<CFWL_NoteDriver*>(pNoteThread->GetNoteDriver()); |
| if (!noteDriver) |
| return NULL; |
| if (noteDriver->CountLoop() == 1) { |
| @@ -1097,7 +1097,7 @@ IFWL_Widget* FWL_GetCurrentThreadModalWidget(IFWL_NoteThread* pNoteThread) { |
| FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, |
| FWLMessageHookCallback callback, |
| void* info) { |
| - CFWL_NoteDriver* noteDriver = (CFWL_NoteDriver*)driver; |
| + CFWL_NoteDriver* noteDriver = static_cast<CFWL_NoteDriver*>(driver); |
| noteDriver->SetHook(callback, info); |
| return FWL_ERR_Succeeded; |
| } |