branchobj.cpp
changeset 239 bdeb503d2b7f
parent 223 e03b393e4e51
child 254 d3080e02b13a
     1.1 --- a/branchobj.cpp	Wed Mar 08 12:59:08 2006 +0000
     1.2 +++ b/branchobj.cpp	Tue Mar 14 14:27:04 2006 +0000
     1.3 @@ -104,9 +104,6 @@
     1.4  
     1.5  	includeImagesVer=false;
     1.6  	includeImagesHor=false;
     1.7 -
     1.8 -	url="";
     1.9 -	vymLink="";
    1.10  }
    1.11  
    1.12  void BranchObj::copy (BranchObj* other)
    1.13 @@ -129,9 +126,6 @@
    1.14  	tmpUnscrolled=other->tmpUnscrolled;
    1.15  	setVisibility (other->visible);
    1.16  
    1.17 -	url=other->url;
    1.18 -	vymLink=other->vymLink;
    1.19 -
    1.20  	angle=other->angle;
    1.21  
    1.22      positionBBox();
    1.23 @@ -400,21 +394,12 @@
    1.24  			LinkableMapObj::setLinkColor ();
    1.25  }
    1.26  
    1.27 -void BranchObj::setColor (QColor col, bool colorChilds)
    1.28 +void BranchObj::setColorChilds (QColor col)
    1.29  {
    1.30 -    heading->setColor(col);
    1.31 -	setLinkColor();
    1.32 -    if (colorChilds) 
    1.33 -    {
    1.34 -		BranchObj *bo;
    1.35 -		for (bo=branch.first(); bo; bo=branch.next() )
    1.36 -			bo->setColor(col,colorChilds);
    1.37 -    }	
    1.38 -}
    1.39 -
    1.40 -QColor BranchObj::getColor()
    1.41 -{
    1.42 -	return heading->getColor();
    1.43 +	OrnamentedObj::setColor (col);
    1.44 +	BranchObj *bo;
    1.45 +	for (bo=branch.first(); bo; bo=branch.next() )
    1.46 +		bo->setColorChilds(col);
    1.47  }
    1.48  
    1.49  BranchObj* BranchObj::first()
    1.50 @@ -711,58 +696,6 @@
    1.51  	requestReposition();
    1.52  }
    1.53  
    1.54 -void BranchObj::setURL(QString s)
    1.55 -{
    1.56 -	url=s;
    1.57 -	if (!url.isEmpty())
    1.58 -		systemFlags->activate("url");
    1.59 -	else	
    1.60 -		systemFlags->deactivate("url");
    1.61 -	calcBBoxSize();			// recalculate bbox
    1.62 -    positionBBox();			// rearrange contents
    1.63 -	forceReposition();
    1.64 -}
    1.65 -
    1.66 -QString BranchObj::getURL()
    1.67 -{
    1.68 -	return url;
    1.69 -}
    1.70 -
    1.71 -void BranchObj::setVymLink(QString s)
    1.72 -{
    1.73 -	if (!s.isEmpty())
    1.74 -	{
    1.75 -		// We need the relative (from loading) 
    1.76 -		// or absolute path (from User event)
    1.77 -		// and build the absolute path.
    1.78 -		// Note: If we have relative, use path of
    1.79 -		// current map to build absolute path
    1.80 -		QDir d(s);
    1.81 -		if (!d.path().startsWith ("/"))
    1.82 -		{
    1.83 -			QString p=mapEditor->getDestPath();
    1.84 -			int i=p.findRev("/",-1);
    1.85 -			d.setPath(p.left(i)+"/"+s);
    1.86 -			d.convertToAbs();
    1.87 -		}
    1.88 -		vymLink=d.path();
    1.89 -		systemFlags->activate("vymLink");
    1.90 -	}	
    1.91 -	else	
    1.92 -	{
    1.93 -		systemFlags->deactivate("vymLink");
    1.94 -		vymLink="";
    1.95 -	}	
    1.96 -	calcBBoxSize();			// recalculate bbox
    1.97 -    positionBBox();			// rearrange contents
    1.98 -	forceReposition();
    1.99 -}
   1.100 -
   1.101 -QString BranchObj::getVymLink()
   1.102 -{
   1.103 -	return vymLink;
   1.104 -}
   1.105 -
   1.106  QString BranchObj::saveToDir (const QString &tmpdir,const QString &prefix, const QPoint& offset)
   1.107  {
   1.108      QString s,a;
   1.109 @@ -772,24 +705,6 @@
   1.110  	else
   1.111  		scrolledAttr="";
   1.112  
   1.113 -	QString posAttr;
   1.114 -	if (depth<2) posAttr=
   1.115 -		attribut("absPosX",QString().setNum(absPos.x(),10)) +
   1.116 -		attribut("absPosY",QString().setNum(absPos.y(),10)); 
   1.117 -	else
   1.118 -		posAttr="";
   1.119 -
   1.120 -	QString linkAttr=getLinkAttr()+" "+getIncludeImageAttr();
   1.121 -	
   1.122 -
   1.123 -	QString urlAttr;
   1.124 -	if (!url.isEmpty())
   1.125 -		urlAttr=attribut ("url",url);
   1.126 -
   1.127 -	QString vymLinkAttr;
   1.128 -	if (!vymLink.isEmpty())
   1.129 -		vymLinkAttr=attribut ("vymLink",convertToRel(mapEditor->getDestPath(),vymLink) );
   1.130 -
   1.131  	QString frameAttr;
   1.132  	if (frame->getFrameType()!=NoFrame)
   1.133  		frameAttr=attribut ("frameType",frame->getFrameTypeName());
   1.134 @@ -816,7 +731,13 @@
   1.135  	else
   1.136  		idAttr="";
   1.137  
   1.138 -    s=beginElement ("branch" +scrolledAttr +posAttr +linkAttr +urlAttr +vymLinkAttr +frameAttr +areaAttr +idAttr);
   1.139 +    s=beginElement ("branch" 
   1.140 +		+getOrnAttr() 
   1.141 +		+scrolledAttr 
   1.142 +		+frameAttr 
   1.143 +		+areaAttr 
   1.144 +		+idAttr 
   1.145 +		+getIncludeImageAttr() );
   1.146      incIndent();
   1.147  
   1.148  	// save heading
   1.149 @@ -1019,7 +940,7 @@
   1.150  	heading->setFont(font );
   1.151  
   1.152  	if (mod==NewBranch)
   1.153 -		setColor (((BranchObj*)(parObj))->getColor(),false);
   1.154 +		setColor (((BranchObj*)(parObj))->getColor());
   1.155  	
   1.156  	calcBBoxSize();
   1.157  }