diff -r 3d43b46a8564 -r 6dc0a20031f7 exports.cpp --- a/exports.cpp Wed Feb 04 11:52:52 2009 +0000 +++ b/exports.cpp Wed Feb 04 16:33:16 2009 +0000 @@ -143,51 +143,57 @@ QString s; QString curIndent; int i; + TreeItem *ti; + ti=model->first(); BranchObj *bo; - bo=model->first(); - while (bo) + while (ti) { - // Make indentstring - curIndent=""; - for (i=0;igetDepth()-1;i++) curIndent+= indentPerDepth; + if (ti->getType()==TreeItem::Branch || ti->getType()==TreeItem::MapCenter) + { + bo=(BranchObj*)(ti->getLMO()); - if (!bo->hasHiddenExportParent() ) - { - switch (bo->getDepth()) + // Make indentstring + curIndent=""; + for (i=0;idepth()-1;i++) curIndent+= indentPerDepth; + + if (!bo->hasHiddenExportParent() ) { - case 0: - ts << underline (bo->getHeading(),QString("=")); - ts << "\n"; - break; - case 1: - ts << "\n"; - ts << (underline (getSectionString(bo) + bo->getHeading(), QString("-") ) ); - ts << "\n"; - break; - case 2: - ts << "\n"; - ts << (curIndent + "* " + bo->getHeading()); - ts << "\n"; - break; - case 3: - ts << (curIndent + "- " + bo->getHeading()); - ts << "\n"; - break; - default: - ts << (curIndent + "- " + bo->getHeading()); - ts << "\n"; - break; - } + switch (ti->depth()) + { + case 0: + ts << underline (ti->getHeading(),QString("=")); + ts << "\n"; + break; + case 1: + ts << "\n"; + ts << (underline (getSectionString(bo) + ti->getHeading(), QString("-") ) ); + ts << "\n"; + break; + case 2: + ts << "\n"; + ts << (curIndent + "* " + ti->getHeading()); + ts << "\n"; + break; + case 3: + ts << (curIndent + "- " + ti->getHeading()); + ts << "\n"; + break; + default: + ts << (curIndent + "- " + ti->getHeading()); + ts << "\n"; + break; + } - // If necessary, write note - if (!bo->getNote().isEmpty()) - { - curIndent +=" | "; - s=bo->getNoteASCII( curIndent, 80); - ts << s; + // If necessary, write note + if (!bo->getNote().isEmpty()) + { + curIndent +=" | "; + s=bo->getNoteASCII( curIndent, 80); + ts << s; + } } } - bo=model->next(bo); + ti=model->next(); } file.close(); } @@ -219,9 +225,11 @@ QString curIndent(""); int i; BranchObj *bo; - bo=model->first(); - while (bo) + TreeItem *ti=model->first(); + while (ti) { + bo=(BranchObj*)(ti->getLMO()); + if (!bo->hasHiddenExportParent() ) { // If necessary, write note @@ -234,13 +242,13 @@ ts <<"\"\","; // Make indentstring - for (i=0;igetDepth();i++) curIndent+= "\"\","; + for (i=0;idepth();i++) curIndent+= "\"\","; // Write heading - ts << curIndent << "\"" << bo->getHeading()<<"\""<getHeading()<<"\""<next(bo); + ti=model->next(); curIndent=""; } file.close(); @@ -344,34 +352,39 @@ // QString curIndent(""); // int i; BranchObj *bo; - bo=model->first(); - while (bo) { + TreeItem *ti=model->first(); + while (ti) + { + bo=(BranchObj*)(ti->getLMO()); + if (!bo->hasHiddenExportParent() ) { - if (bo->getDepth()==0); - else if (bo->getDepth()==1) { - ts << ("\\chapter{" + bo->getHeading()+ "}\n"); + switch (ti->depth() ) + { + case 0: break; + case 1: + ts << ("\\chapter{" + bo->getHeading()+ "}\n"); + break; + case 2: + ts << ("\\section{" + bo->getHeading()+ "}\n"); + break; + case 3: + ts << ("\\subsection{" + bo->getHeading()+ "}\n"); + break; + case 4: + ts << ("\\subsubsection{" + bo->getHeading()+ "}\n"); + break; + default: + ts << ("\\paragraph*{" + bo->getHeading()+ "}\n"); + } - else if (bo->getDepth()==2) { - ts << ("\\section{" + bo->getHeading()+ "}\n"); - } - else if (bo->getDepth()==3) { - ts << ("\\subsection{" + bo->getHeading()+ "}\n"); - } - else if (bo->getDepth()==4) { - ts << ("\\subsubsection{" + bo->getHeading()+ "}\n"); - } - else { - ts << ("\\paragraph*{" + bo->getHeading()+ "}\n"); - } - // If necessary, write note if (!bo->getNote().isEmpty()) { ts << (bo->getNoteASCII()); ts << ("\n"); } } - bo=model->next(bo); + ti=model->next(); } file.close(); }