1 #include "mapcenteritem.h"
2 #include "mapcenterobj.h"
7 MapCenterItem::MapCenterItem(const QList<QVariant> &data, TreeItem *parent):BranchItem (data,parent)
13 MapCenterItem::~MapCenterItem()
15 cout << "Destr. MapCenterItem\n";
16 qDeleteAll(childItems);
19 QString MapCenterItem::saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset)
21 // Cloudy stuff can be hidden during exports
22 if (hidden) return QString();
25 BranchObj *bo=(BranchObj*)lmo;
28 // Update of note is usually done while unselecting a branch
29 if (isNoteInEditor) getNoteFromTextEditor();
33 scrolledAttr=attribut ("scrolled","yes");
37 // save area, if not scrolled
39 if (!((BranchObj*)(parObj))->isScrolled() )
42 attribut("x1",QString().setNum(absPos.x()-offset.x())) +
43 attribut("y1",QString().setNum(absPos.y()-offset.y())) +
44 attribut("x2",QString().setNum(absPos.x()+width()-offset.x())) +
45 attribut("y2",QString().setNum(absPos.y()+height()-offset.y()));
50 // Providing an ID for a branch makes export to XHTML easier
53 idAttr=attribut ("id",model->getSelectString(this)); //TODO directly access model
58 s=beginElement ("branch"
63 // +getIncludeImageAttr()
68 s+=valueElement("heading", getHeading(),
69 attribut ("textColor",QColor( bo->getColor()).name()));
73 if (frame->getFrameType()!=FrameObj::NoFrame)
74 s+=frame->saveToDir ();
76 // save names of flags set
77 s+=standardFlags->saveToDir(tmpdir,prefix,0);
80 for (int i=0; i<floatimage.size(); ++i)
81 s+=floatimage.at(i)->saveToDir (tmpdir,prefix);
89 TreeItem *ti=getFirstBranch();
90 TreeItem *last=getLastBranch();
91 while (ti && ti!=last)
92 s+=ti->saveToDir(tmpdir,prefix,offset);
96 QString ol; // old link
97 QString cl; // current link
98 for (int i=0; i<xlink.size(); ++i)
100 cl=xlink.at(i)->saveToDir();
107 qWarning (QString("Ignoring of duplicate xLink in %1").arg(getHeading()));
113 s+=endElement ("branch");