exports.cpp
changeset 847 43268373032d
parent 844 c48bb42fb977
     1.1 --- a/exports.cpp	Fri Apr 09 14:24:04 2010 +0000
     1.2 +++ b/exports.cpp	Wed Jun 09 13:14:08 2010 +0000
     1.3 @@ -156,6 +156,8 @@
     1.4  	// Main loop over all branches
     1.5  	QString s;
     1.6  	QString curIndent;
     1.7 +	QString dashIndent;
     1.8 +
     1.9  	int i;
    1.10  	BranchItem *cur=NULL;
    1.11  	BranchItem *prev=NULL;
    1.12 @@ -183,6 +185,8 @@
    1.13  					colString="[G]";
    1.14  				else  	
    1.15  					colString="[?]";
    1.16 +
    1.17 +				dashIndent="";	
    1.18  				switch (cur->depth())
    1.19  				{
    1.20  					case 0:
    1.21 @@ -218,9 +222,14 @@
    1.22  					default:
    1.23  						ts << (curIndent + "- " + cur->getHeading());
    1.24  						ts << "\n";
    1.25 +						dashIndent="  ";
    1.26  						break;
    1.27  				}
    1.28  
    1.29 +				// If necessary, write URL
    1.30 +				if (!cur->getURL().isEmpty())
    1.31 +					ts << (curIndent + dashIndent + cur->getURL()) +"\n";
    1.32 +
    1.33  				// If necessary, write note
    1.34  				if (!cur->getNoteObj().isEmpty())
    1.35  				{
    1.36 @@ -263,6 +272,7 @@
    1.37  	// Main loop over all branches
    1.38  	QString s;
    1.39  	QString curIndent;
    1.40 +	QString dashIndent;
    1.41  	int i;
    1.42  	BranchItem *cur=NULL;
    1.43  	BranchItem *prev=NULL;
    1.44 @@ -279,6 +289,8 @@
    1.45  			if (!cur->hasHiddenExportParent() )
    1.46  			{
    1.47  				//std::cout << "ExportASCII::  "<<curIndent.toStdString()<<cur->getHeading().toStdString()<<std::endl;
    1.48 +
    1.49 +				dashIndent="";
    1.50  				switch (cur->depth())
    1.51  				{
    1.52  					case 0:
    1.53 @@ -294,17 +306,24 @@
    1.54  						ts << "\n";
    1.55  						ts << (curIndent + "* " + cur->getHeading());
    1.56  						ts << "\n";
    1.57 +						dashIndent="  ";
    1.58  						break;
    1.59  					case 3:
    1.60  						ts << (curIndent + "- " + cur->getHeading());
    1.61  						ts << "\n";
    1.62 +						dashIndent="  ";
    1.63  						break;
    1.64  					default:
    1.65  						ts << (curIndent + "- " + cur->getHeading());
    1.66  						ts << "\n";
    1.67 +						dashIndent="  ";
    1.68  						break;
    1.69  				}
    1.70  
    1.71 +				// If necessary, write URL
    1.72 +				if (!cur->getURL().isEmpty())
    1.73 +					ts << (curIndent + dashIndent + cur->getURL()) +"\n";
    1.74 +
    1.75  				// If necessary, write note
    1.76  				if (!cur->getNoteObj().isEmpty())
    1.77  				{
    1.78 @@ -512,10 +531,11 @@
    1.79  			.arg(col)
    1.80  			.arg(id);
    1.81  		QString url=current->getURL();	
    1.82 +		QString heading=quotemeta(current->getHeading());
    1.83  		if (!url.isEmpty())
    1.84  		{
    1.85  			s+=QString ("<a href=\"%1\">").arg(url);
    1.86 -			s+=QString ("<img src=\"flags/flag-url-16x16.png\">%1</a>").arg(quotemeta(current->getHeading()));
    1.87 +			s+=QString ("<img src=\"flags/flag-url-16x16.png\">%1</a>").arg(heading);
    1.88  			s+="</a>";
    1.89  			
    1.90  			QRectF fbox=current->getBBoxURLFlag ();
    1.91 @@ -664,7 +684,9 @@
    1.92  	model->setExportMode (true);
    1.93  
    1.94  	// Write header
    1.95 -	ts<<"<html><title>"+model->getMapName()<<"</title><body>";
    1.96 +	ts<<"<html>";
    1.97 +	ts<<"<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"> ";
    1.98 +	ts<<"<title>"+model->getMapName()<<"</title><body>";
    1.99  	ts<<" <link rel='stylesheet' id='css.stylesheet' href='"<<cssFileName<<"' />\n";
   1.100  
   1.101  	// Include image