From febe66ddb87e98b56f8bb7aa14800d7d477d34a5 Mon Sep 17 00:00:00 2001 From: davila <> Date: Mon, 24 Sep 2012 13:26:49 +0000 Subject: [PATCH] Bug 1613. Reading .bbg in windows .. --- .../bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index de910b7..e4bb7ef 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -1754,29 +1754,37 @@ void wxVtkSceneManager::getCleanLine(stringstream &inputStream, std::string &lin { getline(inputStream, line,'\n'); int size = line.length(); - if ( line[ size-1 ]==13 ) +printf(" wxVtkSceneManager::getCleanLine Start %d %s\n",size, line.c_str() ); + if (size>0) { - line.erase(size-1,1); - } + if ( line[ size-1 ]==13 ) + { + line.erase(size-1,1); + } // if line + } // if size +printf(" wxVtkSceneManager::getCleanLine End\n", line.c_str() ); } //========================================================================= - void wxVtkSceneManager::loadDiagram(stringstream &inputStream) { + printf("wxVtkSceneManager::loadDiagram Start\n"); int size; std::string version = ""; std::string line = ""; char delims[] = ":"; char *result = NULL; + printf("wxVtkSceneManager::loadDiagram 1\n"); getCleanLine(inputStream, line); + printf("wxVtkSceneManager::loadDiagram 2 %s\n",line.c_str()); bool start = false; while (!inputStream.eof()) { if (line == "" || line[0] == '#') { line=""; getCleanLine(inputStream, line); + printf("wxVtkSceneManager::loadDiagram line> %s\n",line.c_str()); if (line == "# - BBTKGEditor v 1.0 BBG BlackBox Diagram file") { version = line.substr(18, 3); @@ -2139,6 +2147,7 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream) } // start +printf("wxVtkSceneManager::loadDiagram End\n"); } //========================================================================= -- 2.45.0