diff -r 6dc0a20031f7 -r 1b4d1ea6ea8c exports.cpp --- a/exports.cpp Wed Feb 04 16:33:16 2009 +0000 +++ b/exports.cpp Fri Mar 06 15:02:58 2009 +0000 @@ -143,43 +143,47 @@ QString s; QString curIndent; int i; - TreeItem *ti; - ti=model->first(); + TreeItem *cur=NULL; + TreeItem *prev=NULL; + int d; + BranchObj *bo; - while (ti) + cur=model->next (cur,prev,d); + while (cur) { - if (ti->getType()==TreeItem::Branch || ti->getType()==TreeItem::MapCenter) + if (cur->getType()==TreeItem::Branch || cur->getType()==TreeItem::MapCenter) { - bo=(BranchObj*)(ti->getLMO()); + bo=(BranchObj*)(cur->getLMO()); + std::cout << "ExportASCII:: "<getHeading().toStdString()<depth()-1;i++) curIndent+= indentPerDepth; + for (i=0;idepth()-1;i++) curIndent+= indentPerDepth; if (!bo->hasHiddenExportParent() ) { - switch (ti->depth()) + switch (cur->depth()) { case 0: - ts << underline (ti->getHeading(),QString("=")); + ts << underline (cur->getHeading(),QString("=")); ts << "\n"; break; case 1: ts << "\n"; - ts << (underline (getSectionString(bo) + ti->getHeading(), QString("-") ) ); + ts << (underline (getSectionString(bo) + cur->getHeading(), QString("-") ) ); ts << "\n"; break; case 2: ts << "\n"; - ts << (curIndent + "* " + ti->getHeading()); + ts << (curIndent + "* " + cur->getHeading()); ts << "\n"; break; case 3: - ts << (curIndent + "- " + ti->getHeading()); + ts << (curIndent + "- " + cur->getHeading()); ts << "\n"; break; default: - ts << (curIndent + "- " + ti->getHeading()); + ts << (curIndent + "- " + cur->getHeading()); ts << "\n"; break; } @@ -193,7 +197,7 @@ } } } - ti=model->next(); + cur=model->next(cur,prev,d); } file.close(); } @@ -225,10 +229,13 @@ QString curIndent(""); int i; BranchObj *bo; - TreeItem *ti=model->first(); - while (ti) + TreeItem *cur=NULL; + TreeItem *prev=NULL; + int d; + cur=model->next (cur,prev,d); + while (cur) { - bo=(BranchObj*)(ti->getLMO()); + bo=(BranchObj*)(cur->getLMO()); if (!bo->hasHiddenExportParent() ) { @@ -242,13 +249,13 @@ ts <<"\"\","; // Make indentstring - for (i=0;idepth();i++) curIndent+= "\"\","; + for (i=0;idepth();i++) curIndent+= "\"\","; // Write heading - ts << curIndent << "\"" << ti->getHeading()<<"\""<getHeading()<<"\""<next(); + cur=model->next(cur,prev,d); curIndent=""; } file.close(); @@ -352,14 +359,17 @@ // QString curIndent(""); // int i; BranchObj *bo; - TreeItem *ti=model->first(); - while (ti) + TreeItem *cur=NULL; + TreeItem *prev=NULL; + int d; + model->next(cur,prev,d); + while (cur) { - bo=(BranchObj*)(ti->getLMO()); + bo=(BranchObj*)(cur->getLMO()); if (!bo->hasHiddenExportParent() ) { - switch (ti->depth() ) + switch (cur->depth() ) { case 0: break; case 1: @@ -384,7 +394,7 @@ ts << ("\n"); } } - ti=model->next(); + cur=model->next(cur,prev,d); } file.close(); }