From 156d5f50d6507b7705644fd8e7fc575f6b969104 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 28 Aug 2015 16:15:45 +0200 Subject: [PATCH] fix unwanted foreground frame change on Windows when creating BOM and netlists from scripts. Very minor coverity warning fixes. --- 3d-viewer/vrml_v2_modelparser.cpp | 13 +++++++++++-- common/dialog_shim.cpp | 13 +++++++++++++ pcbnew/github/html_link_parser.cpp | 1 + pcbnew/router/pns_meander.h | 5 +++-- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/3d-viewer/vrml_v2_modelparser.cpp b/3d-viewer/vrml_v2_modelparser.cpp index aa7e8f35a3..01b9a33e5b 100644 --- a/3d-viewer/vrml_v2_modelparser.cpp +++ b/3d-viewer/vrml_v2_modelparser.cpp @@ -1669,9 +1669,18 @@ int VRML2_MODEL_PARSER::read_Normal() { // Debug if( m_normalPerVertex == false ) - wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Normal m_PerFaceNormalsNormalized.size: %zu" ), m_model->m_PerFaceNormalsNormalized.size() ); + { + wxLogTrace( traceVrmlV2Parser, + m_debugSpacer + wxT( "read_Normal m_PerFaceNormalsNormalized.size: %zu" ), + m_model->m_PerFaceNormalsNormalized.size() ); + } else - wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Normal m_PerVertexNormalsNormalized.size: %zu" ), m_model->m_PerVertexNormalsNormalized.size() ); + { + wxLogTrace( traceVrmlV2Parser, + m_debugSpacer + wxT( "read_Normal m_PerVertexNormalsNormalized.size: %zu" ), + m_model->m_PerVertexNormalsNormalized.size() ); + } + debug_exit(); wxLogTrace( traceVrmlV2Parser, m_debugSpacer + wxT( "read_Normal exit" ) ); return 0; diff --git a/common/dialog_shim.cpp b/common/dialog_shim.cpp index fad1865c4c..aaa96cb403 100644 --- a/common/dialog_shim.cpp +++ b/common/dialog_shim.cpp @@ -26,6 +26,7 @@ #include #include #include +#include /// Toggle a window's "enable" status to disabled, then enabled on destruction. @@ -69,6 +70,18 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl if( h ) SetKiway( this, &h->Kiway() ); +#ifdef __WINDOWS__ + // On Windows, the app top windows can be brought to the foreground + // (at least temporary) in certain circumstances, + // for instance when calling an external tool in Eeschema boom generation. + // So set the parent KIWAY_PLAYER kicad frame (if exists) to top window + // to avoid this annoying behavior + KIWAY_PLAYER* parent_kiwayplayer = dynamic_cast( aParent ); + + if( parent_kiwayplayer ) + Pgm().App().SetTopWindow( parent_kiwayplayer ); +#endif + #if DLGSHIM_USE_SETFOCUS Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SHIM::onInit ) ); #endif diff --git a/pcbnew/github/html_link_parser.cpp b/pcbnew/github/html_link_parser.cpp index 5d6b751d87..b548b670c7 100644 --- a/pcbnew/github/html_link_parser.cpp +++ b/pcbnew/github/html_link_parser.cpp @@ -51,6 +51,7 @@ bool LINK_TAGHANDLER::HandleTag(const wxHtmlTag& tag) HTML_LINK_PARSER::HTML_LINK_PARSER( const wxString& aSrc, wxArrayString& aUrls ) : m_src( aSrc ), stringUrls( aUrls ) { + m_filter = NULL; AddTagHandler( new LINK_TAGHANDLER(this) ); } diff --git a/pcbnew/router/pns_meander.h b/pcbnew/router/pns_meander.h index e7e0b910dd..88fb2cc5a8 100644 --- a/pcbnew/router/pns_meander.h +++ b/pcbnew/router/pns_meander.h @@ -114,14 +114,15 @@ public: m_dual( aIsDual ), m_width( aWidth ), m_baselineOffset( 0 ) - { + { // Do not leave unitialized members, and keep static analyser quiet: m_type = MT_SINGLE; m_amplitude = 0; m_side = false; m_baseIndex = 0; m_currentTarget = NULL; - } + m_meanCornerRadius = 0; + } /** * Function SetType()