diff -r 7d67be709091 -r f076fdec767d xml-vym.cpp --- a/xml-vym.cpp Tue Sep 08 12:15:39 2009 +0000 +++ b/xml-vym.cpp Fri Oct 02 13:24:55 2009 +0000 @@ -14,8 +14,6 @@ #include "version.h" #include "xlinkitem.h" -static ImageItem *lastImageItem; -static MapItem *lastMI; extern Main *mainWindow; extern Settings settings; @@ -145,7 +143,8 @@ { // Treat the found mapcenter as a branch // in an existing map - BranchItem *bi=model->getSelectedBranch(); //FIXME-2 selection is no longer used here... + BranchItem *bi=model->getSelectedBranch(); + cout << "xml-vym bi="<getHeadingStd()<<" loadMode="<createBranch(lastBranch); } //else - //lastBranch->clear(); //FIXME-2 clear not really defined! + model->clearItem(lastBranch); } else // add mapCenter without parent lastBranch=model->createMapCenter(); @@ -190,9 +189,9 @@ if (!readImageAttr(atts)) return false; } else if ( (eName == "branch"||eName=="floatimage") && state == StateMap) { - // This is used in vymparts, which have no mapcenter! + // This is used in vymparts, which have no mapcenter or for undo isVymPart=true; - TreeItem *ti=model->getSelectedItem(); //FIXME-3 selection is no longer used here... + TreeItem *ti=model->getSelectedItem(); if (!ti) { // If a vym part is _loaded_ (not imported), @@ -202,6 +201,7 @@ // FIXME-3 lmo=model->first()->getLMO(); // Do we really have no MCO when loading????? cout << "xml-vym aborted\n"; + return false; } if (ti && ti->isBranchLikeType() ) { @@ -212,9 +212,8 @@ if (loadMode==ImportAdd) { lastBranch=model->createBranch(lastBranch); - } else - //FIXME-2 lastBranch->clear(); + model->clearItem (lastBranch); readBranchAttr (atts); } else if (eName=="floatimage") {