diff -r c15affaf86a8 -r bdeb503d2b7f branchobj.cpp --- a/branchobj.cpp Wed Mar 08 12:59:08 2006 +0000 +++ b/branchobj.cpp Tue Mar 14 14:27:04 2006 +0000 @@ -104,9 +104,6 @@ includeImagesVer=false; includeImagesHor=false; - - url=""; - vymLink=""; } void BranchObj::copy (BranchObj* other) @@ -129,9 +126,6 @@ tmpUnscrolled=other->tmpUnscrolled; setVisibility (other->visible); - url=other->url; - vymLink=other->vymLink; - angle=other->angle; positionBBox(); @@ -400,21 +394,12 @@ LinkableMapObj::setLinkColor (); } -void BranchObj::setColor (QColor col, bool colorChilds) +void BranchObj::setColorChilds (QColor col) { - heading->setColor(col); - setLinkColor(); - if (colorChilds) - { - BranchObj *bo; - for (bo=branch.first(); bo; bo=branch.next() ) - bo->setColor(col,colorChilds); - } -} - -QColor BranchObj::getColor() -{ - return heading->getColor(); + OrnamentedObj::setColor (col); + BranchObj *bo; + for (bo=branch.first(); bo; bo=branch.next() ) + bo->setColorChilds(col); } BranchObj* BranchObj::first() @@ -711,58 +696,6 @@ requestReposition(); } -void BranchObj::setURL(QString s) -{ - url=s; - if (!url.isEmpty()) - systemFlags->activate("url"); - else - systemFlags->deactivate("url"); - calcBBoxSize(); // recalculate bbox - positionBBox(); // rearrange contents - forceReposition(); -} - -QString BranchObj::getURL() -{ - return url; -} - -void BranchObj::setVymLink(QString s) -{ - if (!s.isEmpty()) - { - // We need the relative (from loading) - // or absolute path (from User event) - // and build the absolute path. - // Note: If we have relative, use path of - // current map to build absolute path - QDir d(s); - if (!d.path().startsWith ("/")) - { - QString p=mapEditor->getDestPath(); - int i=p.findRev("/",-1); - d.setPath(p.left(i)+"/"+s); - d.convertToAbs(); - } - vymLink=d.path(); - systemFlags->activate("vymLink"); - } - else - { - systemFlags->deactivate("vymLink"); - vymLink=""; - } - calcBBoxSize(); // recalculate bbox - positionBBox(); // rearrange contents - forceReposition(); -} - -QString BranchObj::getVymLink() -{ - return vymLink; -} - QString BranchObj::saveToDir (const QString &tmpdir,const QString &prefix, const QPoint& offset) { QString s,a; @@ -772,24 +705,6 @@ else scrolledAttr=""; - QString posAttr; - if (depth<2) posAttr= - attribut("absPosX",QString().setNum(absPos.x(),10)) + - attribut("absPosY",QString().setNum(absPos.y(),10)); - else - posAttr=""; - - QString linkAttr=getLinkAttr()+" "+getIncludeImageAttr(); - - - QString urlAttr; - if (!url.isEmpty()) - urlAttr=attribut ("url",url); - - QString vymLinkAttr; - if (!vymLink.isEmpty()) - vymLinkAttr=attribut ("vymLink",convertToRel(mapEditor->getDestPath(),vymLink) ); - QString frameAttr; if (frame->getFrameType()!=NoFrame) frameAttr=attribut ("frameType",frame->getFrameTypeName()); @@ -816,7 +731,13 @@ else idAttr=""; - s=beginElement ("branch" +scrolledAttr +posAttr +linkAttr +urlAttr +vymLinkAttr +frameAttr +areaAttr +idAttr); + s=beginElement ("branch" + +getOrnAttr() + +scrolledAttr + +frameAttr + +areaAttr + +idAttr + +getIncludeImageAttr() ); incIndent(); // save heading @@ -1019,7 +940,7 @@ heading->setFont(font ); if (mod==NewBranch) - setColor (((BranchObj*)(parObj))->getColor(),false); + setColor (((BranchObj*)(parObj))->getColor()); calcBBoxSize(); }