1.1 --- a/mainwindow.cpp Tue Apr 08 08:28:37 2008 +0000
1.2 +++ b/mainwindow.cpp Tue Apr 08 08:28:37 2008 +0000
1.3 @@ -527,6 +527,12 @@
1.4 connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteSelection() ) );
1.5 actionEditDelete=a;
1.6
1.7 + // Shortcut to add mapcenter
1.8 + a= new QAction(tr( "Add mapcenter","Canvas context menu" ), this);
1.9 + connect( a, SIGNAL( triggered() ), this, SLOT( editAddMapCenter() ) );
1.10 + actionEditAddMapCenter = a;
1.11 +
1.12 +
1.13 // Shortcut to add branch
1.14 alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
1.15 alt->setStatusTip ( tr( "Add a branch as child of selection" ));
1.16 @@ -1592,6 +1598,8 @@
1.17 // Context menu for canvas
1.18 canvasContextMenu =new QMenu (this);
1.19 actionEditMapInfo->addTo( canvasContextMenu );
1.20 + if (settings.value( "/mainwindow/showTestMenu",false).toBool() )
1.21 + actionEditAddMapCenter->addTo( canvasContextMenu );
1.22 canvasContextMenu->insertSeparator();
1.23 actionGroupFormatLinkStyles->addTo( canvasContextMenu );
1.24 canvasContextMenu->insertSeparator();
1.25 @@ -2855,6 +2863,15 @@
1.26 currentMapEditor()->unscrollChilds();
1.27 }
1.28
1.29 +void Main::editAddMapCenter()
1.30 +{
1.31 + MapEditor *me=currentMapEditor();
1.32 + if (!lineedit->isVisible() && me)
1.33 + {
1.34 + me->addMapCenter ();
1.35 + }
1.36 +}
1.37 +
1.38 void Main::editNewBranch()
1.39 {
1.40 MapEditor *me=currentMapEditor();
1.41 @@ -2863,9 +2880,9 @@
1.42 BranchObj *bo=(BranchObj*)me->getSelection();
1.43 BranchObj *newbo=me->addNewBranch(0);
1.44
1.45 - prevSelection=bo->getSelectString();
1.46 + prevSelection=me->getModel()->getSelectString(bo);
1.47 if (newbo)
1.48 - me->select (newbo->getSelectString());
1.49 + me->select (newbo);
1.50 else
1.51 return;
1.52
1.53 @@ -2892,14 +2909,14 @@
1.54 BranchObj *newbo=me->addNewBranchBefore();
1.55
1.56 if (newbo)
1.57 - me->select (newbo->getSelectString());
1.58 + me->select (newbo);
1.59 else
1.60 return;
1.61
1.62 if (actionSettingsAutoEditNewBranch->isOn())
1.63 {
1.64 if (!actionSettingsAutoSelectNewBranch->isOn())
1.65 - prevSelection=bo->getSelectString();
1.66 + prevSelection=me->getModel()->getSelectString(bo); //TODO access directly
1.67 editHeading();
1.68 }
1.69 }
1.70 @@ -2914,14 +2931,14 @@
1.71 BranchObj *newbo=me->addNewBranch (-1);
1.72
1.73 if (newbo)
1.74 - me->select (newbo->getSelectString());
1.75 + me->select (newbo);
1.76 else
1.77 return;
1.78
1.79 if (actionSettingsAutoEditNewBranch->isOn())
1.80 {
1.81 if (!actionSettingsAutoSelectNewBranch->isOn())
1.82 - prevSelection=bo->getSelectString();
1.83 + prevSelection=me->getModel()->getSelectString (bo); // TODO access directly
1.84 editHeading();
1.85 }
1.86 }
1.87 @@ -2936,14 +2953,14 @@
1.88 BranchObj *newbo=me->addNewBranch (1);
1.89
1.90 if (newbo)
1.91 - me->select (newbo->getSelectString());
1.92 + me->select (newbo);
1.93 else
1.94 return;
1.95
1.96 if (actionSettingsAutoEditNewBranch->isOn())
1.97 {
1.98 if (!actionSettingsAutoSelectNewBranch->isOn())
1.99 - prevSelection=bo->getSelectString();
1.100 + prevSelection=me->getModel()->getSelectString(bo); //TODO access directly
1.101 editHeading();
1.102 }
1.103 }
2.1 --- a/mainwindow.h Tue Apr 08 08:28:37 2008 +0000
2.2 +++ b/mainwindow.h Tue Apr 08 08:28:37 2008 +0000
2.3 @@ -131,6 +131,7 @@
2.4 void editSortChildren();
2.5 void editToggleScroll();
2.6 void editUnscrollChilds();
2.7 + void editAddMapCenter();
2.8 void editNewBranch();
2.9 void editNewBranchBefore();
2.10 void editNewBranchAbove();
2.11 @@ -276,6 +277,7 @@
2.12 QAction *actionEditMapInfo;
2.13 QAction *actionEditHeading;
2.14 QAction *actionEditDelete;
2.15 + QAction *actionEditAddMapCenter;
2.16 QAction *actionEditAddBranch;
2.17 QAction *actionEditAddBranchBefore;
2.18 QAction *actionEditAddBranchAbove;
3.1 --- a/mapeditor.cpp Tue Apr 08 08:28:37 2008 +0000
3.2 +++ b/mapeditor.cpp Tue Apr 08 08:28:37 2008 +0000
3.3 @@ -429,7 +429,7 @@
3.4 cout << " undoSel="<<undoSelection.toStdString()<<endl;
3.5 cout << " redoCom="<<redoCom.toStdString()<<endl;
3.6 cout << " redoSel="<<redoSelection.toStdString()<<endl;
3.7 - if (saveSel) cout << " saveSel="<<qPrintable (saveSel->getSelectString())<<endl;
3.8 + if (saveSel) cout << " saveSel="<<qPrintable (model->getSelectString(saveSel))<<endl;
3.9 cout << " ---------------------------"<<endl;
3.10 }
3.11
3.12 @@ -444,12 +444,12 @@
3.13 // save the selected part of the map, Undo will replace part of map
3.14 QString undoSelection="";
3.15 if (undoSel)
3.16 - undoSelection=undoSel->getSelectString();
3.17 + undoSelection=model->getSelectString(undoSel);
3.18 else
3.19 qWarning ("MapEditor::saveStateChangingPart no undoSel given!");
3.20 QString redoSelection="";
3.21 if (redoSel)
3.22 - redoSelection=undoSel->getSelectString();
3.23 + redoSelection=model->getSelectString(undoSel);
3.24 else
3.25 qWarning ("MapEditor::saveStateChangingPart no redoSel given!");
3.26
3.27 @@ -468,8 +468,8 @@
3.28 qWarning ("MapEditor::saveStateRemovingPart no redoSel given!");
3.29 return;
3.30 }
3.31 - QString undoSelection=redoSel->getParObj()->getSelectString();
3.32 - QString redoSelection=redoSel->getSelectString();
3.33 + QString undoSelection=model->getSelectString (redoSel->getParObj());
3.34 + QString redoSelection=model->getSelectString(redoSel);
3.35 if (typeid(*redoSel) == typeid(BranchObj) )
3.36 {
3.37 // save the selected branch of the map, Undo will insert part of map
3.38 @@ -489,9 +489,9 @@
3.39 // and use current selection
3.40
3.41 QString redoSelection="";
3.42 - if (redoSel) redoSelection=redoSel->getSelectString();
3.43 + if (redoSel) redoSelection=model->getSelectString(redoSel);
3.44 QString undoSelection="";
3.45 - if (undoSel) undoSelection=undoSel->getSelectString();
3.46 + if (undoSel) undoSelection=model->getSelectString(undoSel);
3.47
3.48 saveState (UndoCommand,
3.49 undoSelection, uc,
3.50 @@ -578,6 +578,18 @@
3.51 }
3.52 }
3.53 /////////////////////////////////////////////////////////////////////
3.54 + } else if (com==QString("addMapCenter"))
3.55 + {
3.56 + if (parser.checkParCount(2))
3.57 + {
3.58 + x=parser.parDouble (ok,0);
3.59 + if (ok)
3.60 + {
3.61 + y=parser.parDouble (ok,1);
3.62 + if (ok) model->addMapCenter (QPointF(x,y));
3.63 + }
3.64 + }
3.65 + /////////////////////////////////////////////////////////////////////
3.66 } else if (com==QString("addMapReplace"))
3.67 {
3.68 if (xelection.isEmpty())
3.69 @@ -591,7 +603,7 @@
3.70 //s=parser.parString (ok,0); // selection
3.71 t=parser.parString (ok,0); // path to map
3.72 if (QDir::isRelativePath(t)) t=(tmpMapDir + "/"+t);
3.73 - addMapReplaceInt(selb->getSelectString(),t);
3.74 + addMapReplaceInt(model->getSelectString(selb),t);
3.75 }
3.76 /////////////////////////////////////////////////////////////////////
3.77 } else if (com==QString("addMapInsert"))
3.78 @@ -688,10 +700,13 @@
3.79 if (xelection.isEmpty())
3.80 {
3.81 parser.setError (Aborted,"Nothing selected");
3.82 - } else if (xelection.type() != Selection::Branch && xelection.type() != Selection::FloatImage )
3.83 + }
3.84 + /*else if (xelection.type() != Selection::Branch && xelection.type() != Selection::FloatImage )
3.85 {
3.86 parser.setError (Aborted,"Type of selection is wrong.");
3.87 - } else if (parser.checkParCount(0))
3.88 + }
3.89 + */
3.90 + else if (parser.checkParCount(0))
3.91 {
3.92 deleteSelection();
3.93 }
3.94 @@ -854,7 +869,7 @@
3.95 {
3.96 if (typeid(*dst) == typeid(BranchObj) ||
3.97 typeid(*dst) == typeid(MapCenterObj))
3.98 - linkTo (dst->getSelectString());
3.99 + linkTo (model->getSelectString(dst));
3.100 } else
3.101 parser.setError (Aborted,"Destination is not a branch");
3.102 }
3.103 @@ -2145,7 +2160,7 @@
3.104 if (redosAvail == 0)
3.105 {
3.106 // Copy to history
3.107 - QString s=sel->getSelectString();
3.108 + QString s=model->getSelectString(sel);
3.109 saveState (PartOfMap, s, "nop ()", s, "copy ()","Copy selection to clipboard",sel );
3.110 curClipboard=curStep;
3.111 }
3.112 @@ -2487,7 +2502,7 @@
3.113 if (ap != to)
3.114 {
3.115 QString ps=qpointfToString(ap);
3.116 - QString s=xelection.single()->getSelectString();
3.117 + QString s=xelection.getSelectString();
3.118 saveState(
3.119 s, "move "+ps,
3.120 s, "move "+qpointfToString(to),
3.121 @@ -2509,7 +2524,7 @@
3.122 if (rp != to)
3.123 {
3.124 QString ps=qpointfToString (sel->getRelPos());
3.125 - QString s=sel->getSelectString();
3.126 + QString s=model->getSelectString(sel);
3.127 saveState(
3.128 s, "moveRel "+ps,
3.129 s, "moveRel "+qpointfToString(to),
3.130 @@ -2531,7 +2546,7 @@
3.131 if (!bo->canMoveBranchUp()) return;
3.132 par=(BranchObj*)(bo->getParObj());
3.133 BranchObj *obo=par->moveBranchUp (bo); // bo will be the one below selection
3.134 - saveState (bo->getSelectString(),"moveBranchDown ()",obo->getSelectString(),"moveBranchUp ()",QString("Move up %1").arg(getName(bo)));
3.135 + saveState (model->getSelectString(bo),"moveBranchDown ()",model->getSelectString(obo),"moveBranchUp ()",QString("Move up %1").arg(getName(bo)));
3.136 model->reposition();
3.137 scene()->update();
3.138 xelection.update();
3.139 @@ -2548,7 +2563,7 @@
3.140 if (!bo->canMoveBranchDown()) return;
3.141 par=(BranchObj*)(bo->getParObj());
3.142 BranchObj *obo=par->moveBranchDown(bo); // bo will be the one above selection
3.143 - saveState(bo->getSelectString(),"moveBranchUp ()",obo->getSelectString(),"moveBranchDown ()",QString("Move down %1").arg(getName(bo)));
3.144 + saveState(model->getSelectString(bo),"moveBranchUp ()",model->getSelectString(obo),"moveBranchDown ()",QString("Move down %1").arg(getName(bo)));
3.145 model->reposition();
3.146 scene()->update();
3.147 xelection.update();
3.148 @@ -2581,9 +2596,9 @@
3.149 typeid(*dst)==typeid (MapCenterObj)))
3.150 {
3.151 LinkableMapObj *dstPar=dst->getParObj();
3.152 - QString parString=dstPar->getSelectString();
3.153 - QString fioPreSelectString=fio->getSelectString();
3.154 - QString fioPreParentSelectString=fio->getParObj()->getSelectString();
3.155 + QString parString=model->getSelectString(dstPar);
3.156 + QString fioPreSelectString=model->getSelectString(fio);
3.157 + QString fioPreParentSelectString=model->getSelectString (fio->getParObj());
3.158 ((BranchObj*)(dst))->addFloatImage (fio);
3.159 xelection.unselect();
3.160 ((BranchObj*)(fio->getParObj()))->removeFloatImage (fio);
3.161 @@ -2592,7 +2607,7 @@
3.162 fio->reposition();
3.163 xelection.select(fio);
3.164 saveState(
3.165 - fio->getSelectString(),
3.166 + model->getSelectString(fio),
3.167 QString("linkTo (\"%1\")").arg(fioPreParentSelectString),
3.168 fioPreSelectString,
3.169 QString ("linkTo (\"%1\")").arg(dstString),
3.170 @@ -2658,6 +2673,22 @@
3.171 }
3.172 }
3.173
3.174 +BranchObj* MapEditor::addMapCenter ()
3.175 +{
3.176 + MapCenterObj *mco= model->addMapCenter(contextMenuPos);
3.177 + xelection.select (mco);
3.178 + updateActions();
3.179 + ensureSelectionVisible();
3.180 + saveState (
3.181 + mco,
3.182 + "delete()",
3.183 + NULL,
3.184 + QString ("addMapCenter (%1,%2)").arg (contextMenuPos.x()).arg(contextMenuPos.y()),
3.185 + QString ("Adding MapCenter to (%1,%2").arg (contextMenuPos.x()).arg(contextMenuPos.y())
3.186 + );
3.187 + return mco;
3.188 +}
3.189 +
3.190 BranchObj* MapEditor::addNewBranchInt(int num)
3.191 {
3.192 // Depending on pos:
3.193 @@ -2717,7 +2748,7 @@
3.194
3.195 model->reposition();
3.196 xelection.update();
3.197 - latestSelection=newbo->getSelectString();
3.198 + latestSelection=model->getSelectString(newbo);
3.199 // In Network mode, the client needs to know where the new branch is,
3.200 // so we have to pass on this information via saveState.
3.201 // TODO: Get rid of this positioning workaround
3.202 @@ -2853,6 +2884,18 @@
3.203 return false;
3.204 }
3.205
3.206 +bool MapEditor::select (LinkableMapObj *lmo)
3.207 +{
3.208 + if (xelection.select(lmo))
3.209 + {
3.210 + xelection.update();
3.211 + ensureSelectionVisible();
3.212 + sendSelection ();
3.213 + return true;
3.214 + }
3.215 + return false;
3.216 +}
3.217 +
3.218 QString MapEditor::getSelectString()
3.219 {
3.220 return xelection.getSelectString();
3.221 @@ -2874,7 +2917,7 @@
3.222 LinkableMapObj *sel=xelection.single();
3.223 if (sel)
3.224 {
3.225 - QString s=sel->getSelectString();
3.226 + QString s=xelection.getSelectString();
3.227 QString part;
3.228 QString typ;
3.229 QString num;
3.230 @@ -2955,7 +2998,7 @@
3.231 BranchObj *bo=xelection.getBranch();
3.232 if (bo)
3.233 {
3.234 - QString s=bo->getSelectString();
3.235 + QString s=xelection.getSelectString();
3.236 QString part;
3.237 QString typ;
3.238 QString num;
3.239 @@ -3391,6 +3434,7 @@
3.240 itFind=model->next(itFind);
3.241 if (!itFind) EOFind=true;
3.242 }
3.243 + //cout <<"still searching... "<<qPrintable( itFind->getHeading())<<endl;
3.244 }
3.245 if (!searching)
3.246 return xelection.getBranch();
3.247 @@ -3649,7 +3693,7 @@
3.248 QString("Remove %1 and keep its childs").arg(getName(bo))
3.249 );
3.250
3.251 - QString sel=bo->getSelectString();
3.252 + QString sel=model->getSelectString(bo);
3.253 unselect();
3.254 par->removeBranchHere(bo);
3.255 model->reposition();
3.256 @@ -4417,16 +4461,11 @@
3.257 void MapEditor::testFunction2()
3.258 {
3.259
3.260 - xelection.select (model->addMapCenter());
3.261 - ensureSelectionVisible();
3.262 -
3.263 -/*
3.264 // Toggle hidemode
3.265 if (hidemode==HideExport)
3.266 setHideTmpMode (HideNone);
3.267 else
3.268 setHideTmpMode (HideExport);
3.269 -*/
3.270 }
3.271
3.272 void MapEditor::contextMenuEvent ( QContextMenuEvent * e )
3.273 @@ -4463,6 +4502,7 @@
3.274 { // No MapObj found, we are on the Canvas itself
3.275 // Context Menu on scene
3.276 updateActions();
3.277 + contextMenuPos=p;
3.278 canvasContextMenu->popup(e->globalPos() );
3.279 }
3.280 e->accept();
3.281 @@ -4697,7 +4737,7 @@
3.282 fio->getParObj()->requestReposition();
3.283 model->reposition();
3.284
3.285 - linkTo (lmo->getSelectString());
3.286 + linkTo (model->getSelectString(lmo));
3.287 //movingObj=lmosel;
3.288 //movingObj_orgRelPos=lmosel->getRelPos();
3.289
3.290 @@ -4876,7 +4916,7 @@
3.291 lmosel->unsetParObjTmp();
3.292
3.293 // For Redo we may need to save original selection
3.294 - QString preSelStr=lmosel->getSelectString();
3.295 + QString preSelStr=model->getSelectString(lmosel);
3.296
3.297 copyingObj=false;
3.298 if (dst )
3.299 @@ -4884,27 +4924,27 @@
3.300 BranchObj* bsel=xelection.getBranch();
3.301 BranchObj* bdst=(BranchObj*)dst;
3.302
3.303 - QString preParStr=(bsel->getParObj())->getSelectString();
3.304 + QString preParStr=model->getSelectString (bsel->getParObj());
3.305 QString preNum=QString::number (bsel->getNum(),10);
3.306 QString preDstParStr;
3.307
3.308 if (e->state() & Qt::ShiftModifier && dst->getParObj())
3.309 { // Link above dst
3.310 - preDstParStr=dst->getParObj()->getSelectString();
3.311 + preDstParStr=model->getSelectString (dst->getParObj());
3.312 bsel->linkTo ( (BranchObj*)(bdst->getParObj()), bdst->getNum());
3.313 } else
3.314 if (e->state() & Qt::ControlModifier && dst->getParObj())
3.315 {
3.316 // Link below dst
3.317 - preDstParStr=dst->getParObj()->getSelectString();
3.318 + preDstParStr=model->getSelectString (dst->getParObj());
3.319 bsel->linkTo ( (BranchObj*)(bdst->getParObj()), bdst->getNum()+1);
3.320 } else
3.321 { // Append to dst
3.322 - preDstParStr=dst->getSelectString();
3.323 + preDstParStr=model->getSelectString(dst);
3.324 bsel->linkTo (bdst,-1);
3.325 if (dst->getDepth()==0) bsel->move (savePos);
3.326 }
3.327 - QString postSelStr=lmosel->getSelectString();
3.328 + QString postSelStr=model->getSelectString(lmosel);
3.329 QString postNum=QString::number (bsel->getNum(),10);
3.330
3.331 QString undoCom="linkTo (\""+
3.332 @@ -4931,7 +4971,7 @@
3.333 {
3.334 QString ps=qpointfToString(rp);
3.335 saveState(
3.336 - lmosel->getSelectString(), "moveRel "+qpointfToString(movingObj_orgRelPos),
3.337 + model->getSelectString(lmosel), "moveRel "+qpointfToString(movingObj_orgRelPos),
3.338 preSelStr, "moveRel "+ps,
3.339 QString("Move %1 to relative position %2").arg(getName(lmosel)).arg(ps));
3.340 }
3.341 @@ -5342,7 +5382,7 @@
3.342 FloatImageObj *fio=bo->addFloatImage();
3.343 fio->load(img);
3.344 fio->setOriginalFilename("No original filename (image added by dropevent)");
3.345 - QString s=bo->getSelectString();
3.346 + QString s=model->getSelectString(bo);
3.347 saveState (PartOfMap, s, "nop ()", s, "copy ()","Copy dropped image to clipboard",fio );
3.348 saveState (fio,"delete ()", bo,QString("paste(%1)").arg(curStep),"Pasting dropped image");
3.349 model->reposition();
4.1 --- a/mapeditor.h Tue Apr 08 08:28:37 2008 +0000
4.2 +++ b/mapeditor.h Tue Apr 08 08:28:37 2008 +0000
4.3 @@ -230,6 +230,13 @@
4.4 private:
4.5 void setHeadingInt(const QString &);
4.6 void setVymLinkInt(const QString &); // Set vymLink for selection
4.7 + /*! \brief Add new mapcenter
4.8 +
4.9 + Disclaimer: Still experimental, not fully supported.
4.10 + */
4.11 +public:
4.12 + BranchObj* addMapCenter();
4.13 +
4.14 /*! \brief Add new branch
4.15
4.16 Depending on num the new branch is created
4.17 @@ -240,6 +247,7 @@
4.18 0..n insert at a specific position in selections parent
4.19 (needed for free relinking)
4.20 */
4.21 +private:
4.22 BranchObj* addNewBranchInt(int); // pos allows to add above/below selection
4.23 public:
4.24 /*! \Add new branch
4.25 @@ -258,6 +266,7 @@
4.26 void unselect(); // before changing current noteedit
4.27 void reselect(); // after changing current noteedit
4.28 bool select(const QString &); // Select by string
4.29 + bool select(LinkableMapObj *lmo); // Select by pointer
4.30 QString getSelectString();
4.31 private:
4.32 void selectInt(LinkableMapObj*);
4.33 @@ -427,6 +436,9 @@
4.34 QPointF movingObj_start; // rel. pos of mouse to absPos
4.35 QPointF movingCont_start; // inital pos of moving Content or
4.36 QPointF movingVec; // how far has Content moved
4.37 +
4.38 + QPointF contextMenuPos; // position where context event was triggered
4.39 +
4.40 QPrinter* printer; // Printing
4.41
4.42 bool mapDefault; // Flag if map is untouched
5.1 --- a/tex/vym.changelog Tue Apr 08 08:28:37 2008 +0000
5.2 +++ b/tex/vym.changelog Tue Apr 08 08:28:37 2008 +0000
5.3 @@ -1,3 +1,9 @@
5.4 +-------------------------------------------------------------------
5.5 +Tue Apr 8 09:59:11 CEST 2008 - uwedr@suse.de
5.6 +
5.7 +- Version: 1.11.7
5.8 +- Bugfix: Hangup when find function did not find anything
5.9 +
5.10 -------------------------------------------------------------------
5.11 Thu Mar 13 02:06:59 CET 2008 - uwedr@suse.de
5.12
6.1 --- a/version.h Tue Apr 08 08:28:37 2008 +0000
6.2 +++ b/version.h Tue Apr 08 08:28:37 2008 +0000
6.3 @@ -4,10 +4,10 @@
6.4 #include <QString>
6.5
6.6 #define __VYM_NAME "VYM"
6.7 -#define __VYM_VERSION "1.11.6"
6.8 +#define __VYM_VERSION "1.11.7"
6.9 //#define __VYM_CODENAME "Codename: 1.10.0-RC-3"
6.10 #define __VYM_CODENAME "Codename: development version"
6.11 -#define __VYM_BUILD_DATE "2008-03-13"
6.12 +#define __VYM_BUILD_DATE "2008-04-08"
6.13
6.14
6.15 bool checkVersion(const QString &);
7.1 --- a/vymmodel.cpp Tue Apr 08 08:28:37 2008 +0000
7.2 +++ b/vymmodel.cpp Tue Apr 08 08:28:37 2008 +0000
7.3 @@ -81,7 +81,13 @@
7.4
7.5 MapCenterObj* VymModel::addMapCenter()
7.6 {
7.7 + return addMapCenter (QPointF(0,0));
7.8 +}
7.9 +
7.10 +MapCenterObj* VymModel::addMapCenter(QPointF absPos)
7.11 +{
7.12 MapCenterObj *mapCenter = new MapCenterObj(mapScene);
7.13 + mapCenter->move (absPos);
7.14 mapCenter->setVisibility (true);
7.15 mapCenter->setHeading (QApplication::translate("Heading of mapcenter in new map", "New map"));
7.16 mapCenter->setMapEditor(mapEditor); //FIXME needed to get defLinkStyle, mapLinkColorHint ... for later added objects
7.17 @@ -122,12 +128,11 @@
7.18 // Try to find MapCenter of bo
7.19 while (bo->getDepth()>0) bo=(BranchObj*)bo->getParObj();
7.20
7.21 -
7.22 // Try to find next MapCenter
7.23 int i=mapCenters.indexOf ((MapCenterObj*)bo);
7.24 - if (i+1 > mapCenters.count() || i<0) return NULL;
7.25 - if (mapCenters.at(i)!=bo_start)
7.26 - return mapCenters.at(i);
7.27 + if (i+2 > mapCenters.count() || i<0) return NULL;
7.28 + if (mapCenters.at(i+1)!=bo_start)
7.29 + return mapCenters.at(i+1);
7.30 }
7.31 return NULL;
7.32 }
8.1 --- a/vymmodel.h Tue Apr 08 08:28:37 2008 +0000
8.2 +++ b/vymmodel.h Tue Apr 08 08:28:37 2008 +0000
8.3 @@ -27,6 +27,7 @@
8.4 void setScene(QGraphicsScene *s);
8.5 QGraphicsScene *getScene();
8.6 MapCenterObj* addMapCenter();
8.7 + MapCenterObj* addMapCenter(QPointF absPos);
8.8 MapCenterObj* removeMapCenter(MapCenterObj *mco);
8.9
8.10 BranchObj* first(); // FIXME replaced by ModelIndex later