summaryrefslogtreecommitdiff
path: root/xfa/fwl/core
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-27 16:59:30 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-27 16:59:30 -0700
commitbb0d446df18ee34504a165f3fc96fbb81b274f31 (patch)
tree9c2615b4c8a8d597f22e8504c23e2fdbf1df4de5 /xfa/fwl/core
parentdf96690d4e3799536b981e3673d64018fa5fd037 (diff)
downloadpdfium-bb0d446df18ee34504a165f3fc96fbb81b274f31.tar.xz
Replace CFX_PtrArray with typesafe CFX_ArrayTemplate<>, part 3
Review-Url: https://codereview.chromium.org/1924093003
Diffstat (limited to 'xfa/fwl/core')
-rw-r--r--xfa/fwl/core/fwl_noteimp.cpp15
-rw-r--r--xfa/fwl/core/fwl_noteimp.h6
2 files changed, 10 insertions, 11 deletions
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp
index 5cd643a81b..cc548a5728 100644
--- a/xfa/fwl/core/fwl_noteimp.cpp
+++ b/xfa/fwl/core/fwl_noteimp.cpp
@@ -164,8 +164,7 @@ IFWL_NoteLoop* CFWL_NoteDriver::PopNoteLoop() {
int32_t pos = m_noteLoopQueue.GetSize();
if (pos <= 0)
return NULL;
- IFWL_NoteLoop* p =
- static_cast<IFWL_NoteLoop*>(m_noteLoopQueue.GetAt(pos - 1));
+ IFWL_NoteLoop* p = m_noteLoopQueue.GetAt(pos - 1);
m_noteLoopQueue.RemoveAt(pos - 1);
return p;
}
@@ -351,7 +350,7 @@ FX_BOOL CFWL_NoteDriver::UnqueueMessage(CFWL_NoteLoop* pNoteLoop) {
if (m_noteQueue.GetSize() < 1) {
return FALSE;
}
- CFWL_Message* pMessage = static_cast<CFWL_Message*>(m_noteQueue[0]);
+ CFWL_Message* pMessage = m_noteQueue[0];
m_noteQueue.RemoveAt(0);
if (!IsValidMessage(pMessage)) {
pMessage->Release();
@@ -365,7 +364,7 @@ FX_BOOL CFWL_NoteDriver::UnqueueMessage(CFWL_NoteLoop* pNoteLoop) {
CFWL_NoteLoop* CFWL_NoteDriver::GetTopLoop() {
int32_t size = m_noteLoopQueue.GetSize();
if (size <= 0)
- return NULL;
+ return nullptr;
return static_cast<CFWL_NoteLoop*>(m_noteLoopQueue[size - 1]);
}
int32_t CFWL_NoteDriver::CountLoop() {
@@ -885,14 +884,14 @@ void CFWL_ToolTipContainer::DeleteInstance() {
}
}
FX_ERR CFWL_ToolTipContainer::AddToolTipTarget(IFWL_ToolTipTarget* pTarget) {
- if (m_arrWidget.Find((void*)pTarget) < 0) {
- m_arrWidget.Add((void*)pTarget);
+ if (m_arrWidget.Find(pTarget) < 0) {
+ m_arrWidget.Add(pTarget);
return FWL_ERR_Succeeded;
}
return FWL_ERR_Indefinite;
}
FX_ERR CFWL_ToolTipContainer::RemoveToolTipTarget(IFWL_ToolTipTarget* pTarget) {
- int index = m_arrWidget.Find((void*)pTarget);
+ int index = m_arrWidget.Find(pTarget);
if (index >= 0) {
m_arrWidget.RemoveAt(index);
return FWL_ERR_Succeeded;
@@ -902,7 +901,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 = static_cast<IFWL_ToolTipTarget*>(m_arrWidget[i]);
+ IFWL_ToolTipTarget* p = m_arrWidget[i];
if (p->GetWidget() == pWedget) {
pCurTarget = p;
return TRUE;
diff --git a/xfa/fwl/core/fwl_noteimp.h b/xfa/fwl/core/fwl_noteimp.h
index 927afd6c9d..f51f09cf00 100644
--- a/xfa/fwl/core/fwl_noteimp.h
+++ b/xfa/fwl/core/fwl_noteimp.h
@@ -97,8 +97,8 @@ class CFWL_NoteDriver : public IFWL_NoteDriver {
IFWL_Widget* GetMessageForm(IFWL_Widget* pDstTarget);
void ClearInvalidEventTargets(FX_BOOL bRemoveAll);
CFX_ArrayTemplate<CFWL_TargetImp*> m_forms;
- CFX_PtrArray m_noteQueue;
- CFX_PtrArray m_noteLoopQueue;
+ CFX_ArrayTemplate<CFWL_Message*> m_noteQueue;
+ CFX_ArrayTemplate<IFWL_NoteLoop*> m_noteLoopQueue;
CFX_MapPtrToPtr m_eventTargets;
int32_t m_sendEventCalled;
IFWL_Widget* m_pHover;
@@ -147,7 +147,7 @@ class CFWL_ToolTipContainer {
IFWL_ToolTipTarget* pCurTarget;
CFWL_ToolTipImp* m_pToolTipImp;
CFWL_CoreToolTipDP* m_ToolTipDp;
- CFX_PtrArray m_arrWidget;
+ CFX_ArrayTemplate<IFWL_ToolTipTarget*> m_arrWidget;
private:
static CFWL_ToolTipContainer* s_pInstance;