From 26bd37e0862c3356de015c7e9b360f17f81ec454 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 3 Jul 2013 09:27:52 +0200 Subject: [PATCH] Eeschema: fix bug Bug #1197103 and an other very minor bug. --- eeschema/annotate.cpp | 24 +++++++++++++++++++++++- eeschema/eeschema.cpp | 6 ++++-- eeschema/sch_screen.cpp | 5 +++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/eeschema/annotate.cpp b/eeschema/annotate.cpp index 1e7225d69e..c59d48efde 100644 --- a/eeschema/annotate.cpp +++ b/eeschema/annotate.cpp @@ -3,6 +3,29 @@ * @brief Component annotation. */ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2004-2013 KiCad Developers, see change_log.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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + #include // to use sort vector #include @@ -13,7 +36,6 @@ #include #include -#include #include #include diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp index da50b61fd2..0ba7209ce9 100644 --- a/eeschema/eeschema.cpp +++ b/eeschema/eeschema.cpp @@ -161,10 +161,12 @@ bool EDA_APP::OnInit() frame->Zoom_Automatique( true ); - /* Load file specified in the command line. */ + // Load file specified in the command line: if( fileReady ) { - wxSetWorkingDirectory( filename.GetPath() ); + if( !filename.GetPath().IsEmpty() ) + // wxSetWorkingDirectory does not like empty paths + wxSetWorkingDirectory( filename.GetPath() ); if( frame->LoadOneEEProject( filename.GetFullPath(), false ) ) frame->GetCanvas()->Refresh( true ); diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index d95b21c627..84326ea9e9 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -734,6 +734,11 @@ void SCH_SCREEN::ClearAnnotation( SCH_SHEET_PATH* aSheetPath ) SCH_COMPONENT* component = (SCH_COMPONENT*) item; component->ClearAnnotation( aSheetPath ); + + // Clear the modified component flag set by component->ClearAnnotation + // because we do not use it here and we should not leave this flag set, + // when an edition is finished: + component->ClearFlags(); } } }