Skip to content

Commit

Permalink
Code Review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Randalphwa committed Nov 30, 2019
1 parent 12e388d commit 7b0e75e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions plugins/common/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ class AuiToolBar : public wxAuiToolBar
m_manager = manager;
}

void SetPtrData(int index, void* ptr)
void SetObject(int index, wxObject* pObject)
{
m_aObjects[index] = ptr;
m_aObjects[index] = pObject;
}
void* GetPtrData(int index)
wxObject* GetObject(int index)
{
return m_aObjects[index];
}
Expand All @@ -122,7 +122,7 @@ class AuiToolBar : public wxAuiToolBar
DECLARE_EVENT_TABLE()

private:
std::unordered_map<int, void*> m_aObjects;
std::unordered_map<int, wxObject*> m_aObjects;
};

BEGIN_EVENT_TABLE( AuiToolBar, wxAuiToolBar )
Expand Down Expand Up @@ -1275,9 +1275,9 @@ void AuiToolBar::OnDropDownMenu( wxAuiToolBarEvent& event )

if ( item && item->HasDropDown() )
{
wxObject* wxobject = (wxObject*) GetPtrData(item->GetUserData());
wxObject* wxobject = GetObject(item->GetUserData());

if ( NULL != wxobject )
if (wxobject)
{
m_manager->SelectObject( wxobject );
}
Expand Down Expand Up @@ -1315,9 +1315,9 @@ void AuiToolBar::OnTool( wxCommandEvent& event )
wxAuiToolBarItem* item = tb->FindTool(event.GetId());
if (item)
{
wxObject* wxobject = (wxObject*) GetPtrData(item->GetUserData());
wxObject* wxobject = GetObject(item->GetUserData());

if (NULL != wxobject)
if (wxobject)
{
m_manager->SelectObject(wxobject);
}
Expand Down Expand Up @@ -1374,7 +1374,7 @@ class AuiToolBarComponent : public ComponentBase
wxAuiToolBarItem* itm = tb->FindToolByIndex( i );
wxASSERT(itm);
itm->SetUserData(i);
tb->SetPtrData(i, child);
tb->SetObject(i, child);
if ( childObj->GetPropertyAsInteger(_("context_menu") ) == 1 && !itm->HasDropDown() )
tb->SetToolDropDown( itm->GetId(), true );
else if ( childObj->GetPropertyAsInteger(_("context_menu") ) == 0 && itm->HasDropDown() )
Expand Down

0 comments on commit 7b0e75e

Please sign in to comment.