diff -r 2f002657dada -r 6e4b586aa88a branchitem.cpp --- a/branchitem.cpp Tue May 26 11:24:51 2009 +0000 +++ b/branchitem.cpp Wed Jun 03 20:37:17 2009 +0000 @@ -61,22 +61,24 @@ else scrolledAttr=""; - /* - // save area, if not scrolled // FIXME-3 not needed if HTML is rewritten... + // save area, if not scrolled // FIXME-5 not needed if HTML is rewritten... // also we should check if _any_ of parents is scrolled QString areaAttr; - if (!((BranchObj*)(parObj))->isScrolled() ) + if (lmo && parentItem->isBranchLikeType() && !((BranchItem*)parentItem)->isScrolled() ) { + qreal x=lmo->getAbsPos().x(); + qreal y=lmo->getAbsPos().y(); areaAttr= - attribut("x1",QString().setNum(absPos.x()-offset.x())) + - attribut("y1",QString().setNum(absPos.y()-offset.y())) + - attribut("x2",QString().setNum(absPos.x()+width()-offset.x())) + - attribut("y2",QString().setNum(absPos.y()+height()-offset.y())); + attribut("x1",QString().setNum(x-offset.x())) + + attribut("y1",QString().setNum(y-offset.y())) + + attribut("x2",QString().setNum(x+lmo->width()-offset.x())) + + attribut("y2",QString().setNum(y+lmo->height()-offset.y())); } else areaAttr=""; - // Providing an ID for a branch makes export to XHTML easier + /* + // FIXME-3 Providing an ID for a branch makes export to XHTML easier QString idAttr; if (countXLinks()>0) idAttr=attribut ("id",model->getSelectString(this)); //TODO directly access model @@ -104,8 +106,8 @@ s+=valueElement("heading", getHeading(), attribut ("textColor",QColor( bo->getColor()).name())); -/* - // Save frame +/* + // Save frame //FIXME-2 if (frame->getFrameType()!=FrameObj::NoFrame) s+=frame->saveToDir (); */ @@ -255,7 +257,7 @@ if (this !=start && scrolled) return true; BranchItem* bi=(BranchItem*)parentItem; - if (bi) + if (bi && bi->isBranchLikeType() ) return bi->hasScrolledParent(start); else return false; @@ -264,30 +266,32 @@ void BranchItem::tmpUnscroll() { // Unscroll parent (recursivly) - BranchItem * bi=(BranchItem*)parentItem; - if (bi) bi->tmpUnscroll(); + BranchItem * pi=(BranchItem*)parentItem; + if (pi && pi->isBranchLikeType() ) pi->tmpUnscroll(); // Unscroll myself if (scrolled) { tmpUnscrolled=true; - // FIXME-1 systemFlags->activate("tmpUnscrolledright"); + systemFlags.activate("system-tmpUnscrolledRight"); toggleScroll(); + model->emitDataHasChanged (this); } } void BranchItem::resetTmpUnscroll() { // Unscroll parent (recursivly) - BranchItem * bi=(BranchItem*)parentItem; - if (bi) bi->resetTmpUnscroll(); + BranchItem * pi=(BranchItem*)parentItem; + if (pi && pi->isBranchLikeType() ) pi->resetTmpUnscroll(); // Unscroll myself if (tmpUnscrolled) { tmpUnscrolled=false; - // FIXME-1 systemFlags->deactivate("tmpUnscrolledright"); + systemFlags.deactivate("system-tmpUnscrolledRight"); toggleScroll(); + model->emitDataHasChanged (this); } } @@ -361,51 +365,29 @@ BranchObj* BranchItem::createMapObj(QGraphicsScene *scene) { BranchObj *newbo; - cout << "BI::createMO "<setParObj(NULL); - newbo->setTreeItem (this); - newbo->setDefAttr(BranchObj::NewBranch); + newbo->setFrameType (FrameObj::Rectangle); } else { - // Initialize BranchObj, order of things is important... - cout << "BI::createMO (BO) "<getLMO()); - newbo->setParObj(parbo); - newbo->setTreeItem (this); - newbo->setDefAttr(BranchObj::NewBranch); - - if (parentItem->isBranchLikeType()) - { - // Set visibility depending on parents - if (((BranchItem*)parentItem)->scrolled || !parbo->isVisibleObj() ) - { - if (parentItem && parentItem->isBranchLikeType()) - cout <<" scrolled="<<((BranchItem*)parentItem)->scrolled<vis="<isVisibleObj()<setVisibility (false); - } - } else - cout <<" pI=no branch!\n"; - + newbo->setParObj(parentItem->getLMO() ); + // Set visibility depending on parents + if (((BranchItem*)parentItem)->scrolled || !parentItem->getLMO()->isVisibleObj() ) + newbo->setVisibility (false); } + newbo->setDefAttr(BranchObj::NewBranch); initLMO(); if (!getHeading().isEmpty() ) { - ((BranchObj*)lmo)->updateData(); //FIXME-3 maybe better model->emitDataHasChanged()? - ((BranchObj*)lmo)->setColor (headingColor); + newbo->updateData(); //FIXME-3 maybe better model->emitDataHasChanged()? + newbo->setColor (headingColor); } - //newbo->updateLink(); //FIXME-3