diff -r fe839bdfd10c -r 6cbf3c9cbd21 xml-vym.cpp --- a/xml-vym.cpp Tue Jul 07 11:21:27 2009 +0000 +++ b/xml-vym.cpp Wed Jul 22 11:48:23 2009 +0000 @@ -145,7 +145,7 @@ { // Treat the found mapcenter as a branch // in an existing map - BranchItem *bi=model->getSelectedBranchItem(); + BranchItem *bi=model->getSelectedBranchItem(); //FIXME-3 selection is no longer used here... if (bi) { lastBranch=bi; @@ -191,7 +191,7 @@ { // This is used in vymparts, which have no mapcenter! isVymPart=true; - TreeItem *ti=model->getSelectedItem(); + TreeItem *ti=model->getSelectedItem(); //FIXME-3 selection is no longer used here... if (!ti) { // If a vym part is _loaded_ (not imported), @@ -269,8 +269,9 @@ /* Testing cout << "endElement state=" <emitDataHasChanged (lastBranch); lastBranch=(BranchItem*)(lastBranch->parent()); lastBranch->setLastSelectedBranch (0); // Reset last selected to first child branch break; case StateBranch: - model->selectParent();// FIXME-3 really needed to "select"? Maybe optimize... + // Empty branches may not be scrolled + // (happens if bookmarks are imported) + if (lastBranch->isScrolled() && lastBranch->branchCount()==0) + lastBranch->unScroll(); model->emitDataHasChanged (lastBranch); + lastBranch=(BranchItem*)(lastBranch->parent()); lastBranch->setLastSelectedBranch (0); // Reset last selected to first child branch break;