[GME-commit] GMESRC/Tools/GMETableEditor TableEditorDumper.cpp,1.1,1.2 TableEditorParser.h,1.2,1.3 TableEditorParser.cpp,1.2,1.3

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu May 6 18:25:18 CDT 2004


Update of /var/lib/gme/GMESRC/Tools/GMETableEditor
In directory braindrain:/tmp/cvs-serv8067/Tools/GMETableEditor

Modified Files:
	TableEditorDumper.cpp TableEditorParser.h 
	TableEditorParser.cpp 
Log Message:
bugs found in testing, xml special chars and multiline attributes on import

CVS User: brianw

Index: TableEditorDumper.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Tools/GMETableEditor/TableEditorDumper.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TableEditorDumper.cpp	9 Apr 2004 19:20:40 -0000	1.1
--- TableEditorDumper.cpp	6 May 2004 22:25:15 -0000	1.2
***************
*** 70,74 ****
  void TableEditorDumper::DumpCell(CString cell_type, CString cell_entry, BOOL multi, BOOL boolean)
  {
! // First checks if cell entry is multiline. w/o specifying styleID, little boxes show up 
  	if( multi ) 
  	{
--- 70,81 ----
  void TableEditorDumper::DumpCell(CString cell_type, CString cell_entry, BOOL multi, BOOL boolean)
  {
! 
! 	//xml special chars
! 	cell_entry.Replace("&", "&");
! 	cell_entry.Replace("<","&lt;");
! 	cell_entry.Replace(">","&gt;");
! 	
! 	
! 	// First checks if cell entry is multiline. w/o specifying styleID, little boxes show up 
  	if( multi ) 
  	{
***************
*** 87,91 ****
  		cell_entry.Replace("false", "0");
  	}
! 
  	StartElemAttr("Data");
  	Attr("ss:Type", cell_type, TRUE);
--- 94,98 ----
  		cell_entry.Replace("false", "0");
  	}
! 	
  	StartElemAttr("Data");
  	Attr("ss:Type", cell_type, TRUE);

Index: TableEditorParser.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Tools/GMETableEditor/TableEditorParser.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TableEditorParser.h	6 May 2004 16:12:05 -0000	1.2
--- TableEditorParser.h	6 May 2004 22:25:15 -0000	1.3
***************
*** 51,54 ****
--- 51,55 ----
  	CString currentAttrDName;
  	BOOL inData; //only interested in CDATA in the <Data> tag
+ 	CString cdata;
  
  	BOOL SetAttr(CString DisplayedName, CString Value);

Index: TableEditorParser.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Tools/GMETableEditor/TableEditorParser.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TableEditorParser.cpp	6 May 2004 16:12:05 -0000	1.2
--- TableEditorParser.cpp	6 May 2004 22:25:15 -0000	1.3
***************
*** 17,20 ****
--- 17,21 ----
  	currentProject = theProject;
  	importedFCOs = NULL;
+ 	cdata = "";
  
  }
***************
*** 46,50 ****
  		CString desc(e.getMessage());
  		AfxMessageBox(desc);
! 		return NULL;
  	}
  
--- 47,51 ----
  		CString desc(e.getMessage());
  		AfxMessageBox(desc);
! 		throw;
  	}
  
***************
*** 63,66 ****
--- 64,68 ----
  	objNameColNum = -1;
  	inData = FALSE;
+ 	cdata = "";
  
  	COMTHROW(importedFCOs.CoCreateInstance(L"Mga.MgaFCOs"));
***************
*** 84,87 ****
--- 86,90 ----
  	{
  		inData = TRUE;
+ 		cdata = "";
  	}
  	if(elementName.Compare("Cell")==0)
***************
*** 122,125 ****
--- 125,129 ----
  	{
  		inData = FALSE;
+ 		cdata = "";
  	}
  }
***************
*** 128,132 ****
  {
  
! 	CString cdata(chars);
  
  	if(currentColNum == objNameColNum && inData)
--- 132,143 ----
  {
  
! 	CString newdata(chars);
! //	newdata.Remove('\n'); //it appeared as if '\n' was added at the front and back of every string
! 
! //	if(cdata != "") //if multiline
! //		cdata = cdata+"\n";
! 
! 	cdata = cdata + newdata; //if it's multiline, this func gets called multiple times
! 
  
  	if(currentColNum == objNameColNum && inData)
***************
*** 159,162 ****
--- 170,174 ----
  	if(currentRowNum > 0 && currentColNum >= firstAttrColNum && inData)
  	{
+ 
  		if((currentColNum-firstAttrColNum)%2==0)//Attribute Column
  		{
***************
*** 165,169 ****
  		else //Value Column
  		{
! 			SetAttr(currentAttrDName,cdata);
  		}
  	}
--- 177,183 ----
  		else //Value Column
  		{
! 			CString tmp = cdata;
! 			tmp.Replace("\n\n","\n");//somehow the newlines are doubling
! 			SetAttr(currentAttrDName,tmp);
  		}
  	}



More information about the GME-commit mailing list