PCB_TEXT: remove "hide" option, because they are never hidden.

- avoid write "hide" option in file
- always return true when calling IsVisible()
Fixes #8806
https://gitlab.com/kicad/code/kicad/issues/8806
This commit is contained in:
jean-pierre charras 2021-07-18 14:58:21 +02:00
parent 3c721c55de
commit 56412cc843
3 changed files with 8 additions and 3 deletions

View File

@ -182,8 +182,8 @@ public:
void SetBold( bool aBold ) { m_e.Bit( TE_BOLD, aBold); } void SetBold( bool aBold ) { m_e.Bit( TE_BOLD, aBold); }
bool IsBold() const { return m_e.Bit( TE_BOLD ); } bool IsBold() const { return m_e.Bit( TE_BOLD ); }
void SetVisible( bool aVisible ) { m_e.Bit( TE_VISIBLE, aVisible ); } virtual void SetVisible( bool aVisible ) { m_e.Bit( TE_VISIBLE, aVisible ); }
bool IsVisible() const { return m_e.Bit( TE_VISIBLE ); } virtual bool IsVisible() const { return m_e.Bit( TE_VISIBLE ); }
void SetMirrored( bool isMirrored ) { m_e.Bit( TE_MIRROR, isMirrored ); } void SetMirrored( bool isMirrored ) { m_e.Bit( TE_MIRROR, isMirrored ); }
bool IsMirrored() const { return m_e.Bit( TE_MIRROR ); } bool IsMirrored() const { return m_e.Bit( TE_MIRROR ); }

View File

@ -64,6 +64,10 @@ public:
wxString GetShownText( int aDepth = 0 ) const override; wxString GetShownText( int aDepth = 0 ) const override;
/// PCB_TEXTs are always visible:
void SetVisible( bool aVisible ) override { /* do nothing */}
bool IsVisible() const override { return true; }
bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override
{ {
return BOARD_ITEM::Matches( GetShownText(), aSearchData ); return BOARD_ITEM::Matches( GetShownText(), aSearchData );

View File

@ -1711,7 +1711,8 @@ void PCB_IO::format( const PCB_TEXT* aText, int aNestLevel ) const
m_out->Print( 0, "\n" ); m_out->Print( 0, "\n" );
aText->EDA_TEXT::Format( m_out, aNestLevel, m_ctl ); // PCB_TEXTS are never hidden, so always omit "hide" attribute
aText->EDA_TEXT::Format( m_out, aNestLevel, m_ctl | CTL_OMIT_HIDE );
m_out->Print( aNestLevel, ")\n" ); m_out->Print( aNestLevel, ")\n" );
} }