3D view: Fix Bug #908871

Eeschema: fix a minor issue.
This commit is contained in:
jean-pierre charras 2011-12-27 19:08:50 +01:00
parent 750dd6eeac
commit 375310f2ab
2 changed files with 14 additions and 5 deletions

View File

@ -49,13 +49,20 @@ int S3D_MASTER::ReadData()
return 1; return 1;
} }
if( wxFileName::FileExists( m_Shape3DName ) ) wxString shape3DNname = m_Shape3DName;
#ifdef __WINDOWS__
shape3DNname.Replace( wxT("/"), wxT("\\") );
#else
shape3DNname.Replace( wxT("\\"), wxT("/") );
#endif
if( wxFileName::FileExists( shape3DNname ) )
{ {
FullFilename = m_Shape3DName; FullFilename = shape3DNname;
} }
else else
{ {
fn = m_Shape3DName; fn = shape3DNname;
FullFilename = wxGetApp().FindLibraryPath( fn ); FullFilename = wxGetApp().FindLibraryPath( fn );
if( FullFilename.IsEmpty() ) if( FullFilename.IsEmpty() )

View File

@ -322,6 +322,7 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event )
if( libFileName.FileExists() ) if( libFileName.FileExists() )
{ {
backupFileName.SetExt( wxT( "bak" ) ); backupFileName.SetExt( wxT( "bak" ) );
if( backupFileName.FileExists() )
wxRemoveFile( backupFileName.GetFullPath() ); wxRemoveFile( backupFileName.GetFullPath() );
if( !wxRenameFile( libFileName.GetFullPath(), backupFileName.GetFullPath() ) ) if( !wxRenameFile( libFileName.GetFullPath(), backupFileName.GetFullPath() ) )
@ -361,6 +362,7 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event )
if( docFileName.FileExists() ) if( docFileName.FileExists() )
{ {
backupFileName.SetExt( wxT( "bck" ) ); backupFileName.SetExt( wxT( "bck" ) );
if( backupFileName.FileExists() )
wxRemoveFile( backupFileName.GetFullPath() ); wxRemoveFile( backupFileName.GetFullPath() );
if( !wxRenameFile( docFileName.GetFullPath(), backupFileName.GetFullPath() ) ) if( !wxRenameFile( docFileName.GetFullPath(), backupFileName.GetFullPath() ) )