Attempt to fix hierarchy tree selection issue.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16670
This commit is contained in:
Jeff Young 2024-01-20 19:25:03 +00:00
parent 13935399a5
commit 5c4313587b
1 changed files with 8 additions and 1 deletions

View File

@ -247,8 +247,15 @@ void HIERARCHY_PANE::UpdateHierarchyTree()
void HIERARCHY_PANE::onSelectSheetPath( wxTreeEvent& aEvent )
{
wxTreeItemId itemSel = m_tree->GetSelection();
if( !itemSel.IsOk() )
return;
TREE_ITEM_DATA* itemData = static_cast<TREE_ITEM_DATA*>( m_tree->GetItemData( itemSel ) );
if( !itemData )
return;
SetCursor( wxCURSOR_ARROWWAIT );
m_frame->GetToolManager()->RunAction<SCH_SHEET_PATH*>( EE_ACTIONS::changeSheet,
&itemData->m_SheetPath );
@ -258,7 +265,7 @@ void HIERARCHY_PANE::onSelectSheetPath( wxTreeEvent& aEvent )
void HIERARCHY_PANE::onRightClick( wxTreeEvent& aEvent )
{
wxTreeItemId itemSel = m_tree->GetFocusedItem();
wxTreeItemId itemSel = m_tree->GetSelection();
if( !itemSel.IsOk() )
return;