removed wrong logic from previous change
This commit is contained in:
		@@ -2,7 +2,6 @@ package models
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/xml"
 | 
			
		||||
	"strconv"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type MxGraphModel struct {
 | 
			
		||||
@@ -45,17 +44,3 @@ func newMxIssue(message string) error {
 | 
			
		||||
	return &mxissue{message}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// mxCell inside object tags are create twice when unmarshalling
 | 
			
		||||
// once as they appear in the xml inside the MxObject struct and once in the MxCell struct
 | 
			
		||||
// so once retrieved from object we remove them from the root's MxCell list
 | 
			
		||||
func (m *MxGraphModel) removeMxCell(id string){
 | 
			
		||||
	int_id,_ := strconv.Atoi(id)
 | 
			
		||||
	int_id = int_id + 1
 | 
			
		||||
	cell_id := strconv.Itoa(int_id)
 | 
			
		||||
 | 
			
		||||
	for i, cell := range(m.Root.MxCell){
 | 
			
		||||
		if cell.ID == cell_id {
 | 
			
		||||
			m.Root.MxCell = append(m.Root.MxCell[:i],m.Root.MxCell[i+1:]...)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -624,7 +624,6 @@ func (ws Workspace) ConsumeMxGraphModel(xmlmodel MxGraphModel) (returned_wf *Wor
 | 
			
		||||
		// all components in a map[string]Component where the key
 | 
			
		||||
		// is the component's ID in the mxGraph and the value the Component object 
 | 
			
		||||
		returned_wf.UpdateObj(resObj,object.ID)
 | 
			
		||||
		xmlmodel.removeMxCell(object.ID)
 | 
			
		||||
 | 
			
		||||
		// Construct the object corresponding to the componant's type and use its addUserInput method
 | 
			
		||||
		if(resObj.getRtype() == rtype.COMPUTING){
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user