More cleanup from non-reference return from GetText().

This commit is contained in:
Jeff Young 2019-04-03 19:35:25 +01:00
parent d90d0780ae
commit d8cc2f8280
6 changed files with 17 additions and 13 deletions

View File

@ -168,8 +168,8 @@ void SCH_EDIT_FRAME::OnConvertTextType( wxCommandEvent& aEvent )
return;
SCH_TEXT* newtext = nullptr;
const wxPoint &position = text->GetPosition();
const wxString &txt = text->GetText();
const wxPoint& position = text->GetPosition();
const wxString txt = text->GetText();
switch( type )
{

View File

@ -332,19 +332,23 @@ int TestMultiunitFootprints( SCH_SHEET_LIST& aSheetList )
SCH_REFERENCE& ref = refList.GetItem( i );
SCH_COMPONENT* unit = ref.GetComp();
SCH_SHEET_PATH sheetPath = refList.GetItem( i ).GetSheetPath();
const wxString& curFp = unit->GetField( FOOTPRINT )->GetText();
const wxString curFp = unit->GetField( FOOTPRINT )->GetText();
if( !curFp.IsEmpty() && fp != curFp )
{
wxString curUnitName = unit->GetRef( &sheetPath )
+ LIB_PART::SubReference( unit->GetUnit(), false );
wxString msg = wxString::Format( _( "Unit %s has '%s' assigned, "
"whereas unit %s has '%s' assigned" ),
unitName,
fp,
curUnitName,
curFp );
wxPoint pos = unit->GetPosition();
SCH_MARKER* marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetData( ERCE_DIFFERENT_UNIT_FP, unit->GetPosition(),
wxString::Format( _( "Unit %s has '%s' assigned, "
"whereas unit %s has '%s' assigned" ), unitName, fp, curUnitName, curFp ),
unit->GetPosition() );
marker->SetData( ERCE_DIFFERENT_UNIT_FP, pos, msg, pos );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_WARNING );
ref.GetSheetPath().LastScreen()->Append( marker );

View File

@ -185,7 +185,7 @@ wxString NETLIST_EXPORTER_PSPICE::GetSpiceFieldDefVal( SPICE_FIELD aField,
{
case SF_PRIMITIVE:
{
const wxString& refName = aComponent->GetField( REFERENCE )->GetText();
const wxString refName = aComponent->GetField( REFERENCE )->GetText();
return refName.GetChar( 0 );
break;
}
@ -344,7 +344,7 @@ bool NETLIST_EXPORTER_PSPICE::ProcessNetlist( unsigned aCtl )
if( fieldSeq )
{
// Get the string containing the sequence of nodes:
const wxString& nodeSeqIndexLineStr = fieldSeq->GetText();
const wxString nodeSeqIndexLineStr = fieldSeq->GetText();
// Verify field exists and is not empty:
if( !nodeSeqIndexLineStr.IsEmpty() )

View File

@ -630,7 +630,7 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
// Instantiate the missing component unit
int unit = unitEntry.first;
const wxString& reference = origCmp->GetField( REFERENCE )->GetText();
const wxString reference = origCmp->GetField( REFERENCE )->GetText();
std::unique_ptr<SCH_COMPONENT> component( new SCH_COMPONENT( *origCmp ) );
component->SetUnitSelection( &sheetpath, unit );
component->SetUnit( unit );
@ -2559,7 +2559,7 @@ void SCH_EAGLE_PLUGIN::addImplicitConnections( SCH_COMPONENT* aComponent,
return;
int unit = aComponent->GetUnit();
const wxString& reference = aComponent->GetField( REFERENCE )->GetText();
const wxString reference = aComponent->GetField( REFERENCE )->GetText();
std::vector<LIB_PIN*> pins;
partRef->GetPins( pins );
std::set<int> missingUnits;

View File

@ -363,7 +363,7 @@ void SIM_PLOT_FRAME::AddTuner( SCH_COMPONENT* aComponent )
if( primitiveType != SP_RESISTOR && primitiveType != SP_CAPACITOR && primitiveType != SP_INDUCTOR )
return;
const wxString& componentName = aComponent->GetField( REFERENCE )->GetText();
const wxString componentName = aComponent->GetField( REFERENCE )->GetText();
// Do not add multiple instances for the same component
auto tunerIt = std::find_if( m_tuners.begin(), m_tuners.end(), [&]( const TUNER_SLIDER* t )

View File

@ -370,7 +370,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow()
{
if( boardItem->Type() == PCB_MODULE_TEXT_T )
{
const wxString& text = dynamic_cast<EDA_TEXT*>( boardItem )->GetText();
const wxString text = dynamic_cast<EDA_TEXT*>( boardItem )->GetText();
if( m_references->GetValue() && text == wxT( "%R" ) )
visitItem( commit, boardItem );