diff -r 25e634a7e1dc -r 8acac4fade1b xml-vym.cpp --- a/xml-vym.cpp Mon Jun 08 11:36:56 2009 +0000 +++ b/xml-vym.cpp Mon Jun 29 10:27:42 2009 +0000 @@ -279,13 +279,13 @@ mainWindow->removeProgressBar(); break; case StateMapCenter: - model->selectParent(); + model->selectParent(); // FIXME-3 really needed to "select"? Maybe optimize... model->emitDataHasChanged (lastBranch); lastBranch=(BranchItem*)(lastBranch->parent()); lastBranch->setLastSelectedBranch (0); // Reset last selected to first child branch break; case StateBranch: - model->selectParent(); + model->selectParent();// FIXME-3 really needed to "select"? Maybe optimize... model->emitDataHasChanged (lastBranch); lastBranch=(BranchItem*)(lastBranch->parent()); lastBranch->setLastSelectedBranch (0); // Reset last selected to first child branch @@ -382,36 +382,42 @@ return true; } -bool parseVYMHandler::readFrameAttr (const QXmlAttributes& a) +bool parseVYMHandler::readFrameAttr (const QXmlAttributes& a) // FIXME-4 does not work if there is no lmo for treeitem { - bool ok; - int x; - /* FIXME-2 if (lastOO) + if (lastMI) { - if (!a.value( "frameType").isEmpty() ) - lastOO->setFrameType (a.value("frameType")); - if (!a.value( "penColor").isEmpty() ) - lastOO->setFramePenColor (a.value("penColor")); - if (!a.value( "brushColor").isEmpty() ) - lastOO->setFrameBrushColor (a.value("brushColor")); - if (!a.value( "padding").isEmpty() ) + OrnamentedObj* oo=(OrnamentedObj*)(lastMI->getLMO()); + if (oo) { - x=a.value("padding").toInt(&ok); - if (ok) lastOO->setFramePadding(x); - } - if (!a.value( "borderWidth").isEmpty() ) - { - x=a.value("borderWidth").toInt(&ok); - if (ok) lastOO->setFrameBorderWidth(x); - } - } - */ - return true; + bool ok; + int x; + { + if (!a.value( "frameType").isEmpty() ) + oo->setFrameType (a.value("frameType")); + if (!a.value( "penColor").isEmpty() ) + oo->setFramePenColor (a.value("penColor")); + if (!a.value( "brushColor").isEmpty() ) + oo->setFrameBrushColor (a.value("brushColor")); + if (!a.value( "padding").isEmpty() ) + { + x=a.value("padding").toInt(&ok); + if (ok) oo->setFramePadding(x); + } + if (!a.value( "borderWidth").isEmpty() ) + { + x=a.value("borderWidth").toInt(&ok); + if (ok) oo->setFrameBorderWidth(x); + } + } + return true; + } + } + return false; } bool parseVYMHandler::readOOAttr (const QXmlAttributes& a) { - if (lastMI) + if (lastMI) //FIXME-1 below lastBranch is used, not lastMI. So it might not work for images { bool okx,oky; float x,y; @@ -516,7 +522,6 @@ { QMessageBox::warning( 0, "Warning: " , "Couldn't load image\n"+parseHREF(a.value ("href") )); - //FIXME-0 lastBranch->removeFloatImage(((FloatImageObj*)(lastFloat))); lastImage=NULL; return true; } @@ -534,19 +539,14 @@ x=a.value("relPosX").toFloat (&okx); y=a.value("relPosY").toFloat (&oky); if (okx && oky) - - { - lastImage->setRelPos (QPointF (x,y) ); - // make sure floats in mapcenter are repositioned to relative pos - //FIXME-0 if (lastBranch->depth()==0) lastBranch->positionContents(); - } + lastImage->setRelPos (QPointF (x,y) ); else // Couldn't read relPos return false; } } - if (!readOOAttr(a)) return false; + //FIXME-3 if (!readOOAttr(a)) return false; if (!a.value ("originalName").isEmpty() ) {