xml-vym.cpp
branchrelease-1-12-maintained
changeset 74 98449ef9eccd
parent 70 e3a85616dbc5
     1.1 --- a/xml-vym.cpp	Mon Jul 27 12:53:19 2009 +0000
     1.2 +++ b/xml-vym.cpp	Thu Jul 30 07:40:05 2009 +0000
     1.3 @@ -60,7 +60,7 @@
     1.4  		<<">  state="<<state 
     1.5  		<<"  laststate="<<stateStack.last()
     1.6  		<<"   loadMode="<<loadMode
     1.7 -		<<"       line="<<QXmlDefaultHandler::lineNumber()
     1.8 +		//<<"       line="<<QXmlDefaultHandler::lineNumber()
     1.9  		<<endl;
    1.10  	*/	
    1.11  	stateStack.append (state);	
    1.12 @@ -150,18 +150,23 @@
    1.13  			// Treat the found mapcenter as a branch 
    1.14  			// in an existing map
    1.15  			LinkableMapObj* lmo=model->getSelection();
    1.16 -			if (lmo && ((typeid(*lmo) == typeid(BranchObj) ) 
    1.17 -			        ||  typeid(*lmo) == typeid(MapCenterObj) ) )
    1.18 +			if (lmo)
    1.19  			{
    1.20 -				lastBranch=(BranchObj*)lmo;
    1.21 -				if (loadMode==ImportAdd)
    1.22 +				if ( (typeid(*lmo) == typeid(BranchObj) ) 
    1.23 +						||  typeid(*lmo) == typeid(MapCenterObj) ) 
    1.24  				{
    1.25 -					lastBranch->addBranch();
    1.26 -					lastBranch=lastBranch->getLastBranch();
    1.27 -				} else
    1.28 -					lastBranch->clear();
    1.29 +					lastBranch=(BranchObj*)lmo;
    1.30 +					if (loadMode==ImportAdd)
    1.31 +					{
    1.32 +						lastBranch->addBranch();
    1.33 +						lastBranch=lastBranch->getLastBranch();
    1.34 +					} else
    1.35 +						lastBranch->clear();
    1.36 +				}	
    1.37  			} else
    1.38 -				return false;
    1.39 +				// Add mapCenter without parent
    1.40 +				lastBranch=model->addMapCenter();
    1.41 +			
    1.42  		}
    1.43  		readBranchAttr (atts);
    1.44  	} else if ( 
    1.45 @@ -426,7 +431,7 @@
    1.46  					return false;   // Couldn't read relPos
    1.47  			}           
    1.48  		}           
    1.49 -		if (!a.value( "absPosX").isEmpty() && loadMode==NewMap ) 
    1.50 +		if (!a.value( "absPosX").isEmpty() ) 
    1.51  		{
    1.52  			if (!a.value( "absPosY").isEmpty() ) 
    1.53  			{