Commit 375310f2 authored by jean-pierre charras's avatar jean-pierre charras

3D view: Fix Bug #908871

Eeschema: fix a minor issue.
parent 750dd6ee
...@@ -49,13 +49,20 @@ int S3D_MASTER::ReadData() ...@@ -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() )
......
...@@ -322,7 +322,8 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event ) ...@@ -322,7 +322,8 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event )
if( libFileName.FileExists() ) if( libFileName.FileExists() )
{ {
backupFileName.SetExt( wxT( "bak" ) ); backupFileName.SetExt( wxT( "bak" ) );
wxRemoveFile( backupFileName.GetFullPath() ); if( backupFileName.FileExists() )
wxRemoveFile( backupFileName.GetFullPath() );
if( !wxRenameFile( libFileName.GetFullPath(), backupFileName.GetFullPath() ) ) if( !wxRenameFile( libFileName.GetFullPath(), backupFileName.GetFullPath() ) )
{ {
...@@ -361,7 +362,8 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event ) ...@@ -361,7 +362,8 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event )
if( docFileName.FileExists() ) if( docFileName.FileExists() )
{ {
backupFileName.SetExt( wxT( "bck" ) ); backupFileName.SetExt( wxT( "bck" ) );
wxRemoveFile( backupFileName.GetFullPath() ); if( backupFileName.FileExists() )
wxRemoveFile( backupFileName.GetFullPath() );
if( !wxRenameFile( docFileName.GetFullPath(), backupFileName.GetFullPath() ) ) if( !wxRenameFile( docFileName.GetFullPath(), backupFileName.GetFullPath() ) )
{ {
......
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