diff -r edb78a44240b -r 9ff332964015 mapcenteritem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mapcenteritem.cpp Wed Apr 01 15:06:57 2009 +0000 @@ -0,0 +1,118 @@ +#include "mapcenteritem.h" +#include "mapcenterobj.h" + +#include +using namespace std; + +MapCenterItem::MapCenterItem(const QList &data, TreeItem *parent):BranchItem (data,parent) +{ + scrolled=false; + tmpUnscrolled=false; +} + +MapCenterItem::~MapCenterItem() +{ + cout << "Destr. MapCenterItem\n"; + qDeleteAll(childItems); +} + +QString MapCenterItem::saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset) +{ + // Cloudy stuff can be hidden during exports + if (hidden) return QString(); + + 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; +} + + +