From ccb416eead458bb2fd64e56597d3f20c89d8c7f8 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 11 Jul 2022 03:37:06 +0100 Subject: [PATCH] Bring symbol editor in line with eeschema for empty text. Fixes https://gitlab.com/kicad/code/kicad/issues/11799 (cherry picked from commit d07c6699ce19a7b2bf9033248f3a0ab92b078355) --- 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 039c551a05..e9ee94b1c0 100644 --- a/eeschema/dialogs/dialog_lib_text_properties.cpp +++ b/eeschema/dialogs/dialog_lib_text_properties.cpp @@ -28,7 +28,7 @@ #include #include #include - +#include "confirm.h" DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aParent, LIB_TEXT* aText ) : @@ -116,9 +116,15 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow() if( m_graphicText ) { if( m_TextCtrl->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_TextCtrl->GetValue() ); + } m_graphicText->SetPosition( wxPoint( m_posX.GetValue(), m_posY.GetValue() ) );