1 #include "branchitem.h"
7 BranchItem::BranchItem(const QList<QVariant> &data, TreeItem *parent):TreeItem (data,parent)
9 cout << "Constr. BranchItem\n";
12 BranchItem::~BranchItem()
14 cout << "Destr. BranchItem\n";
15 qDeleteAll(childItems);
18 QString BranchItem::saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset)
20 // Cloudy stuff can be hidden during exports
21 if (hidden) return QString();
24 BranchObj *bo=(BranchObj*)lmo;
27 // Update of note is usually done while unselecting a branch
28 if (isNoteInEditor) getNoteFromTextEditor();
32 scrolledAttr=attribut ("scrolled","yes");
36 // save area, if not scrolled
38 if (!((BranchObj*)(parObj))->isScrolled() )
41 attribut("x1",QString().setNum(absPos.x()-offset.x())) +
42 attribut("y1",QString().setNum(absPos.y()-offset.y())) +
43 attribut("x2",QString().setNum(absPos.x()+width()-offset.x())) +
44 attribut("y2",QString().setNum(absPos.y()+height()-offset.y()));
49 // Providing an ID for a branch makes export to XHTML easier
52 idAttr=attribut ("id",model->getSelectString(this)); //TODO directly access model
57 s=beginElement ("branch"
62 // +getIncludeImageAttr()
67 s+=valueElement("heading", getHeading(),
68 attribut ("textColor",QColor( bo->getColor()).name()));
72 if (frame->getFrameType()!=FrameObj::NoFrame)
73 s+=frame->saveToDir ();
75 // save names of flags set
76 s+=standardFlags->saveToDir(tmpdir,prefix,0);
79 for (int i=0; i<floatimage.size(); ++i)
80 s+=floatimage.at(i)->saveToDir (tmpdir,prefix);
88 TreeItem *ti=getFirstBranch();
89 TreeItem *last=getLastBranch();
90 while (ti && ti!=last)
91 s+=ti->saveToDir(tmpdir,prefix,offset);
95 QString ol; // old link
96 QString cl; // current link
97 for (int i=0; i<xlink.size(); ++i)
99 cl=xlink.at(i)->saveToDir();
106 qWarning (QString("Ignoring of duplicate xLink in %1").arg(getHeading()));
112 s+=endElement ("branch");