exports.cpp
changeset 605 12e4596e7bb7
parent 548 37fd6e3a38f1
child 606 84c73902f727
     1.1 --- a/exports.cpp	Wed Jul 11 13:41:38 2007 +0000
     1.2 +++ b/exports.cpp	Mon Oct 22 09:50:03 2007 +0000
     1.3 @@ -151,26 +151,29 @@
     1.4  		// Make indentstring
     1.5  		for (i=0;i<bo->getDepth();i++) actIndent+= indentPerDepth;
     1.6  
     1.7 -		if (bo->getDepth()==0)
     1.8 +		if (!bo->hasHiddenExportParent() )
     1.9  		{
    1.10 -			ts << (bo->getHeading()+ "\n");
    1.11 -			for (j=0;j<bo->getHeading().length();j++) ts<<"=";
    1.12 -			ts << "\n";
    1.13 -		} else 	if (bo->getDepth()==1)
    1.14 -			ts << ("\n"+getSectionString(bo) + bo->getHeading()+ "\n");
    1.15 -		else	if (bo->getDepth()==2)
    1.16 -			ts << (actIndent + " * " + bo->getHeading()+ "\n");
    1.17 -		else	if (bo->getDepth()==3)
    1.18 -			ts << (actIndent + " o " + bo->getHeading()+ "\n");
    1.19 -		else	
    1.20 -			ts << (actIndent + " - " + bo->getHeading()+ "\n");
    1.21 -		
    1.22 -		// If necessary, write note
    1.23 -		if (!bo->getNote().isEmpty())
    1.24 -		{
    1.25 -			s =bo->getNoteASCII();
    1.26 -			s=s.replace ("\n","\n"+actIndent);
    1.27 -			ts << (s+"\n\n");
    1.28 +			if (bo->getDepth()==0)
    1.29 +			{
    1.30 +				ts << (bo->getHeading()+ "\n");
    1.31 +				for (j=0;j<bo->getHeading().length();j++) ts<<"=";
    1.32 +				ts << "\n";
    1.33 +			} else 	if (bo->getDepth()==1)
    1.34 +				ts << ("\n"+getSectionString(bo) + bo->getHeading()+ "\n");
    1.35 +			else	if (bo->getDepth()==2)
    1.36 +				ts << (actIndent + " * " + bo->getHeading()+ "\n");
    1.37 +			else	if (bo->getDepth()==3)
    1.38 +				ts << (actIndent + " o " + bo->getHeading()+ "\n");
    1.39 +			else	
    1.40 +				ts << (actIndent + " - " + bo->getHeading()+ "\n");
    1.41 +			
    1.42 +			// If necessary, write note
    1.43 +			if (!bo->getNote().isEmpty())
    1.44 +			{
    1.45 +				s =bo->getNoteASCII();
    1.46 +				s=s.replace ("\n","\n"+actIndent);
    1.47 +				ts << (s+"\n\n");
    1.48 +			}
    1.49  		}
    1.50  		bo=bo->next();
    1.51  		actIndent="";
    1.52 @@ -201,20 +204,23 @@
    1.53  	bo=mapCenter->first();
    1.54  	while (bo) 
    1.55  	{
    1.56 -		// If necessary, write note
    1.57 -		if (!bo->getNote().isEmpty())
    1.58 +		if (!bo->hasHiddenExportParent() )
    1.59  		{
    1.60 -			s =bo->getNoteASCII();
    1.61 -			s=s.replace ("\n","\n"+actIndent);
    1.62 -			ts << ("\""+s+"\",");
    1.63 -		} else
    1.64 -			ts <<"\"\",";
    1.65 +			// If necessary, write note
    1.66 +			if (!bo->getNote().isEmpty())
    1.67 +			{
    1.68 +				s =bo->getNoteASCII();
    1.69 +				s=s.replace ("\n","\n"+actIndent);
    1.70 +				ts << ("\""+s+"\",");
    1.71 +			} else
    1.72 +				ts <<"\"\",";
    1.73  
    1.74 -		// Make indentstring
    1.75 -		for (i=0;i<bo->getDepth();i++) actIndent+= "\"\",";
    1.76 +			// Make indentstring
    1.77 +			for (i=0;i<bo->getDepth();i++) actIndent+= "\"\",";
    1.78  
    1.79 -		// Write heading
    1.80 -		ts << actIndent << "\"" << bo->getHeading()<<"\""<<endl;
    1.81 +			// Write heading
    1.82 +			ts << actIndent << "\"" << bo->getHeading()<<"\""<<endl;
    1.83 +		}
    1.84  		
    1.85  		bo=bo->next();
    1.86  		actIndent="";
    1.87 @@ -340,27 +346,30 @@
    1.88    BranchObj *bo;
    1.89    bo=mapCenter->first();
    1.90    while (bo) {
    1.91 -	if (bo->getDepth()==0);
    1.92 -	else if (bo->getDepth()==1) {
    1.93 -	  ts << ("\\chapter{" + bo->getHeading()+ "}\n");
    1.94 -	}
    1.95 -	else if (bo->getDepth()==2) {
    1.96 -	  ts << ("\\section{" + bo->getHeading()+ "}\n");
    1.97 -	}
    1.98 -	else if (bo->getDepth()==3) {
    1.99 -	  ts << ("\\subsection{" + bo->getHeading()+ "}\n");
   1.100 -	}
   1.101 -	else if (bo->getDepth()==4) {
   1.102 -	  ts << ("\\subsubsection{" + bo->getHeading()+ "}\n");
   1.103 -	}
   1.104 -	else {
   1.105 -	  ts << ("\\paragraph*{" + bo->getHeading()+ "}\n");
   1.106 -	}
   1.107 -	
   1.108 -	// If necessary, write note
   1.109 -	if (!bo->getNote().isEmpty()) {
   1.110 -	  ts << (bo->getNoteASCII());
   1.111 -	  ts << ("\n");
   1.112 +	if (!bo->hasHiddenExportParent() )
   1.113 +	{
   1.114 +		if (bo->getDepth()==0);
   1.115 +		else if (bo->getDepth()==1) {
   1.116 +		  ts << ("\\chapter{" + bo->getHeading()+ "}\n");
   1.117 +		}
   1.118 +		else if (bo->getDepth()==2) {
   1.119 +		  ts << ("\\section{" + bo->getHeading()+ "}\n");
   1.120 +		}
   1.121 +		else if (bo->getDepth()==3) {
   1.122 +		  ts << ("\\subsection{" + bo->getHeading()+ "}\n");
   1.123 +		}
   1.124 +		else if (bo->getDepth()==4) {
   1.125 +		  ts << ("\\subsubsection{" + bo->getHeading()+ "}\n");
   1.126 +		}
   1.127 +		else {
   1.128 +		  ts << ("\\paragraph*{" + bo->getHeading()+ "}\n");
   1.129 +		}
   1.130 +		
   1.131 +		// If necessary, write note
   1.132 +		if (!bo->getNote().isEmpty()) {
   1.133 +		  ts << (bo->getNoteASCII());
   1.134 +		  ts << ("\n");
   1.135 +		}
   1.136  	}
   1.137      bo=bo->next();
   1.138     }
   1.139 @@ -386,22 +395,25 @@
   1.140      bo=current->getFirstBranch();
   1.141      if (bo)
   1.142      {
   1.143 -        // Start list
   1.144 -        r+="<text:list text:style-name=\"vym-list\">\n";
   1.145 -        while (bo)
   1.146 -        {
   1.147 -			r+="<text:list-item><text:p >";
   1.148 -			r+=quotemeta(bo->getHeading());
   1.149 -			// If necessary, write note
   1.150 -			if (!bo->getNote().isEmpty())
   1.151 -				r+=bo->getNoteOpenDoc();
   1.152 -			r+="</text:p>";
   1.153 -			r+=buildList (bo);	// recursivly add deeper branches
   1.154 -			r+="</text:list-item>\n";
   1.155 -			i++;
   1.156 -			bo=current->getBranchNum(i);
   1.157 -        }
   1.158 -        r+="</text:list>\n";
   1.159 +		if (!bo->hasHiddenExportParent() )
   1.160 +		{
   1.161 +			// Start list
   1.162 +			r+="<text:list text:style-name=\"vym-list\">\n";
   1.163 +			while (bo)
   1.164 +			{
   1.165 +				r+="<text:list-item><text:p >";
   1.166 +				r+=quotemeta(bo->getHeading());
   1.167 +				// If necessary, write note
   1.168 +				if (!bo->getNote().isEmpty())
   1.169 +					r+=bo->getNoteOpenDoc();
   1.170 +				r+="</text:p>";
   1.171 +				r+=buildList (bo);	// recursivly add deeper branches
   1.172 +				r+="</text:list-item>\n";
   1.173 +				i++;
   1.174 +				bo=current->getBranchNum(i);
   1.175 +			}
   1.176 +			r+="</text:list>\n";
   1.177 +		}
   1.178      }
   1.179      return r;
   1.180  }
   1.181 @@ -424,7 +436,7 @@
   1.182      int j=0;
   1.183  
   1.184  	// Walk sections
   1.185 -	while (sectionBO)
   1.186 +	while (sectionBO && !sectionBO->hasHiddenExportParent() )
   1.187  	{
   1.188  		if (useSections)
   1.189  		{
   1.190 @@ -442,7 +454,7 @@
   1.191  		// Walk mainpages
   1.192  		pagesBO=sectionBO->getFirstBranch();
   1.193  		j=0;
   1.194 -		while (pagesBO)
   1.195 +		while (pagesBO && !pagesBO->hasHiddenExportParent() )
   1.196  		{
   1.197  			// Add page with list of items
   1.198  			onePage=pageTemplate;