Bugfix for duplicate xLinks
authorinsilmaril
Thu Jun 01 14:51:56 2006 +0000 (2006-06-01)
changeset 345c8b7e4dd9e9e
parent 344 7bafe3db684c
child 346 5e703d4959ae
Bugfix for duplicate xLinks
branchobj.cpp
     1.1 --- a/branchobj.cpp	Thu Jun 01 11:19:58 2006 +0000
     1.2 +++ b/branchobj.cpp	Thu Jun 01 14:51:56 2006 +0000
     1.3 @@ -807,8 +807,21 @@
     1.4  
     1.5  	// Save XLinks
     1.6  	XLinkObj *xlo;
     1.7 +	//FIXME exponential increase in xlinks...
     1.8 +	QString ol;	// old link
     1.9 +	QString cl;	// current link
    1.10      for (xlo=xlink.first(); xlo; xlo=xlink.next() )
    1.11 -		s+=xlo->saveToDir();
    1.12 +	{
    1.13 +		cl=xlo->saveToDir();
    1.14 +		if (cl!=ol)
    1.15 +		{
    1.16 +			s+=cl;
    1.17 +			ol=cl;
    1.18 +		} else
    1.19 +		{
    1.20 +			qWarning (QString("Ignoring of duplicate xLink in %1").arg(getHeading()));
    1.21 +		}
    1.22 +	}	
    1.23  
    1.24      decIndent();
    1.25      s+=endElement   ("branch");