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:
parent
20c00cbb21
commit
b59da3e4dc
|
@ -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.
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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() );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue