xml-vym.cpp
changeset 775 6e4b586aa88a
parent 773 340bc29da9a0
child 776 25e634a7e1dc
     1.1 --- a/xml-vym.cpp	Tue May 26 11:24:51 2009 +0000
     1.2 +++ b/xml-vym.cpp	Wed Jun 03 20:37:17 2009 +0000
     1.3 @@ -151,8 +151,7 @@
     1.4  				lastBranchItem=bi;
     1.5  				if (loadMode==ImportAdd)
     1.6  				{
     1.7 -					model->createBranch();
     1.8 -					lastBranchItem=model->getSelectedBranchItem();
     1.9 +					lastBranchItem=model->createBranch(lastBranchItem);
    1.10  				} //else
    1.11  					//FIXME-3 lastBranch->clear();
    1.12  			} else
    1.13 @@ -212,8 +211,7 @@
    1.14  				state=StateBranch;
    1.15  				if (loadMode==ImportAdd)
    1.16  				{
    1.17 -					model->createBranch();
    1.18 -					lastBranchItem=model->getSelectedBranchItem();
    1.19 +					lastBranchItem=model->createBranch(lastBranchItem);
    1.20  					
    1.21  				} else
    1.22  					//FIXME-2 lastBranch->clear();
    1.23 @@ -229,7 +227,7 @@
    1.24  	} else if ( eName == "branch" && state == StateMapCenter) 
    1.25  	{
    1.26  		state=StateBranch;
    1.27 -		lastBranchItem=model->createBranch();
    1.28 +		lastBranchItem=model->createBranch(lastBranchItem);
    1.29  		readBranchAttr (atts);
    1.30  	} else if ( eName == "htmlnote" && state == StateBranch) 
    1.31  	{
    1.32 @@ -249,7 +247,7 @@
    1.33  		if (!readXLinkAttr (atts)) return false;
    1.34      } else if ( eName == "branch" && state == StateBranch ) 
    1.35  	{
    1.36 -		lastBranchItem=model->createBranch();
    1.37 +		lastBranchItem=model->createBranch(lastBranchItem);
    1.38  		readBranchAttr (atts);
    1.39      } else if ( eName == "html" && state == StateHtmlNote ) 
    1.40  	{
    1.41 @@ -285,13 +283,13 @@
    1.42          case StateMapCenter: 
    1.43  			model->selectParent();
    1.44  			model->emitDataHasChanged (lastBranchItem);
    1.45 -			lastBranchItem=model->getSelectedBranchItem();
    1.46 +			lastBranchItem=(BranchItem*)(lastBranchItem->parent());
    1.47  			lastBranchItem->setLastSelectedBranch (0);	// Reset last selected to first child branch
    1.48              break;
    1.49          case StateBranch: 
    1.50  			model->selectParent();
    1.51  			model->emitDataHasChanged (lastBranchItem);
    1.52 -			lastBranchItem=model->getSelectedBranchItem();
    1.53 +			lastBranchItem=(BranchItem*)(lastBranchItem->parent());
    1.54  			lastBranchItem->setLastSelectedBranch (0);	// Reset last selected to first child branch
    1.55              break;
    1.56          case StateHtml: 
    1.57 @@ -341,7 +339,7 @@
    1.58  			htmldata+=ch_org;
    1.59  			break;
    1.60          case StateHeading: 
    1.61 -            model->setHeading(ch_simplified);
    1.62 +            lastBranchItem->setHeading(ch_simplified);
    1.63              break;
    1.64          default: 
    1.65  			return false;