From 7e4ade1664a9e49295ee5ec249ed596d40d6db65 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Tue, 4 Jun 2002 19:24:03 +0000 Subject: [PATCH] r2106: *** empty log message *** --- src/docs.cpp | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/docs.cpp b/src/docs.cpp index 7d8eb88..2a340d1 100644 --- a/src/docs.cpp +++ b/src/docs.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: docs.cpp,v 1.41 2002/06/04 19:19:40 kevin Exp $ +** $Id: docs.cpp,v 1.42 2002/06/04 19:24:03 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -78,9 +78,9 @@ bool ImageFileDocument::OnOpenDocument(const wxString& constFilename) wxString filename (constFilename); - if (filename == szNEW_IMAGE_FILENAME) { + if (filename == szNEW_IMAGE_FILENAME) filename = ""; - } else if (! m_pImageFile->fileRead (filename.c_str())) { + else if (! m_pImageFile->fileRead (filename.c_str())) { *theApp->getLog() << "Unable to read image file " << filename << "\n"; m_bBadFileOpen = true; return false; @@ -223,18 +223,24 @@ ProjectionFileDocument::~ProjectionFileDocument() } bool -ProjectionFileDocument::OnOpenDocument(const wxString& filename) +ProjectionFileDocument::OnOpenDocument(const wxString& constFilename) { if (! OnSaveModified()) return false; - if (! m_pProjectionFile->read (filename.c_str())) { + wxString filename (constFilename); + + if (filename == szNEW_PROJECTION_FILENAME) + filename = ""; + else if (! m_pProjectionFile->read (filename.c_str())) { *theApp->getLog() << "Unable to read projection file " << filename << "\n"; m_bBadFileOpen = true; return false; } - if (theApp->getVerboseLogging()) + + if (theApp->getVerboseLogging() && filename != "") *theApp->getLog() << "Read projection file " << filename << "\n"; + SetFilename(filename, true); Modify(false); getView()->setInitialClientSize(); @@ -369,23 +375,28 @@ PlotFileDocument::OnSaveDocument(const wxString& filename) } bool -PlotFileDocument::OnOpenDocument(const wxString& filename) +PlotFileDocument::OnOpenDocument(const wxString& constFilename) { if (! OnSaveModified()) return false; - if (! m_plot.fileRead (filename.c_str())) { + wxString filename (constFilename); + + if (filename == szNEW_PLOT_FILENAME) + filename = ""; + else if (! m_plot.fileRead (filename.c_str())) { *theApp->getLog() << "Unable to read plot file " << filename << "\n"; m_bBadFileOpen = true; return false; } - if (theApp->getVerboseLogging()) + + if (theApp->getVerboseLogging() && filename != "") *theApp->getLog() << "Read plot file " << filename << "\n"; + SetFilename (filename, true); m_namePlot = filename.c_str(); Modify (false); UpdateAllViews(); - //GetFirstView()->OnUpdate (NULL, NULL); m_bBadFileOpen = false; return true; @@ -448,7 +459,7 @@ TextFileDocument::OnOpenDocument(const wxString& filename) SetFilename (filename, true); Modify (false); - // UpdateAllViews(); + UpdateAllViews(); m_bBadFileOpen = false; return true; } @@ -510,7 +521,7 @@ Graph3dFileDocument::OnOpenDocument(const wxString& filename) { SetFilename (filename, true); Modify (false); - // UpdateAllViews(); + UpdateAllViews(); m_bBadFileOpen = false; return true; } -- 2.34.1