Quiet wxWidgets asserts (sheet & symbol properties dialogs)

Ensure we don't set column size smaller than 1. If so, set to
-1 to auto size.
This commit is contained in:
Roberto Fernandez Bautista 2021-11-27 21:03:42 +00:00
parent 3660597082
commit dd219419a0
2 changed files with 8 additions and 2 deletions

View File

@ -792,7 +792,10 @@ void DIALOG_SHEET_PROPERTIES::AdjustGridColumns( int aWidth )
for( int i = 2; i < m_grid->GetNumberCols(); i++ )
fixedColsWidth += m_grid->GetColSize( i );
m_grid->SetColSize( 1, aWidth - fixedColsWidth );
int colSize = std::max( aWidth - fixedColsWidth, -1 );
colSize = ( colSize == 0 ) ? -1 : colSize; // don't hide the column!
m_grid->SetColSize( 1, colSize );
}

View File

@ -997,7 +997,10 @@ void DIALOG_SYMBOL_PROPERTIES::AdjustGridColumns( int aWidth )
for( int i = 2; i < m_fieldsGrid->GetNumberCols(); i++ )
fixedColsWidth += m_fieldsGrid->GetColSize( i );
m_fieldsGrid->SetColSize( 1, fieldsWidth - fixedColsWidth );
int colSize = std::max( fieldsWidth - fixedColsWidth, -1 );
colSize = ( colSize == 0 ) ? -1 : colSize; // don't hide the column!
m_fieldsGrid->SetColSize( 1, colSize );
// Stretch the Base Name and Alternate Assignment columns to fit.
for( int i = 0; i < COL_COUNT; ++i )