xml-vym.cpp
changeset 754 db0ec4bcf416
parent 753 25a77484ec72
child 756 a8a5c7288f57
     1.1 --- a/xml-vym.cpp	Tue Apr 07 16:15:53 2009 +0000
     1.2 +++ b/xml-vym.cpp	Mon Apr 20 10:42:05 2009 +0000
     1.3 @@ -287,6 +287,7 @@
     1.4          case StateBranch: 
     1.5  			model->selectParent();
     1.6  			lastBranchItem=model->getSelectedBranchItem();
     1.7 +			lastBranchItem->setLastSelectedBranch (0);	// Reset last selected to first child branch
     1.8              break;
     1.9          case StateHtml: 
    1.10  			htmldata+="</"+eName+">";
    1.11 @@ -441,7 +442,7 @@
    1.12  			}           
    1.13  		}           
    1.14  		if (!a.value( "id").isEmpty() ) 
    1.15 -			lastOO->setID (a.value ("id"));
    1.16 +			lastBranchItem->setID (a.value ("id"));
    1.17  		if (!a.value( "url").isEmpty() ) 
    1.18  			lastOO->setURL (a.value ("url"));
    1.19  		if (!a.value( "vymLink").isEmpty() ) 
    1.20 @@ -582,22 +583,25 @@
    1.21  	{ 
    1.22  		if (!a.value( "endBranch").isEmpty() ) 
    1.23  		{
    1.24 -			LinkableMapObj *lmo=model->findObjBySelect (a.value( "beginBranch"));
    1.25 -			if (lmo && typeid (*lmo)==typeid (BranchObj))
    1.26 +			TreeItem *ti=model->findBySelectString (a.value( "beginBranch"));
    1.27 +			if (ti && ti->isBranchLikeType())
    1.28  			{
    1.29 +			/* FIXME-2 xLinks
    1.30  				xlo->setBegin ((BranchObj*)lmo);
    1.31 -				lmo=model->findObjBySelect (a.value( "endBranch"));
    1.32 +				lmo=model->findBySelectString (a.value( "endBranch"));
    1.33  				if (lmo && typeid (*lmo)==typeid (BranchObj))
    1.34  				{
    1.35  					xlo->setEnd ((BranchObj*)(lmo));
    1.36  					xlo->activate();
    1.37  					success=true;
    1.38  				}
    1.39 +			*/
    1.40  			}
    1.41  		}           
    1.42  	}	
    1.43  
    1.44  	// object ID is used starting in version 1.8.76
    1.45 +	/* FIXME-2 xLinks
    1.46  	if (!a.value( "beginID").isEmpty() ) 
    1.47  	{ 
    1.48  		if (!a.value( "endID").isEmpty() ) 
    1.49 @@ -616,6 +620,7 @@
    1.50  			}
    1.51  		}           
    1.52  	}	
    1.53 +	*/
    1.54  	if (!success) delete (xlo);
    1.55  	return true;	// xLinks can only be established at the "end branch", return true
    1.56  }