Minor simplifications and code style fixes

No real changes.
This commit is contained in:
VZ
2020-12-29 17:00:08 +01:00
committed by GitHub
parent ae9a62d5a2
commit 9160181bcc
2 changed files with 4 additions and 5 deletions

View File

@@ -312,7 +312,7 @@ public:
@return an opaque pointer, NULL if is not found.
@since 2.9.4
@since 3.1.5
*/
virtual wxRibbonToolBarToolBase* GetToolByPos(wxCoord x, wxCoord y)const;

View File

@@ -432,15 +432,14 @@ wxRibbonToolBarToolBase* wxRibbonToolBar::GetToolByPos(size_t pos)const
wxRibbonToolBarToolBase* wxRibbonToolBar::GetToolByPos(wxCoord x, wxCoord y)const
{
size_t group_count = m_groups.GetCount();
size_t g, t;
for(g = 0; g < group_count; ++g)
for ( size_t g = 0; g < group_count; ++g )
{
wxRibbonToolBarToolGroup* group = m_groups.Item(g);
size_t tool_count = group->tools.GetCount();
for(t = 0; t < tool_count; ++t)
for ( size_t t = 0; t < tool_count; ++t )
{
wxRibbonToolBarToolBase* tool = group->tools.Item(t);
wxRect rect(tool->position.x, tool->position.y, tool->size.GetWidth(), tool->size.GetHeight());
wxRect rect(tool->position, tool->size);
if(rect.Contains(x, y))
{
return tool;