From 375310f2ab642cff29d3ca098bf7f576e400200b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 27 Dec 2011 19:08:50 +0100 Subject: [PATCH] 3D view: Fix Bug #908871 Eeschema: fix a minor issue. --- 3d-viewer/3d_read_mesh.cpp | 13 ++++++++++--- eeschema/libedit.cpp | 6 ++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/3d-viewer/3d_read_mesh.cpp b/3d-viewer/3d_read_mesh.cpp index bed2b50104..e98d398574 100644 --- a/3d-viewer/3d_read_mesh.cpp +++ b/3d-viewer/3d_read_mesh.cpp @@ -49,13 +49,20 @@ int S3D_MASTER::ReadData() 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 { - fn = m_Shape3DName; + fn = shape3DNname; FullFilename = wxGetApp().FindLibraryPath( fn ); if( FullFilename.IsEmpty() ) diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index 2fe713d023..d73356e0d7 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -322,7 +322,8 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event ) if( libFileName.FileExists() ) { backupFileName.SetExt( wxT( "bak" ) ); - wxRemoveFile( backupFileName.GetFullPath() ); + if( backupFileName.FileExists() ) + wxRemoveFile( backupFileName.GetFullPath() ); if( !wxRenameFile( libFileName.GetFullPath(), backupFileName.GetFullPath() ) ) { @@ -361,7 +362,8 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event ) if( docFileName.FileExists() ) { backupFileName.SetExt( wxT( "bck" ) ); - wxRemoveFile( backupFileName.GetFullPath() ); + if( backupFileName.FileExists() ) + wxRemoveFile( backupFileName.GetFullPath() ); if( !wxRenameFile( docFileName.GetFullPath(), backupFileName.GetFullPath() ) ) {