diff -r ee6b0f3a4c2f -r 008e72977ab8 branchitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/branchitem.cpp Thu Mar 26 07:50:32 2009 +0000 @@ -0,0 +1,116 @@ +#include "branchitem.h" +#include "branchobj.h" + +#include +using namespace std; + +BranchItem::BranchItem(const QList &data, TreeItem *parent):TreeItem (data,parent) +{ + cout << "Constr. BranchItem\n"; +} + +BranchItem::~BranchItem() +{ + cout << "Destr. BranchItem\n"; + qDeleteAll(childItems); +} + +QString BranchItem::saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset) +{ + // Cloudy stuff can be hidden during exports + if (hidden) return ""; + + QString s,a; + BranchObj *bo=(BranchObj*)lmo; + + /* FIXME-1 + // Update of note is usually done while unselecting a branch + if (isNoteInEditor) getNoteFromTextEditor(); + + QString scrolledAttr; + if (scrolled) + scrolledAttr=attribut ("scrolled","yes"); + else + scrolledAttr=""; + + // save area, if not scrolled + QString areaAttr; + if (!((BranchObj*)(parObj))->isScrolled() ) + { + 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())); + + } else + areaAttr=""; + + // 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 + else + idAttr=""; + + */ + s=beginElement ("branch" + // +getOrnXMLAttr() + // +scrolledAttr + // +areaAttr + // +idAttr + // +getIncludeImageAttr() + ); + incIndent(); + + // save heading + s+=valueElement("heading", getHeading(), + attribut ("textColor",QColor( bo->getColor()).name())); + +/* + // Save frame + if (frame->getFrameType()!=FrameObj::NoFrame) + s+=frame->saveToDir (); + + // save names of flags set + s+=standardFlags->saveToDir(tmpdir,prefix,0); + + // Save FloatImages + for (int i=0; isaveToDir (tmpdir,prefix); +*/ + + // save note + if (!note.isEmpty() ) + s+=note.saveToDir(); + + // Save branches + TreeItem *ti=getFirstBranch(); + TreeItem *last=getLastBranch(); + while (ti && ti!=last) + s+=ti->saveToDir(tmpdir,prefix,offset); + + /* + // Save XLinks + QString ol; // old link + QString cl; // current link + for (int i=0; isaveToDir(); + if (cl!=ol) + { + s+=cl; + ol=cl; + } else + { + qWarning (QString("Ignoring of duplicate xLink in %1").arg(getHeading())); + } + } + */ + + decIndent(); + s+=endElement ("branch"); + return s; +} + +