hideLinkInExport for Branches (Floats still missing). Floats are now OrnamentedObj.
authorinsilmaril
Tue, 14 Mar 2006 14:27:04 +0000
changeset 239bdeb503d2b7f
parent 238 c15affaf86a8
child 240 bcfd5aad58d6
hideLinkInExport for Branches (Floats still missing). Floats are now OrnamentedObj.
branchobj.cpp
branchobj.h
exports.cpp
exports.h
exportxhtmldialog.ui.h
mapcenterobj.cpp
xml.cpp
xml.h
     1.1 --- a/branchobj.cpp	Wed Mar 08 12:59:08 2006 +0000
     1.2 +++ b/branchobj.cpp	Tue Mar 14 14:27:04 2006 +0000
     1.3 @@ -104,9 +104,6 @@
     1.4  
     1.5  	includeImagesVer=false;
     1.6  	includeImagesHor=false;
     1.7 -
     1.8 -	url="";
     1.9 -	vymLink="";
    1.10  }
    1.11  
    1.12  void BranchObj::copy (BranchObj* other)
    1.13 @@ -129,9 +126,6 @@
    1.14  	tmpUnscrolled=other->tmpUnscrolled;
    1.15  	setVisibility (other->visible);
    1.16  
    1.17 -	url=other->url;
    1.18 -	vymLink=other->vymLink;
    1.19 -
    1.20  	angle=other->angle;
    1.21  
    1.22      positionBBox();
    1.23 @@ -400,21 +394,12 @@
    1.24  			LinkableMapObj::setLinkColor ();
    1.25  }
    1.26  
    1.27 -void BranchObj::setColor (QColor col, bool colorChilds)
    1.28 +void BranchObj::setColorChilds (QColor col)
    1.29  {
    1.30 -    heading->setColor(col);
    1.31 -	setLinkColor();
    1.32 -    if (colorChilds) 
    1.33 -    {
    1.34 -		BranchObj *bo;
    1.35 -		for (bo=branch.first(); bo; bo=branch.next() )
    1.36 -			bo->setColor(col,colorChilds);
    1.37 -    }	
    1.38 -}
    1.39 -
    1.40 -QColor BranchObj::getColor()
    1.41 -{
    1.42 -	return heading->getColor();
    1.43 +	OrnamentedObj::setColor (col);
    1.44 +	BranchObj *bo;
    1.45 +	for (bo=branch.first(); bo; bo=branch.next() )
    1.46 +		bo->setColorChilds(col);
    1.47  }
    1.48  
    1.49  BranchObj* BranchObj::first()
    1.50 @@ -711,58 +696,6 @@
    1.51  	requestReposition();
    1.52  }
    1.53  
    1.54 -void BranchObj::setURL(QString s)
    1.55 -{
    1.56 -	url=s;
    1.57 -	if (!url.isEmpty())
    1.58 -		systemFlags->activate("url");
    1.59 -	else	
    1.60 -		systemFlags->deactivate("url");
    1.61 -	calcBBoxSize();			// recalculate bbox
    1.62 -    positionBBox();			// rearrange contents
    1.63 -	forceReposition();
    1.64 -}
    1.65 -
    1.66 -QString BranchObj::getURL()
    1.67 -{
    1.68 -	return url;
    1.69 -}
    1.70 -
    1.71 -void BranchObj::setVymLink(QString s)
    1.72 -{
    1.73 -	if (!s.isEmpty())
    1.74 -	{
    1.75 -		// We need the relative (from loading) 
    1.76 -		// or absolute path (from User event)
    1.77 -		// and build the absolute path.
    1.78 -		// Note: If we have relative, use path of
    1.79 -		// current map to build absolute path
    1.80 -		QDir d(s);
    1.81 -		if (!d.path().startsWith ("/"))
    1.82 -		{
    1.83 -			QString p=mapEditor->getDestPath();
    1.84 -			int i=p.findRev("/",-1);
    1.85 -			d.setPath(p.left(i)+"/"+s);
    1.86 -			d.convertToAbs();
    1.87 -		}
    1.88 -		vymLink=d.path();
    1.89 -		systemFlags->activate("vymLink");
    1.90 -	}	
    1.91 -	else	
    1.92 -	{
    1.93 -		systemFlags->deactivate("vymLink");
    1.94 -		vymLink="";
    1.95 -	}	
    1.96 -	calcBBoxSize();			// recalculate bbox
    1.97 -    positionBBox();			// rearrange contents
    1.98 -	forceReposition();
    1.99 -}
   1.100 -
   1.101 -QString BranchObj::getVymLink()
   1.102 -{
   1.103 -	return vymLink;
   1.104 -}
   1.105 -
   1.106  QString BranchObj::saveToDir (const QString &tmpdir,const QString &prefix, const QPoint& offset)
   1.107  {
   1.108      QString s,a;
   1.109 @@ -772,24 +705,6 @@
   1.110  	else
   1.111  		scrolledAttr="";
   1.112  
   1.113 -	QString posAttr;
   1.114 -	if (depth<2) posAttr=
   1.115 -		attribut("absPosX",QString().setNum(absPos.x(),10)) +
   1.116 -		attribut("absPosY",QString().setNum(absPos.y(),10)); 
   1.117 -	else
   1.118 -		posAttr="";
   1.119 -
   1.120 -	QString linkAttr=getLinkAttr()+" "+getIncludeImageAttr();
   1.121 -	
   1.122 -
   1.123 -	QString urlAttr;
   1.124 -	if (!url.isEmpty())
   1.125 -		urlAttr=attribut ("url",url);
   1.126 -
   1.127 -	QString vymLinkAttr;
   1.128 -	if (!vymLink.isEmpty())
   1.129 -		vymLinkAttr=attribut ("vymLink",convertToRel(mapEditor->getDestPath(),vymLink) );
   1.130 -
   1.131  	QString frameAttr;
   1.132  	if (frame->getFrameType()!=NoFrame)
   1.133  		frameAttr=attribut ("frameType",frame->getFrameTypeName());
   1.134 @@ -816,7 +731,13 @@
   1.135  	else
   1.136  		idAttr="";
   1.137  
   1.138 -    s=beginElement ("branch" +scrolledAttr +posAttr +linkAttr +urlAttr +vymLinkAttr +frameAttr +areaAttr +idAttr);
   1.139 +    s=beginElement ("branch" 
   1.140 +		+getOrnAttr() 
   1.141 +		+scrolledAttr 
   1.142 +		+frameAttr 
   1.143 +		+areaAttr 
   1.144 +		+idAttr 
   1.145 +		+getIncludeImageAttr() );
   1.146      incIndent();
   1.147  
   1.148  	// save heading
   1.149 @@ -1019,7 +940,7 @@
   1.150  	heading->setFont(font );
   1.151  
   1.152  	if (mod==NewBranch)
   1.153 -		setColor (((BranchObj*)(parObj))->getColor(),false);
   1.154 +		setColor (((BranchObj*)(parObj))->getColor());
   1.155  	
   1.156  	calcBBoxSize();
   1.157  }
     2.1 --- a/branchobj.h	Wed Mar 08 12:59:08 2006 +0000
     2.2 +++ b/branchobj.h	Tue Mar 14 14:27:04 2006 +0000
     2.3 @@ -44,9 +44,7 @@
     2.4  	virtual void setVisibility(bool,int);	// set visibility
     2.5      virtual void setVisibility(bool);	    // set vis. for w
     2.6  	virtual void setLinkColor();			// set the color of link
     2.7 -	virtual void setColor(QColor,bool);		// set the color of heading
     2.8 -	virtual QColor getColor();				// get color of heading
     2.9 -
    2.10 +	virtual void setColorChilds(QColor);			// set the color of heading
    2.11  
    2.12  	BranchObj* first ();				// set Iterator to first LMO
    2.13  	BranchObj* next ();					// find next LMO after given one
    2.14 @@ -62,10 +60,6 @@
    2.15  	virtual void setDockPos();
    2.16      virtual LinkableMapObj* findMapObj(QPoint,LinkableMapObj*);	// find MapObj 
    2.17      virtual void setHeading (QString);
    2.18 -    virtual void setURL (QString);
    2.19 -    virtual QString getURL ();
    2.20 -    virtual void setVymLink (QString);
    2.21 -    virtual QString getVymLink ();
    2.22  	virtual QString saveToDir (const QString&,const QString&, const QPoint&);// Save data recursivly to tempdir
    2.23  	virtual void addXLink (XLinkObj*);
    2.24  	virtual void removeXLinkRef (XLinkObj*);// Remove ref in list
    2.25 @@ -129,8 +123,6 @@
    2.26      int lastSelectedBranch;			// for going deeper into tree
    2.27  	bool scrolled;					// true if all childs are scrolled and thus invisible
    2.28  	bool tmpUnscrolled;				// can only be true (temporary) for a scrolled subtree
    2.29 -	QString url;					// url to external doc
    2.30 -	QString vymLink;				// path to another map
    2.31  	bool includeImagesVer;			// include floatimages in bbox vertically
    2.32  	bool includeImagesHor;			// include floatimages in bbox horizontally
    2.33  
     3.1 --- a/exports.cpp	Wed Mar 08 12:59:08 2006 +0000
     3.2 +++ b/exports.cpp	Tue Mar 14 14:27:04 2006 +0000
     3.3 @@ -109,6 +109,8 @@
     3.4  		return r + " ";
     3.5  }
     3.6  
     3.7 +
     3.8 +////////////////////////////////////////////////////////////////////////
     3.9  void ExportASCII::doExport()
    3.10  {
    3.11  	QFile file (outputFile);
    3.12 @@ -129,35 +131,58 @@
    3.13  	bo=mapCenter->first();
    3.14  	while (bo) 
    3.15  	{
    3.16 -		// Make indentstring
    3.17 -		for (i=0;i<bo->getDepth();i++) actIndent+= indentPerDepth;
    3.18 +		if (!bo->hideInExport())
    3.19 +		{
    3.20 +			// Make indentstring
    3.21 +			for (i=0;i<bo->getDepth();i++) actIndent+= indentPerDepth;
    3.22  
    3.23 -		if (bo->getDepth()==0)
    3.24 -		{
    3.25 -			ts << (bo->getHeading()+ "\n");
    3.26 -			for (j=0;j<bo->getHeading().length();j++) ts<<"=";
    3.27 -			ts << "\n";
    3.28 -		} else 	if (bo->getDepth()==1)
    3.29 -			ts << ("\n"+getSectionString(bo) + bo->getHeading()+ "\n");
    3.30 -		else	if (bo->getDepth()==2)
    3.31 -			ts << (actIndent + " o " + bo->getHeading()+ "\n");
    3.32 -		else	
    3.33 -			ts << (actIndent + " - " + bo->getHeading()+ "\n");
    3.34 -		
    3.35 -		// If necessary, write note
    3.36 -		if (!bo->getNote().isEmpty())
    3.37 -		{
    3.38 -			s =bo->getNoteASCII();
    3.39 -			s=s.replace ("\n","\n"+actIndent);
    3.40 -			ts << (s+"\n\n");
    3.41 +			if (bo->getDepth()==0)
    3.42 +			{
    3.43 +				ts << (bo->getHeading()+ "\n");
    3.44 +				for (j=0;j<bo->getHeading().length();j++) ts<<"=";
    3.45 +				ts << "\n";
    3.46 +			} else 	if (bo->getDepth()==1)
    3.47 +				ts << ("\n"+getSectionString(bo) + bo->getHeading()+ "\n");
    3.48 +			else	if (bo->getDepth()==2)
    3.49 +				ts << (actIndent + " o " + bo->getHeading()+ "\n");
    3.50 +			else	
    3.51 +				ts << (actIndent + " - " + bo->getHeading()+ "\n");
    3.52 +			
    3.53 +			// If necessary, write note
    3.54 +			if (!bo->getNote().isEmpty())
    3.55 +			{
    3.56 +				s =bo->getNoteASCII();
    3.57 +				s=s.replace ("\n","\n"+actIndent);
    3.58 +				ts << (s+"\n\n");
    3.59 +			}
    3.60  		}
    3.61 -		
    3.62  		bo=bo->next();
    3.63  		actIndent="";
    3.64  	}
    3.65  	file.close();
    3.66  }
    3.67  
    3.68 +////////////////////////////////////////////////////////////////////////
    3.69 +void ExportKDEBookmarks::doExport() 
    3.70 +{
    3.71 +	MapEditor *me=NULL;
    3.72 +	if (mapCenter) me=mapCenter->getMapEditor();
    3.73 +	if (me)
    3.74 +	{
    3.75 +		me->exportXML(tmpDir.path());
    3.76 +		//FIXME testing
    3.77 +		cout << "tmpDir="<<tmpDir.path()<<endl;
    3.78 +
    3.79 +		XSLTProc p;
    3.80 +		p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml");
    3.81 +		p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml");
    3.82 +		p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl");
    3.83 +		p.process();
    3.84 +	}
    3.85 +
    3.86 +}
    3.87 +
    3.88 +////////////////////////////////////////////////////////////////////////
    3.89  void ExportTaskjuggler::doExport() 
    3.90  {
    3.91  	MapEditor *me=NULL;
    3.92 @@ -177,6 +202,7 @@
    3.93  
    3.94  }
    3.95  
    3.96 +////////////////////////////////////////////////////////////////////////
    3.97  void ExportLaTeX::doExport() 
    3.98  {
    3.99  	// Exports a map to a LaTex file.  
   3.100 @@ -200,38 +226,40 @@
   3.101    BranchObj *bo;
   3.102    bo=mapCenter->first();
   3.103    while (bo) {
   3.104 -    if (bo->getDepth()==0);
   3.105 -    else if (bo->getDepth()==1) {
   3.106 -      ts << ("\\chapter{" + bo->getHeading()+ "}\n");
   3.107 +	if (!bo->hideInExport())
   3.108 +	{
   3.109 +		if (bo->getDepth()==0);
   3.110 +		else if (bo->getDepth()==1) {
   3.111 +		  ts << ("\\chapter{" + bo->getHeading()+ "}\n");
   3.112 +		}
   3.113 +		else if (bo->getDepth()==2) {
   3.114 +		  ts << ("\\section{" + bo->getHeading()+ "}\n");
   3.115 +		}
   3.116 +		else if (bo->getDepth()==3) {
   3.117 +		  ts << ("\\subsection{" + bo->getHeading()+ "}\n");
   3.118 +		}
   3.119 +		else if (bo->getDepth()==4) {
   3.120 +		  ts << ("\\subsubsection{" + bo->getHeading()+ "}\n");
   3.121 +		}
   3.122 +		else {
   3.123 +		  ts << ("\\paragraph*{" + bo->getHeading()+ "}\n");
   3.124 +		}
   3.125 +		
   3.126 +		// If necessary, write note
   3.127 +		if (!bo->getNote().isEmpty()) {
   3.128 +		  ts << (bo->getNoteASCII());
   3.129 +		  ts << ("\n");
   3.130 +		}
   3.131      }
   3.132 -    else if (bo->getDepth()==2) {
   3.133 -      ts << ("\\section{" + bo->getHeading()+ "}\n");
   3.134 -    }
   3.135 -    else if (bo->getDepth()==3) {
   3.136 -      ts << ("\\subsection{" + bo->getHeading()+ "}\n");
   3.137 -    }
   3.138 -    else if (bo->getDepth()==4) {
   3.139 -      ts << ("\\subsubsection{" + bo->getHeading()+ "}\n");
   3.140 -    }
   3.141 -    else {
   3.142 -      ts << ("\\paragraph*{" + bo->getHeading()+ "}\n");
   3.143 -    }
   3.144 -    
   3.145 -    // If necessary, write note
   3.146 -    if (!bo->getNote().isEmpty()) {
   3.147 -      ts << (bo->getNoteASCII());
   3.148 -      ts << ("\n");
   3.149 -    }
   3.150 -    
   3.151      bo=bo->next();
   3.152     }
   3.153    file.close();
   3.154  }
   3.155  
   3.156 +////////////////////////////////////////////////////////////////////////
   3.157  ExportOO::ExportOO()
   3.158  {
   3.159  	useSections=false;
   3.160 -	skipPageFlag="cross-red";
   3.161  }
   3.162  
   3.163  ExportOO::~ExportOO()
   3.164 @@ -251,7 +279,7 @@
   3.165          r+="<text:list text:style-name=\"vym-list\">\n";
   3.166          while (bo)
   3.167          {
   3.168 -			if (!bo->isActiveFlag (skipPageFlag))
   3.169 +			if (!bo->hideInExport())
   3.170  			{
   3.171  				r+="<text:list-item><text:p >";
   3.172  				r+=quotemeta(bo->getHeading());
   3.173 @@ -309,7 +337,7 @@
   3.174  		while (pagesBO)
   3.175  		{
   3.176  			// Add page with list of items
   3.177 -			if (!pagesBO->isActiveFlag (skipPageFlag))
   3.178 +			if (!pagesBO->hideInExport())
   3.179  			{
   3.180  				onePage=pageTemplate;
   3.181  				onePage.replace ("<!-- INSERT PAGE HEADING -->", quotemeta (pagesBO->getHeading() ) );
     4.1 --- a/exports.h	Wed Mar 08 12:59:08 2006 +0000
     4.2 +++ b/exports.h	Tue Mar 14 14:27:04 2006 +0000
     4.3 @@ -46,6 +46,13 @@
     4.4  };
     4.5  
     4.6  ///////////////////////////////////////////////////////////////////////
     4.7 +class ExportKDEBookmarks:public ExportXMLBase
     4.8 +{
     4.9 +public:
    4.10 +	virtual void doExport();
    4.11 +};	
    4.12 +
    4.13 +///////////////////////////////////////////////////////////////////////
    4.14  class ExportTaskjuggler:public ExportXMLBase
    4.15  {
    4.16  public:
    4.17 @@ -69,7 +76,6 @@
    4.18  	bool setConfigFile (const QString &);
    4.19  private:
    4.20  	QString buildList (BranchObj*);
    4.21 -	QString skipPageFlag;
    4.22  	bool useSections;
    4.23  	QString configFile;
    4.24  	QString configDir;
     5.1 --- a/exportxhtmldialog.ui.h	Wed Mar 08 12:59:08 2006 +0000
     5.2 +++ b/exportxhtmldialog.ui.h	Tue Mar 14 14:27:04 2006 +0000
     5.3 @@ -9,6 +9,8 @@
     5.4  
     5.5  
     5.6  extern Settings settings;
     5.7 +extern QDir vymBaseDir;
     5.8 +extern Options options;
     5.9  
    5.10  void ExportXHTMLDialog::init()
    5.11  {
    5.12 @@ -23,7 +25,6 @@
    5.13  	dir=settings.readLocalEntry (filepath,"/vym/export/xhtml/exportDir","./" );
    5.14  	lineEditDir->setText(dir);
    5.15  	
    5.16 -	
    5.17      if ( settings.readLocalEntry (filepath,"/vym/export/xhtml/useImage","yes")=="yes")
    5.18  		useImage=true;
    5.19  	else	
    5.20 @@ -62,12 +63,19 @@
    5.21  		showOutput=false;
    5.22  	outputButton->setChecked(showOutput);
    5.23  
    5.24 -	xsl=settings.readLocalEntry 
    5.25 -		(filepath,"/vym/export/xhtml/xsl","/usr/share/vym/styles/vym2xhtml.xsl");
    5.26 +	// For testing better use local styles
    5.27 +	if (options.isOn ("local"))
    5.28 +	{
    5.29 +		xsl=vymBaseDir.path()+"/styles/vym2xhtml.xsl";
    5.30 +		css=vymBaseDir.path()+"/styles/vym.css";
    5.31 +	} else
    5.32 +	{
    5.33 +		xsl=settings.readLocalEntry 
    5.34 +			(filepath,"/vym/export/xhtml/xsl","/usr/share/vym/styles/vym2xhtml.xsl");
    5.35 +		css=settings.readLocalEntry 
    5.36 +			(filepath,"/vym/export/xhtml/css","/usr/share/vym/styles/vym.css");	
    5.37 +	}
    5.38  	lineEditXSL->setText(xsl);
    5.39 -	
    5.40 -	css=settings.readLocalEntry 
    5.41 -		(filepath,"/vym/export/xhtml/css","/usr/share/vym/styles/vym.css");	
    5.42  	lineEditCSS->setText(css);
    5.43  	
    5.44  	prescript=settings.readLocalEntry
    5.45 @@ -241,7 +249,6 @@
    5.46  	// (but don't save at destructor, which
    5.47  	// is called for "cancel", too)
    5.48  	settings.setLocalEntry (filepath,"/vym/export/xhtml/exportDir",dir);
    5.49 -
    5.50  	settings.setLocalEntry (filepath,"/vym/export/xhtml/prescript",prescript);
    5.51  	settings.setLocalEntry (filepath,"/vym/export/xhtml/postscript",postscript);
    5.52  
    5.53 @@ -264,15 +271,22 @@
    5.54  		settings.writeEntry ("/vym/export/xhtml/showOutput","yes");
    5.55  	else
    5.56  		settings.writeEntry ("/vym/export/xhtml/showOutput","no");	
    5.57 -		
    5.58 -	settings.setLocalEntry 
    5.59 -		(filepath,"/vym/export/xhtml/xsl",xsl);
    5.60 -	settings.setLocalEntry 
    5.61 -		(filepath,"/vym/export/xhtml/css",css);	
    5.62 +
    5.63 +	QString ipath;	
    5.64 +	if (options.isOn ("local"))
    5.65 +	{
    5.66 +		ipath=vymBaseDir.path()+"/icons/flag-url-16x16.png";
    5.67 +	} else	
    5.68 +	{
    5.69 +		ipath=vymBaseDir.path()+"/images/flag-url-16x16.png";
    5.70 +		settings.setLocalEntry 
    5.71 +			(filepath,"/vym/export/xhtml/xsl",xsl);
    5.72 +		settings.setLocalEntry 
    5.73 +			(filepath,"/vym/export/xhtml/css",css);	
    5.74 +	}
    5.75  
    5.76  	// Provide a smaller URL-icon to improve Layout
    5.77  	QPixmap pm;
    5.78 -	QString ipath="/usr/share/vym/images/flag-url-16x16.png";
    5.79  	if (!pm.load(ipath,"PNG") )
    5.80  		QMessageBox::warning( 0, tr( "Warning" ),tr("Could not open %1").arg(ipath));
    5.81  		
     6.1 --- a/mapcenterobj.cpp	Wed Mar 08 12:59:08 2006 +0000
     6.2 +++ b/mapcenterobj.cpp	Tue Mar 14 14:27:04 2006 +0000
     6.3 @@ -126,24 +126,12 @@
     6.4  
     6.5  	QString linkAttr=getLinkAttr();
     6.6  
     6.7 -	QString urlAttr;
     6.8 -	if (!url.isEmpty())
     6.9 -		urlAttr=attribut ("url",url);
    6.10 -	QString vymLinkAttr;
    6.11 -	if (!vymLink.isEmpty())
    6.12 -		vymLinkAttr=attribut ("vymLink",convertToRel(mapEditor->getDestPath(),vymLink) );
    6.13 -
    6.14      s=beginElement ("mapcenter" 
    6.15 -		+attribut("absPosX",QString().setNum(absPos.x(),10))
    6.16 -		+attribut("absPosY",QString().setNum(absPos.y(),10))
    6.17 -		+vymLinkAttr
    6.18 -		+urlAttr
    6.19 -		+linkAttr
    6.20 -		+idAttr
    6.21 +		+getOrnAttr() 
    6.22  		+attribut("frameType",frame->getFrameTypeName()) 
    6.23  		+areaAttr 
    6.24 -		);
    6.25 -		
    6.26 +		+idAttr 
    6.27 +		+getIncludeImageAttr() );
    6.28      incIndent();
    6.29      if (heading->getColor()!=QColor("black"))
    6.30  		a=attribut ("textColor",QColor(heading->getColor()).name() );
     7.1 --- a/xml.cpp	Wed Mar 08 12:59:08 2006 +0000
     7.2 +++ b/xml.cpp	Tue Mar 14 14:27:04 2006 +0000
     7.3 @@ -160,7 +160,7 @@
     7.4  		if (!atts.value( "textColor").isEmpty() ) 
     7.5  		{
     7.6  			col.setNamedColor(atts.value("textColor"));
     7.7 -			lastBranch->setColor(col ,false );
     7.8 +			lastBranch->setColor(col );
     7.9  		}	    
    7.10  	} else if ( eName == "note" && state == StateMapCenter) 
    7.11  	{	// only for backward compatibility (<1.4.6). Use htmlnote now.
    7.12 @@ -229,7 +229,7 @@
    7.13  		if (!atts.value( "textColor").isEmpty() ) 
    7.14  		{
    7.15  			col.setNamedColor(atts.value("textColor"));
    7.16 -			lastBranch->setColor(col ,false );
    7.17 +			lastBranch->setColor(col );
    7.18  		}	    
    7.19      } else if ( eName == "note" && state == StateBranch) 
    7.20  	{
    7.21 @@ -383,22 +383,26 @@
    7.22  
    7.23  bool mapBuilderHandler::fatalError( const QXmlParseException& exception ) 
    7.24  {
    7.25 -    errorProt += QString( "fatal parsing error: %1 in line %2, column %3\n")
    7.26 +    errorProt += QString( "Fatal parsing error: %1 in line %2, column %3\n")
    7.27      .arg( exception.message() )
    7.28      .arg( exception.lineNumber() )
    7.29      .arg( exception.columnNumber() );
    7.30 -	/* FIXME Testing only
    7.31 -	errorProt += exception.publicId ()+"\n";
    7.32 -	errorProt += exception.systemId()+"\n";
    7.33 -
    7.34  	// Try to read the bogus line
    7.35 -	int i=0;
    7.36  	QString s;
    7.37 -	if (loadStringFromDisk (,s))
    7.38 +	if (loadStringFromDisk (inputFile,s))
    7.39  	{
    7.40 -		errorProt +=
    7.41 -	}
    7.42 -*/
    7.43 +		QStringList sl=QStringList::split ("\n",s);
    7.44 +		int i=1;
    7.45 +		QStringList::Iterator it = sl.begin();
    7.46 +		while (i<exception.lineNumber())
    7.47 +		{
    7.48 +			it++;
    7.49 +			i++;
    7.50 +		}
    7.51 +		s=*it;
    7.52 +		s.insert (exception.columnNumber()-1,"<ERROR>");
    7.53 +		errorProt+=s;
    7.54 +    }
    7.55      return QXmlDefaultHandler::fatalError( exception );
    7.56  }
    7.57  
    7.58 @@ -413,6 +417,11 @@
    7.59  	tmpDir=tp;
    7.60  }
    7.61  
    7.62 +void mapBuilderHandler::setInputFile (QString f)
    7.63 +{
    7.64 +	inputFile=f;
    7.65 +}
    7.66 +
    7.67  void mapBuilderHandler::setLoadMode (const LoadMode &lm)
    7.68  {
    7.69  	loadMode=lm;
    7.70 @@ -450,12 +459,16 @@
    7.71  				return false;   // Couldn't read relPos
    7.72  		}           
    7.73  	}           
    7.74 -	if (!a.value( "scrolled").isEmpty() )
    7.75 -		lastBranch->toggleScroll();
    7.76  	if (!a.value( "url").isEmpty() ) 
    7.77  		lastBranch->setURL (a.value ("url"));
    7.78  	if (!a.value( "vymLink").isEmpty() ) 
    7.79  		lastBranch->setVymLink (a.value ("vymLink"));
    7.80 +	if (!a.value( "hideInExport").isEmpty() ) 
    7.81 +		if (a.value("hideInExport")=="true")
    7.82 +			lastBranch->setHideInExport(true);
    7.83 +
    7.84 +	if (!a.value( "scrolled").isEmpty() )
    7.85 +		lastBranch->toggleScroll();
    7.86  	if (!a.value( "frameType").isEmpty() ) 
    7.87  		lastBranch->setFrameType (a.value("frameType"));
    7.88  
     8.1 --- a/xml.h	Wed Mar 08 12:59:08 2006 +0000
     8.2 +++ b/xml.h	Tue Mar 14 14:27:04 2006 +0000
     8.3 @@ -26,6 +26,7 @@
     8.4  	bool fatalError( const QXmlParseException&);
     8.5  	void setMapEditor (MapEditor*);
     8.6  	void setTmpDir (QString);
     8.7 +	void setInputFile (QString);
     8.8  	void setLoadMode (const LoadMode &);
     8.9  	bool readBranchAttr (const QXmlAttributes&);
    8.10  	bool readLinkAttr (const QXmlAttributes&);
    8.11 @@ -61,6 +62,8 @@
    8.12  	int branchDepth; 
    8.13  	NoteObj no;
    8.14  	MapCenterObj* mc;
    8.15 -	MapEditor* me; QString tmpDir; 
    8.16 +	MapEditor* me; 
    8.17 +	QString tmpDir; 
    8.18 +	QString inputFile;
    8.19  }; 
    8.20  #endif