Commit 7ab924c3 authored by charras's avatar charras

minor bugs fixed, and remove warnings when using wxWidgets 3 in specctra.cpp

parent bc9ad9c7
......@@ -1008,7 +1008,7 @@ wxString WinEDA_App::GetLibraryFile( const wxString& filename )
*/
wxString WinEDA_App::ReturnLastVisitedLibraryPath( const wxString & aSubPathToSearch )
{
if ( m_LastVisitedLibPath )
if ( ! m_LastVisitedLibPath.IsEmpty() )
return m_LastVisitedLibPath;
wxString path;
......
......@@ -50,8 +50,6 @@ extern BASE_SCREEN* ActiveScreen;
/* Variables locales */
static int GRLastMoveToX, GRLastMoveToY;
static int Text_Color = LIGHTGRAY;
static int PenMinWidth = 1; /* largeur minimum de la plume (DOIT etre > 0)
* (utile pour trace sur imprimante) */
static int ForceBlackPen; /* si != 0 : traces en noir (utilise pour trace
......
......@@ -717,7 +717,7 @@ int WinEDA_FindFrame::ExploreAllLibraries( const wxString& wildmask, wxString& F
char Line[2048], * name;
wxString path;
for( unsigned ii; ii < wxGetApp().GetLibraryPathList().GetCount(); ii++ )
for( unsigned ii = 0; ii < wxGetApp().GetLibraryPathList().GetCount(); ii++ )
{
path = wxGetApp().GetLibraryPathList()[ii];
FullFileName = wxFindFirstFile( path + wxT( "*." ) + CompLibFileExtension );
......
......@@ -465,7 +465,7 @@ wxString WinEDA_SchematicFrame::GetUniqueFilenameForCurrentSheet( )
/** Function GetUniqueFilenameForCurrentSheet
* @return a filename that can be used in plot and print functions
* for the current screen anad sheet path.
* This filename is unique and must be used insteed of the sreen filename
* This filename is unique and must be used insteed of the screen filename
* (or scheen filename) when one must creates file for each sheet in the heierarchy.
* because in complex hierarchies a sheet and a SCH_SCREEN is used more than once
* Name is <root sheet filename>-<sheet path>
......@@ -473,10 +473,8 @@ wxString WinEDA_SchematicFrame::GetUniqueFilenameForCurrentSheet( )
* However if filename is too long name is <sheet filename>-<sheet number>
*/
{
wxString filename;
wxSplitPath( g_RootSheet->GetFileName().GetData(), (wxString*) NULL,
&filename, (wxString*) NULL );
wxFileName fn = g_RootSheet->GetFileName();
wxString filename = fn.GetName();
if ( (filename.Len() + m_CurrentSheet->PathHumanReadable().Len() ) < 50 )
{
......@@ -486,8 +484,6 @@ wxString WinEDA_SchematicFrame::GetUniqueFilenameForCurrentSheet( )
}
else
{
wxSplitPath( g_RootSheet->GetFileName().GetData(), (wxString*) NULL,
&filename, (wxString*) NULL );
filename << wxT("-") << GetScreen()->m_ScreenNumber;
}
......
......@@ -321,7 +321,7 @@ void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IOError )
if( !fp )
{
ThrowIOError( _("Unable to open file \"%s\""), filename.GetData() );
ThrowIOError( _("Unable to open file \"") + filename +wxT("\"") );
}
file.Attach( fp ); // "exception safe" way to close the file.
......@@ -351,7 +351,7 @@ void SPECCTRA_DB::LoadSESSION( const wxString& filename ) throw( IOError )
if( !fp )
{
ThrowIOError( _("Unable to open file \"%s\""), filename.GetData() );
ThrowIOError( _("Unable to open file \"") + filename + wxT("\"") );
}
file.Attach( fp ); // "exception safe" way to close the file.
......@@ -3465,7 +3465,7 @@ int SPECCTRA_DB::Print( int nestLevel, const char* fmt, ... ) throw( IOError )
}
if( result<0 || (result=vfprintf( fp, fmt, args ))<0 )
ThrowIOError( _("System file error writing to file \"%s\""), filename.GetData() );
ThrowIOError( _("System file error writing to file \"") + filename + wxT("\"") );
va_end( args );
......@@ -3521,7 +3521,7 @@ void SPECCTRA_DB::ExportPCB( wxString filename, bool aNameChange ) throw( IOErro
if( !fp )
{
ThrowIOError( _("Unable to open file \"%s\""), filename.GetData() );
ThrowIOError( _("Unable to open file \"") + filename + wxT("\"") );
}
if( pcb )
......@@ -3546,7 +3546,7 @@ void SPECCTRA_DB::ExportSESSION( wxString filename )
if( !fp )
{
ThrowIOError( _("Unable to open file \"%s\""), filename.GetData() );
ThrowIOError( _("Unable to open file \"") + filename + wxT("\"") );
}
if( session )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment