From d526362d31a7943bab18d84a1b250ac08997bcc8 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 28 May 2023 20:46:39 +0100 Subject: [PATCH] No sheet path has to be interpreted as the current sheet. There's currently waaaay too much stuff that depends on it. Fixes https://gitlab.com/kicad/code/kicad/-/issues/14834 --- eeschema/sch_field.cpp | 10 ++++++++++ eeschema/sch_field.h | 7 ++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 201c7cbc9a..70e6709e7a 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -243,6 +243,16 @@ wxString SCH_FIELD::GetShownText( const SCH_SHEET_PATH* aPath, bool aAllowExtraT } +wxString SCH_FIELD::GetShownText( bool aAllowExtraText, int aDepth ) const +{ + if( SCHEMATIC* schematic = Schematic() ) + return GetShownText( &schematic->CurrentSheet(), aAllowExtraText, aDepth ); + else + return EDA_TEXT::GetShownText( aAllowExtraText, aDepth ); +} + + + int SCH_FIELD::GetPenWidth() const { return GetEffectiveTextPenWidth(); diff --git a/eeschema/sch_field.h b/eeschema/sch_field.h index a4e3106efa..628461bf5b 100644 --- a/eeschema/sch_field.h +++ b/eeschema/sch_field.h @@ -3,7 +3,7 @@ * * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2022 CERN - * Copyright (C) 2004-2022 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -129,10 +129,7 @@ public: wxString GetShownText( const SCH_SHEET_PATH* aPath, bool aAllowExtraText, int aDepth = 0 ) const; - wxString GetShownText( bool aAllowExtraText, int aDepth = 0 ) const override - { - return GetShownText( nullptr, aAllowExtraText, aDepth ); - } + wxString GetShownText( bool aAllowExtraText, int aDepth = 0 ) const override; COLOR4D GetFieldColor() const;