diff -r a8e9eae855f4 -r 54475d6f006a xml-vym.cpp --- a/xml-vym.cpp Tue Aug 21 10:00:21 2007 +0000 +++ b/xml-vym.cpp Tue Oct 16 09:53:22 2007 +0000 @@ -349,54 +349,6 @@ return "the document is not in the VYM file format"; } -/* -bool parseVYMHandler::fatalError( const QXmlParseException& exception ) -{ - errorProt += QString( "Fatal parsing error: %1 in line %2, column %3\n") - .arg( exception.message() ) - .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"); - errorProt+=s; - } - return QXmlDefaultHandler::fatalError( exception ); -} - -void parseVYMHandler::setMapEditor (MapEditor* e) -{ - me=e; - mc=me->getMapCenter(); -} - -void parseVYMHandler::setTmpDir (QString tp) -{ - tmpDir=tp; -} - -void parseVYMHandler::setInputFile (QString f) -{ - inputFile=f; -} - -void parseVYMHandler::setLoadMode (const LoadMode &lm) -{ - loadMode=lm; -} -*/ bool parseVYMHandler::readBranchAttr (const QXmlAttributes& a) { lastOO=lastBranch; @@ -572,7 +524,7 @@ } if (!a.value( "zPlane").isEmpty() ) lastFloat->setZValue (a.value("zPlane").toInt ()); - int x,y; + float x,y; bool okx,oky; if (!a.value( "relPosX").isEmpty() ) { @@ -584,7 +536,7 @@ if (okx && oky) { - lastFloat->setRelPos (QPoint (x,y) ); + lastFloat->setRelPos (QPointF (x,y) ); // make sure floats in mapcenter are repositioned to relative pos if (mc==lastBranch) mc->positionContents(); } @@ -634,9 +586,9 @@ { xlo->setEnd ((BranchObj*)(lmo)); xlo->activate(); + success=true; } } - success=true; // Not all branches there yet, no error } } @@ -645,7 +597,7 @@ { if (!a.value( "endID").isEmpty() ) { - LinkableMapObj *lmo=mc->findID (a.value( "beginBranch")); + LinkableMapObj *lmo=mc->findID (a.value( "beginID")); if (lmo && typeid (*lmo)==typeid (BranchObj)) { xlo->setBegin ((BranchObj*)lmo); @@ -654,13 +606,13 @@ { xlo->setEnd ((BranchObj*)(lmo)); xlo->activate(); + success=true; } } - success=true; // Not all branches there yet, no error } } if (!success) delete (xlo); - return success; + return true; // xLinks can only be established at the "end branch", return true } bool parseVYMHandler::readHtmlAttr (const QXmlAttributes& a)