Browse Source

Fix deficient c'tors and operator=.

(cherry picked from commit 60ec152d90)
9.0
Jeff Young 3 months ago
parent
commit
e9a331f2df
  1. 3
      eeschema/dialogs/dialog_label_properties.cpp
  2. 12
      eeschema/sch_label.cpp
  3. 4
      eeschema/sch_label.h

3
eeschema/dialogs/dialog_label_properties.cpp

@ -657,8 +657,9 @@ bool DIALOG_LABEL_PROPERTIES::TransferDataFromWindow()
m_currentLabel->AutoplaceFields( m_Parent->GetScreen(), fieldsAutoplaced );
if( !commit.Empty() )
{
commit.Push( _( "Edit Label Properties" ) );
}
else if( m_activeTextEntry && m_labelList )
{
text = m_activeTextEntry->GetValue();

12
eeschema/sch_label.cpp

@ -163,6 +163,7 @@ SCH_LABEL_BASE::SCH_LABEL_BASE( const VECTOR2I& aPos, const wxString& aText, KIC
m_shape( L_UNSPECIFIED ),
m_connectionType( CONNECTION_TYPE::NONE ),
m_isDangling( true ),
m_autoRotateOnPlacement( false ),
m_lastResolvedColor( COLOR4D::UNSPECIFIED )
{
SetMultilineAllowed( false );
@ -177,6 +178,7 @@ SCH_LABEL_BASE::SCH_LABEL_BASE( const SCH_LABEL_BASE& aLabel ) :
m_shape( aLabel.m_shape ),
m_connectionType( aLabel.m_connectionType ),
m_isDangling( aLabel.m_isDangling ),
m_autoRotateOnPlacement( aLabel.m_autoRotateOnPlacement ),
m_lastResolvedColor( aLabel.m_lastResolvedColor ),
m_cached_driver_name( aLabel.m_cached_driver_name )
{
@ -193,6 +195,16 @@ SCH_LABEL_BASE& SCH_LABEL_BASE::operator=( const SCH_LABEL_BASE& aLabel )
{
SCH_TEXT::operator=( aLabel );
m_fields = aLabel.m_fields;
for( SCH_FIELD& field : m_fields )
field.SetParent( this );
m_shape = aLabel.m_shape;
m_connectionType = aLabel.m_connectionType;
m_isDangling = aLabel.m_isDangling;
m_autoRotateOnPlacement = aLabel.m_autoRotateOnPlacement;
m_lastResolvedColor = aLabel.m_lastResolvedColor;
m_cached_driver_name = aLabel.m_cached_driver_name;
return *this;

4
eeschema/sch_label.h

@ -382,7 +382,7 @@ protected:
CONNECTION_TYPE m_connectionType;
bool m_isDangling;
bool m_autoRotateOnPlacement = false;
bool m_autoRotateOnPlacement;
mutable COLOR4D m_lastResolvedColor;
@ -588,7 +588,7 @@ public:
// Do not create a copy constructor. The one generated by the compiler is adequate.
~SCH_HIERLABEL() { }
~SCH_HIERLABEL() override = default;
void Serialize( google::protobuf::Any &aContainer ) const override;
bool Deserialize( const google::protobuf::Any &aContainer ) override;

Loading…
Cancel
Save