# HG changeset patch
# User insilmaril
# Date 1142430833 0
# Node ID 3780fe1051a3843f7d804060202f7b61fbcfd116
# Parent  27b71695d690ce24b726244e940a1dafcceaeff0
hide export for floatimages.

diff -r 27b71695d690 -r 3780fe1051a3 xml.cpp
--- a/xml.cpp	Tue Mar 14 14:27:16 2006 +0000
+++ b/xml.cpp	Wed Mar 15 13:53:53 2006 +0000
@@ -13,7 +13,7 @@
 
 static BranchObj *lastBranch;
 static FloatObj *lastFloat;
-static LinkableMapObj *lastLMO;
+static OrnamentedObj *lastOO;
 
 extern Settings settings;
 
@@ -388,13 +388,14 @@
     .arg( exception.lineNumber() )
     .arg( exception.columnNumber() );
 	// Try to read the bogus line
+	errorProt+=QString("File is: %1\n").arg(inputFile);
 	QString s;
 	if (loadStringFromDisk (inputFile,s))
 	{
 		QStringList sl=QStringList::split ("\n",s);
 		int i=1;
 		QStringList::Iterator it = sl.begin();
-		while (i<exception.lineNumber())
+		while (i<exception.lineNumber()-1)
 		{
 			it++;
 			i++;
@@ -429,43 +430,8 @@
 
 bool mapBuilderHandler::readBranchAttr (const QXmlAttributes& a)
 {
-	lastLMO=lastBranch;
-	if (!readLinkAttr(a)) return false;
-
-	bool okx,oky;
-	int x,y;
-	if (!a.value( "absPosX").isEmpty() && loadMode==NewMap && branchDepth<2) 
-	{
-		if (!a.value( "absPosY").isEmpty() ) 
-		{
-			x=a.value("absPosX").toInt (&okx, 10);
-			y=a.value("absPosY").toInt (&oky, 10);
-			if (okx && oky  )
-				lastBranch->move(x,y);
-			else
-				return false;   // Couldn't read absPos
-		}           
-	}           
-	if (!a.value( "relPosX").isEmpty() && loadMode==NewMap && branchDepth<9) 
-	{
-		if (!a.value( "relPosY").isEmpty() ) 
-		{
-			float fx,fy;
-			fx=a.value("relPosX").toFloat (&okx);
-			fy=a.value("relPosY").toFloat (&oky);
-			if (okx && oky  )
-				lastBranch->move2RelPos ((int)fx,(int)fy);
-			else
-				return false;   // Couldn't read relPos
-		}           
-	}           
-	if (!a.value( "url").isEmpty() ) 
-		lastBranch->setURL (a.value ("url"));
-	if (!a.value( "vymLink").isEmpty() ) 
-		lastBranch->setVymLink (a.value ("vymLink"));
-	if (!a.value( "hideInExport").isEmpty() ) 
-		if (a.value("hideInExport")=="true")
-			lastBranch->setHideInExport(true);
+	lastOO=lastBranch;
+	if (!readOOAttr(a)) return false;
 
 	if (!a.value( "scrolled").isEmpty() )
 		lastBranch->toggleScroll();
@@ -489,16 +455,38 @@
 	return true;	
 }
 
-bool mapBuilderHandler::readLinkAttr (const QXmlAttributes& a)
+bool mapBuilderHandler::readOOAttr (const QXmlAttributes& a)
 {
-	if (lastLMO)
+	if (lastOO)
 	{
+		bool okx,oky;
+		int x,y;
+		if (!a.value( "absPosX").isEmpty() && loadMode==NewMap && branchDepth<2) 
+		{
+			if (!a.value( "absPosY").isEmpty() ) 
+			{
+				x=a.value("absPosX").toInt (&okx, 10);
+				y=a.value("absPosY").toInt (&oky, 10);
+				if (okx && oky  )
+					lastOO->move(x,y);
+				else
+					return false;   // Couldn't read absPos
+			}           
+		}           
+		if (!a.value( "url").isEmpty() ) 
+			lastOO->setURL (a.value ("url"));
+		if (!a.value( "vymLink").isEmpty() ) 
+			lastOO->setVymLink (a.value ("vymLink"));
+		if (!a.value( "hideInExport").isEmpty() ) 
+			if (a.value("hideInExport")=="true")
+				lastOO->setHideInExport(true);
+
 		if (!a.value( "hideLink").isEmpty()) 
 		{
 			if (a.value ("hideLink") =="true")
-				lastLMO->setHideLinkUnselected(true);
+				lastOO->setHideLinkUnselected(true);
 			else	
-				lastLMO->setHideLinkUnselected(false);
+				lastOO->setHideLinkUnselected(false);
 		}	
 	}
 	return true;	
@@ -552,8 +540,10 @@
 
 bool mapBuilderHandler::readFloatImageAttr (const QXmlAttributes& a)
 {
-	lastLMO=lastFloat;
+	lastOO=lastFloat;
 	
+	//if (!readOOAttr(a)) return false;
+
 	if (!a.value( "useOrientation").isEmpty() ) 
 	{
 		if (a.value ("useOrientation") =="true")
@@ -576,8 +566,9 @@
 	}	
 	if (!a.value( "floatExport").isEmpty() ) 
 	{
+		// Only for compatibility. THis is not used since 1.7.11 
 		if (a.value ("floatExport") =="true")
-			lastFloat->setFloatExport (true);
+			lastFloat->setFloatExport(true);
 		else	
 			lastFloat->setFloatExport (false);
 	}	
@@ -593,6 +584,7 @@
 			x=a.value("relPosX").toInt (&okx, 10);
 			y=a.value("relPosY").toInt (&oky, 10);
 			if (okx && oky) 
+				
 				lastFloat->setRelPos (QPoint (x,y) );
 			else
 				// Couldn't read relPos
@@ -600,7 +592,7 @@
 		}           
 	}	
 	
-	if (!readLinkAttr(a)) return false;
+	if (!readOOAttr(a)) return false;
 
 	return true;
 }