diff -r 5115a9d93e86 -r 0e994bf2346b exports.cpp --- a/exports.cpp Wed Mar 08 12:59:07 2006 +0000 +++ b/exports.cpp Wed Mar 15 13:53:53 2006 +0000 @@ -109,6 +109,8 @@ return r + " "; } + +//////////////////////////////////////////////////////////////////////// void ExportASCII::doExport() { QFile file (outputFile); @@ -129,35 +131,58 @@ bo=mapCenter->first(); while (bo) { - // Make indentstring - for (i=0;igetDepth();i++) actIndent+= indentPerDepth; + if (!bo->hideInExport()) + { + // Make indentstring + for (i=0;igetDepth();i++) actIndent+= indentPerDepth; - if (bo->getDepth()==0) - { - ts << (bo->getHeading()+ "\n"); - for (j=0;jgetHeading().length();j++) ts<<"="; - ts << "\n"; - } else if (bo->getDepth()==1) - ts << ("\n"+getSectionString(bo) + bo->getHeading()+ "\n"); - else if (bo->getDepth()==2) - ts << (actIndent + " o " + bo->getHeading()+ "\n"); - else - ts << (actIndent + " - " + bo->getHeading()+ "\n"); - - // If necessary, write note - if (!bo->getNote().isEmpty()) - { - s =bo->getNoteASCII(); - s=s.replace ("\n","\n"+actIndent); - ts << (s+"\n\n"); + if (bo->getDepth()==0) + { + ts << (bo->getHeading()+ "\n"); + for (j=0;jgetHeading().length();j++) ts<<"="; + ts << "\n"; + } else if (bo->getDepth()==1) + ts << ("\n"+getSectionString(bo) + bo->getHeading()+ "\n"); + else if (bo->getDepth()==2) + ts << (actIndent + " o " + bo->getHeading()+ "\n"); + else + ts << (actIndent + " - " + bo->getHeading()+ "\n"); + + // If necessary, write note + if (!bo->getNote().isEmpty()) + { + s =bo->getNoteASCII(); + s=s.replace ("\n","\n"+actIndent); + ts << (s+"\n\n"); + } } - bo=bo->next(); actIndent=""; } file.close(); } +//////////////////////////////////////////////////////////////////////// +void ExportKDEBookmarks::doExport() +{ + MapEditor *me=NULL; + if (mapCenter) me=mapCenter->getMapEditor(); + if (me) + { + me->exportXML(tmpDir.path()); + //FIXME testing + cout << "tmpDir="<getMapName()+".xml"); + p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml"); + p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl"); + p.process(); + } + +} + +//////////////////////////////////////////////////////////////////////// void ExportTaskjuggler::doExport() { MapEditor *me=NULL; @@ -177,6 +202,7 @@ } +//////////////////////////////////////////////////////////////////////// void ExportLaTeX::doExport() { // Exports a map to a LaTex file. @@ -200,38 +226,40 @@ BranchObj *bo; bo=mapCenter->first(); while (bo) { - if (bo->getDepth()==0); - else if (bo->getDepth()==1) { - ts << ("\\chapter{" + bo->getHeading()+ "}\n"); + if (!bo->hideInExport()) + { + if (bo->getDepth()==0); + else if (bo->getDepth()==1) { + ts << ("\\chapter{" + 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"); + } } - 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=bo->next(); } file.close(); } +//////////////////////////////////////////////////////////////////////// ExportOO::ExportOO() { useSections=false; - skipPageFlag="cross-red"; } ExportOO::~ExportOO() @@ -251,7 +279,7 @@ r+="\n"; while (bo) { - if (!bo->isActiveFlag (skipPageFlag)) + if (!bo->hideInExport()) { r+=""; r+=quotemeta(bo->getHeading()); @@ -309,7 +337,7 @@ while (pagesBO) { // Add page with list of items - if (!pagesBO->isActiveFlag (skipPageFlag)) + if (!pagesBO->hideInExport()) { onePage=pageTemplate; onePage.replace ("", quotemeta (pagesBO->getHeading() ) );