From d07c6699ce19a7b2bf9033248f3a0ab92b078355 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 10 Jul 2022 20:37:06 -0600 Subject: [PATCH] Bring symbol editor in line with eeschema for empty text. Fixes https://gitlab.com/kicad/code/kicad/issues/11799 --- eeschema/dialogs/dialog_lib_text_properties.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/eeschema/dialogs/dialog_lib_text_properties.cpp b/eeschema/dialogs/dialog_lib_text_properties.cpp index 4332e8775a..5cfe4cf102 100644 --- a/eeschema/dialogs/dialog_lib_text_properties.cpp +++ b/eeschema/dialogs/dialog_lib_text_properties.cpp @@ -32,7 +32,7 @@ #include #include #include - +#include "confirm.h" DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aParent, LIB_TEXT* aText ) : @@ -211,9 +211,15 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow() if( m_graphicText ) { if( m_StyledTextCtrl->GetValue().IsEmpty() ) - m_graphicText->SetText( wxT( "[null]" ) ); + { + // Other text items do not have defined extents, and so will disappear if empty + DisplayError( this, _( "Text can not be empty." ) ); + return false; + } else + { m_graphicText->SetText( m_StyledTextCtrl->GetValue() ); + } if( m_fontCtrl->HaveFontSelection() ) {