diff -r fb74fa7bfb4c -r 9ae68208e2ff mapeditor.cpp --- a/mapeditor.cpp Mon Feb 12 09:28:47 2007 +0000 +++ b/mapeditor.cpp Mon Feb 19 12:01:52 2007 +0000 @@ -3003,17 +3003,21 @@ } } -void MapEditor::unScrollAll() +void MapEditor::unscrollChilds() // FIXME saveState missing { - BranchObj *bo; - bo=mapCenter->first(); - while (bo) + BranchObj *bo=xelection.getBranch(); + if (bo) { - if (bo->isScrolled()) bo->toggleScroll(); - bo=bo->next(); - } + bo->first(); + while (bo) + { + if (bo->isScrolled()) bo->toggleScroll(); + bo=bo->next(); + } + } } + void MapEditor::loadFloatImage () { BranchObj *bo=xelection.getBranch(); @@ -3268,10 +3272,8 @@ WarningDialog dia; dia.showCancelButton (true); dia.setText("This is a longer \nWarning"); - /* dia.setCaption("Warning: Flux problem"); dia.setShowAgainName("/warnings/mapeditor"); - */ if (dia.exec()==QDialog::Accepted) cout << "accepted!\n"; else @@ -3603,8 +3605,6 @@ else lmosel->move(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() -lmosel->getTopPad()); } - // reposition subbranch - lmosel->reposition(); if (lmo && (lmo!=lmosel) && xelection.getBranch() ) { @@ -3621,6 +3621,8 @@ { lmosel->unsetParObjTmp(); } + // reposition subbranch + lmosel->reposition(); } // depth>0 } // no FloatImageObj @@ -3863,30 +3865,34 @@ QString s; QString heading; BranchObj *bo; - for (int i=0; iaddBranch(); - if (bo) + // Workaround to avoid adding empty branches + if (!uris.at(i).toString().isEmpty()) { - s=uris.at(i).toLocalFile(); - if (!s.isEmpty()) + bo=sel->addBranch(); + if (bo) { - QString file = QDir::convertSeparators(s); - heading = QFileInfo(file).baseName(); - files.append(file); - if (file.endsWith(".vym", false)) - bo->setVymLink(file); - else - bo->setURL(uris.at(i).toString()); - } else - { - bo->setURL(uris.at(i).toString()); - } - - if (!heading.isEmpty()) - bo->setHeading(heading); - else - bo->setHeading(uris.at(i).toString()); + s=uris.at(i).toLocalFile(); + if (!s.isEmpty()) + { + QString file = QDir::convertSeparators(s); + heading = QFileInfo(file).baseName(); + files.append(file); + if (file.endsWith(".vym", false)) + bo->setVymLink(file); + else + bo->setURL(uris.at(i).toString()); + } else + { + bo->setURL(uris.at(i).toString()); + } + + if (!heading.isEmpty()) + bo->setHeading(heading); + else + bo->setHeading(uris.at(i).toString()); + } } } mapCenter->reposition();