xml.cpp
changeset 166 325958acb69b
parent 160 72cc3873306a
child 169 aa48c7b52549
     1.1 --- a/xml.cpp	Thu Sep 22 12:56:05 2005 +0000
     1.2 +++ b/xml.cpp	Mon Oct 10 11:20:25 2005 +0000
     1.3 @@ -176,11 +176,10 @@
     1.4          lastBranch->addFloatImage();
     1.5  		lastFloat=lastBranch->getLastFloatImage();
     1.6  		if (!readFloatImageAttr(atts)) return false;
     1.7 -	} else if ( eName == "branch" && state == StateMap) 
     1.8 +	} else if ( (eName == "branch"||eName=="floatimage") && state == StateMap) 
     1.9  	{
    1.10  		// This is used in vymparts, which have no mapcenter!
    1.11  		isVymPart=true;
    1.12 -		state=StateBranch;
    1.13  		LinkableMapObj* lmo=me->getSelection();
    1.14  		if (!lmo)
    1.15  		{
    1.16 @@ -194,17 +193,26 @@
    1.17  				|| (typeid(*lmo) == typeid(MapCenterObj) ) )
    1.18  		{
    1.19  			lastBranch=(BranchObj*)(lmo);
    1.20 -			if (loadMode==ImportAdd)
    1.21 +			if (eName=="branch")
    1.22  			{
    1.23 -				lastBranch->addBranch();
    1.24 -				lastBranch=lastBranch->getLastBranch();
    1.25 -				
    1.26 -			} else
    1.27 -				lastBranch->clear();
    1.28 -		} else
    1.29 -			return false;
    1.30 -		branchDepth=1;
    1.31 -		readBranchAttr (atts);
    1.32 +				state=StateBranch;
    1.33 +				if (loadMode==ImportAdd)
    1.34 +				{
    1.35 +					lastBranch->addBranch();
    1.36 +					lastBranch=lastBranch->getLastBranch();
    1.37 +					
    1.38 +				} else
    1.39 +					lastBranch->clear();
    1.40 +				branchDepth=1;
    1.41 +				readBranchAttr (atts);
    1.42 +			} else if (eName=="floatimage")
    1.43 +			{
    1.44 +				state=StateFloatImage;
    1.45 +				lastBranch->addFloatImage();
    1.46 +				lastFloat=lastBranch->getLastFloatImage();
    1.47 +				if (!readFloatImageAttr(atts)) return false;
    1.48 +			} else return false;
    1.49 +		} else return false;
    1.50  	} else if ( eName == "branch" && state == StateMapCenter) 
    1.51  	{
    1.52  		state=StateBranch;
    1.53 @@ -279,6 +287,7 @@
    1.54          case StateMapCenterHeading: state=StateMapCenter;  return true;
    1.55          case StateMapCenterNote: state=StateMapCenter;  return true;
    1.56          case StateMapCenterFloatImage: state=StateMapCenter;  return true;
    1.57 +        case StateFloatImage: state=StateMap; return true;
    1.58          case StateBranch: 
    1.59              if (branchDepth>1) 
    1.60  			{