diff --git a/eeschema/sch_eagle_plugin.cpp b/eeschema/sch_eagle_plugin.cpp index 554eb9a738..1aba9ff9e0 100644 --- a/eeschema/sch_eagle_plugin.cpp +++ b/eeschema/sch_eagle_plugin.cpp @@ -327,6 +327,7 @@ static void eagleToKicadAlignment( EDA_TEXT* aText, int aEagleAlignment, int aRe default: aText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT ); aText->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM ); + break; } } diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 0a24171ab9..880fc62a37 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -217,6 +217,8 @@ void SCH_TEXT::SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) { default: wxASSERT_MSG( 1, "Bad spin style" ); + break; + case LABEL_SPIN_STYLE::RIGHT: // Horiz Normal Orientation // m_spin_style = LABEL_SPIN_STYLE::RIGHT; // Handle the error spin style by resetting @@ -798,6 +800,8 @@ void SCH_GLOBALLABEL::SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) { default: wxASSERT_MSG( 1, "Bad spin style" ); + break; + case LABEL_SPIN_STYLE::RIGHT: // Horiz Normal Orientation // m_spin_style = LABEL_SPIN_STYLE::RIGHT; // Handle the error spin style by resetting @@ -1041,6 +1045,8 @@ void SCH_HIERLABEL::SetLabelSpinStyle( LABEL_SPIN_STYLE aSpinStyle ) { default: wxLogWarning( "SetLabelSpinStyle bad spin style" ); + break; + case LABEL_SPIN_STYLE::LEFT: // m_spin_style = LABEL_SPIN_STYLE::LEFT; // Handle the error spin style by resetting diff --git a/eeschema/sch_text.h b/eeschema/sch_text.h index b56ab1d813..060a1c4b2d 100644 --- a/eeschema/sch_text.h +++ b/eeschema/sch_text.h @@ -22,11 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file sch_text.h - * @brief Definitions of the SCH_TEXT class and derivatives for Eeschema. - */ - #ifndef CLASS_TEXT_LABEL_H #define CLASS_TEXT_LABEL_H @@ -89,22 +84,14 @@ public: LABEL_SPIN_STYLE RotateCW() { SPIN newSpin = m_spin; + switch( m_spin ) { - default: - wxLogWarning( "RotateCCW encountered unknown current spin style" ); - case LABEL_SPIN_STYLE::LEFT: - newSpin = LABEL_SPIN_STYLE::UP; - break; - case LABEL_SPIN_STYLE::UP: - newSpin = LABEL_SPIN_STYLE::RIGHT; - break; - case LABEL_SPIN_STYLE::RIGHT: - newSpin = LABEL_SPIN_STYLE::BOTTOM; - break; - case LABEL_SPIN_STYLE::BOTTOM: - newSpin = LABEL_SPIN_STYLE::LEFT; - break; + case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::UP; break; + case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::RIGHT; break; + case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::BOTTOM; break; + case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::LEFT; break; + default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break; } return LABEL_SPIN_STYLE( newSpin ); @@ -114,22 +101,14 @@ public: LABEL_SPIN_STYLE RotateCCW() { SPIN newSpin = m_spin; + switch( m_spin ) { - default: - wxLogWarning( "RotateCCW encountered unknown current spin style" ); - case LABEL_SPIN_STYLE::LEFT: - newSpin = LABEL_SPIN_STYLE::BOTTOM; - break; - case LABEL_SPIN_STYLE::BOTTOM: - newSpin = LABEL_SPIN_STYLE::RIGHT; - break; - case LABEL_SPIN_STYLE::RIGHT: - newSpin = LABEL_SPIN_STYLE::UP; - break; - case LABEL_SPIN_STYLE::UP: - newSpin = LABEL_SPIN_STYLE::LEFT; - break; + case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::BOTTOM; break; + case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::RIGHT; break; + case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::UP; break; + case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::LEFT; break; + default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break; } return LABEL_SPIN_STYLE( newSpin ); @@ -142,20 +121,14 @@ public: LABEL_SPIN_STYLE MirrorX() { SPIN newSpin = m_spin; + switch( m_spin ) { - default: - wxLogWarning( "MirrorX encountered unknown current spin style" ); - case LABEL_SPIN_STYLE::UP: - newSpin = LABEL_SPIN_STYLE::BOTTOM; - break; - case LABEL_SPIN_STYLE::BOTTOM: - newSpin = LABEL_SPIN_STYLE::UP; - break; - case LABEL_SPIN_STYLE::LEFT: - break; - case LABEL_SPIN_STYLE::RIGHT: - break; + case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::BOTTOM; break; + case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::UP; break; + case LABEL_SPIN_STYLE::LEFT: break; + case LABEL_SPIN_STYLE::RIGHT: break; + default: wxLogWarning( "MirrorX encountered unknown current spin style" ); break; } return LABEL_SPIN_STYLE( newSpin ); @@ -168,20 +141,14 @@ public: LABEL_SPIN_STYLE MirrorY() { SPIN newSpin = m_spin; + switch( m_spin ) { - default: - wxLogWarning( "MirrorY encountered unknown current spin style" ); - case LABEL_SPIN_STYLE::LEFT: - newSpin = LABEL_SPIN_STYLE::RIGHT; - break; - case LABEL_SPIN_STYLE::RIGHT: - newSpin = LABEL_SPIN_STYLE::LEFT; - break; - case LABEL_SPIN_STYLE::UP: - break; - case LABEL_SPIN_STYLE::BOTTOM: - break; + case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::RIGHT; break; + case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::LEFT; break; + case LABEL_SPIN_STYLE::UP: break; + case LABEL_SPIN_STYLE::BOTTOM: break; + default: wxLogWarning( "MirrorY encountered unknown current spin style" ); break; } return LABEL_SPIN_STYLE( newSpin ); @@ -231,8 +198,7 @@ protected: LABEL_SPIN_STYLE m_spin_style; public: - SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ), - const wxString& text = wxEmptyString, + SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString, KICAD_T aType = SCH_TEXT_T ); /**