[GME-commit] GMESRC/GME/Parser MgaParserSC.cpp,1.8,1.9

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Wed Sep 14 17:16:15 CDT 2005


Update of /project/gme-repository/GMESRC/GME/Parser
In directory escher:/tmp/cvs-serv17612

Modified Files:
	MgaParserSC.cpp 
Log Message:
Temporary connection created in case can't be reconstructed properly from the attributes (connpoint not found).


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: MgaParserSC.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Parser/MgaParserSC.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** MgaParserSC.cpp	31 Aug 2005 20:48:04 -0000	1.8
--- MgaParserSC.cpp	14 Sep 2005 16:16:13 -0000	1.9
***************
*** 383,386 ****
--- 383,396 ----
  					else if( !o2) bstr.Append( makeViewable( GetByName( attributes, "smart1Target" )).c_str());
  					msgSC( bstr, MSG_ERROR);
+ 
+ 					// to safely pass through hard times (parsing internal connpoints, attributes, regnodes...
+ 					// we create a temporary connection with "handicapped" extrsinfo
+ 					// which will be deleted by EndSCConnection
+ 					
+ 					preparerelid(attributes);
+ 					COMTHROW( prev->CreateChildObject(role, PutOut(conn)) );
+ 					assignrelid(conn);
+ 					
+ 					GetCurrent().exstrinfo = "handicapped";
  				}
  			}
***************
*** 646,649 ****
--- 656,676 ----
  void CMgaParser::EndSCConnection()
  {
+ 	CComObjPtr<IMgaConnection> fresh_conn;
+ 
+ 	ASSERT( GetCurrent().object);
+ 	COMTHROW( GetCurrent().object.QueryInterface( fresh_conn));
+ 	if( !fresh_conn) 
+ 	{
+ 		ASSERT(0); // it should be a connection at least
+ 		return;
+ 	}
+ 
+ 	CComObjPtrVector<IMgaConnPoint> cps;
+ 	COMTHROW( fresh_conn->get_ConnPoints( PutOut( cps)));
+ 	if( cps.size() < 2 || GetCurrent().exstrinfo == "handicapped") // handicapped connection, error must have occurred
+ 	{
+ 		COMTHROW( fresh_conn->DestroyObject());
+ 		return;
+ 	}
  }
  



More information about the GME-commit mailing list