Loading common/base_struct.cpp +8 −5 Original line number Original line Diff line number Diff line Loading @@ -226,11 +226,14 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine ) if( m_MultilineAllowed ) if( m_MultilineAllowed ) { { list = wxStringSplit( m_Text, '\n' ); list = wxStringSplit( m_Text, '\n' ); if ( list->GetCount() ) // GetCount() == 0 for void strings { if( aLine >= 0 && (aLine < (int)list->GetCount()) ) if( aLine >= 0 && (aLine < (int)list->GetCount()) ) text = &list->Item( aLine ); text = &list->Item( aLine ); else else text = &list->Item( 0 ); text = &list->Item( 0 ); } } } // calculate the H and V size // calculate the H and V size Loading @@ -245,7 +248,7 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine ) rect.Move(wxPoint(0, -extra_dy/2 ) ); // move origin by the half extra interval rect.Move(wxPoint(0, -extra_dy/2 ) ); // move origin by the half extra interval // for multiline texts and aLine < 0, merge all rectangles // for multiline texts and aLine < 0, merge all rectangles if( m_MultilineAllowed && aLine < 0 ) if( m_MultilineAllowed && list && aLine < 0 ) { { for( unsigned ii = 1; ii < list->GetCount(); ii++ ) for( unsigned ii = 1; ii < list->GetCount(); ii++ ) { { Loading Loading
common/base_struct.cpp +8 −5 Original line number Original line Diff line number Diff line Loading @@ -226,11 +226,14 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine ) if( m_MultilineAllowed ) if( m_MultilineAllowed ) { { list = wxStringSplit( m_Text, '\n' ); list = wxStringSplit( m_Text, '\n' ); if ( list->GetCount() ) // GetCount() == 0 for void strings { if( aLine >= 0 && (aLine < (int)list->GetCount()) ) if( aLine >= 0 && (aLine < (int)list->GetCount()) ) text = &list->Item( aLine ); text = &list->Item( aLine ); else else text = &list->Item( 0 ); text = &list->Item( 0 ); } } } // calculate the H and V size // calculate the H and V size Loading @@ -245,7 +248,7 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine ) rect.Move(wxPoint(0, -extra_dy/2 ) ); // move origin by the half extra interval rect.Move(wxPoint(0, -extra_dy/2 ) ); // move origin by the half extra interval // for multiline texts and aLine < 0, merge all rectangles // for multiline texts and aLine < 0, merge all rectangles if( m_MultilineAllowed && aLine < 0 ) if( m_MultilineAllowed && list && aLine < 0 ) { { for( unsigned ii = 1; ii < list->GetCount(); ii++ ) for( unsigned ii = 1; ii < list->GetCount(); ii++ ) { { Loading