Overridden versions of GetShownText() still need to call EDA_TEXT version.

Fixes https://gitlab.com/kicad/code/kicad/issues/4151
This commit is contained in:
Jeff Young 2020-04-02 18:27:10 +01:00
parent 20c00cbb21
commit b59da3e4dc
4 changed files with 6 additions and 8 deletions

View File

@ -170,17 +170,15 @@ wxString SCH_FIELD::GetShownText() const
};
PROJECT* project = nullptr;
wxString text;
wxString text = EDA_TEXT::GetShownText();
if( g_RootSheet && g_RootSheet->GetScreen() )
project = &g_RootSheet->GetScreen()->Kiway().Prj();
if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T )
text = ExpandTextVars( GetText(), symbolResolver, project );
text = ExpandTextVars( text, symbolResolver, project );
else if( m_Parent && m_Parent->Type() == SCH_SHEET_T )
text = ExpandTextVars( GetText(), sheetResolver, project );
else
text = GetText();
text = ExpandTextVars( text, sheetResolver, project );
// WARNING: the IDs of FIELDS and SHEETS overlap, so one must check *both* the
// id and the parent's type.

View File

@ -505,7 +505,7 @@ wxString SCH_TEXT::GetShownText() const
if( g_RootSheet && g_RootSheet->GetScreen() )
project = &g_RootSheet->GetScreen()->Kiway().Prj();
return ExpandTextVars( GetText(), textResolver, project );
return ExpandTextVars( EDA_TEXT::GetShownText(), textResolver, project );
}

View File

@ -77,7 +77,7 @@ wxString TEXTE_PCB::GetShownText() const
return false;
};
return ExpandTextVars( GetText(), moduleResolver, board->GetProject() );
return ExpandTextVars( EDA_TEXT::GetShownText(), moduleResolver, board->GetProject() );
}

View File

@ -520,5 +520,5 @@ wxString TEXTE_MODULE::GetShownText() const
return false;
};
return ExpandTextVars( GetText(), moduleResolver, board->GetProject() );
return ExpandTextVars( EDA_TEXT::GetShownText(), moduleResolver, board->GetProject() );
}