Don't allow replace on Power Symbol value fields.

Fixes: lp:1771398
* https://bugs.launchpad.net/kicad/+bug/1771398
This commit is contained in:
Jeff Young 2018-05-18 00:43:03 +01:00
parent 8cb68a3585
commit 5e30e4d475
2 changed files with 14 additions and 1 deletions

View File

@ -368,6 +368,19 @@ bool SCH_FIELD::Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint
}
bool SCH_FIELD::IsReplaceable() const
{
if( m_id != VALUE )
return true;
SCH_COMPONENT* component = dynamic_cast<SCH_COMPONENT*>( GetParent() );
LIB_PART* part = component ? component->GetPartRef().lock().get() : nullptr;
bool isPower = part ? part->IsPower() : false;
return !isPower;
}
bool SCH_FIELD::Replace( wxFindReplaceData& aSearchData, void* aAuxData )
{
bool isReplaced;

View File

@ -182,7 +182,7 @@ public:
BITMAP_DEF GetMenuImage() const override;
bool IsReplaceable() const override { return true; }
bool IsReplaceable() const override;
wxPoint GetLibPosition() const { return EDA_TEXT::GetTextPos(); }