branchobj.cpp
branchqt4-port
changeset 18 70c41284cb48
parent 17 557239819c45
child 20 9ad3d0391be1
     1.1 --- a/branchobj.cpp	Wed Aug 30 12:16:25 2006 +0000
     1.2 +++ b/branchobj.cpp	Thu Aug 31 11:55:33 2006 +0000
     1.3 @@ -812,7 +812,6 @@
     1.4  
     1.5  	// Save XLinks
     1.6  	XLinkObj *xlo;
     1.7 -	//FIXME exponential increase in xlinks...
     1.8  	QString ol;	// old link
     1.9  	QString cl;	// current link
    1.10      for (xlo=xlink.first(); xlo; xlo=xlink.next() )
    1.11 @@ -882,7 +881,6 @@
    1.12  	calcBBoxSize();
    1.13  	positionBBox();
    1.14  	requestReposition();
    1.15 -	//FIXME undo needed
    1.16  }
    1.17  
    1.18  bool BranchObj::getIncludeImagesVer()
    1.19 @@ -896,7 +894,6 @@
    1.20  	calcBBoxSize();
    1.21  	positionBBox();
    1.22  	requestReposition();
    1.23 -	//FIXME undo needed
    1.24  }
    1.25  
    1.26  bool BranchObj::getIncludeImagesHor()
    1.27 @@ -930,7 +927,6 @@
    1.28  	positionBBox();
    1.29  	requestReposition();
    1.30  	return newfi;
    1.31 -	//FIXME undo needed
    1.32  }
    1.33  
    1.34  LinkableMapObj* BranchObj::addFloatImage (FloatImageObj *fio)
    1.35 @@ -946,7 +942,6 @@
    1.36  	positionBBox();
    1.37  	requestReposition();
    1.38  	return newfi;
    1.39 -	// FIMXE undo needed
    1.40  }
    1.41  
    1.42  FloatImageObj* BranchObj::getFirstFloatImage ()
    1.43 @@ -1155,7 +1150,7 @@
    1.44  
    1.45  bool BranchObj::canMoveBranchUp() 
    1.46  {
    1.47 -	if (!parObj) return false;
    1.48 +	if (!parObj || depth==1) return false;
    1.49  	BranchObj* par=(BranchObj*)parObj;
    1.50  	if (this==par->getFirstBranch())
    1.51  		return false;
    1.52 @@ -1163,23 +1158,24 @@
    1.53  		return true;
    1.54  }
    1.55  
    1.56 -BranchObj* BranchObj::moveBranchUp(BranchObj* bo1) // move a branch up (modify myself)
    1.57 +BranchObj* BranchObj::moveBranchUp(BranchObj* bo1) // modify my childlist
    1.58  {
    1.59  	savePosInAngle();
    1.60      int i=branch.find(bo1);
    1.61 +	cout << "BO: i="<<i<<endl;
    1.62      if (i>0) 
    1.63  	{	// -1 if bo1 not found 
    1.64  		branch.at(i)->angle--;
    1.65  		branch.at(i-1)->angle++;
    1.66  		branch.sort();
    1.67 -		return branch.at(i-1);
    1.68 +		return branch.at(i);
    1.69  	} else
    1.70 -		return branch.at(i);
    1.71 +		return NULL;
    1.72  }
    1.73  
    1.74  bool BranchObj::canMoveBranchDown() 
    1.75  {
    1.76 -	if (!parObj) return false;
    1.77 +	if (!parObj|| depth==1) return false;
    1.78  	BranchObj* par=(BranchObj*)parObj;
    1.79  	if (this==par->getLastBranch())
    1.80  		return false;
    1.81 @@ -1187,7 +1183,7 @@
    1.82  		return true;
    1.83  }
    1.84  
    1.85 -BranchObj* BranchObj::moveBranchDown(BranchObj* bo1)
    1.86 +BranchObj* BranchObj::moveBranchDown(BranchObj* bo1)// modify my childlist
    1.87  {
    1.88  	savePosInAngle();
    1.89      int i=branch.find(bo1);
    1.90 @@ -1198,9 +1194,9 @@
    1.91  		branch.at(i)->angle++;
    1.92  		branch.at(j)->angle--;
    1.93  		branch.sort();
    1.94 -		return branch.at(j);
    1.95 +		return branch.at(i);
    1.96  	} else
    1.97 -		return branch.at(i);
    1.98 +		return NULL;
    1.99  }
   1.100  
   1.101  BranchObj* BranchObj::moveBranchTo (BranchObj* dst, int pos)
   1.102 @@ -1253,7 +1249,7 @@
   1.103  
   1.104  	// If I am the mapcenter or a mainbranch, reposition heading
   1.105  	if (depth<2)
   1.106 -	{	//FIXME ugly! optimize this   move for MCO needed to initially position text in box...
   1.107 +	{
   1.108  		if (depth==1)
   1.109  			// Calc angle to mapCenter if I am a mainbranch
   1.110  			// needed for reordering the mainbranches clockwise 
   1.111 @@ -1452,7 +1448,7 @@
   1.112  	if (!status.isEmpty()) mainWindow->statusMessage (status);
   1.113  
   1.114  	// Update Toolbar
   1.115 -	standardFlags->updateToolbar();
   1.116 +	updateFlagsToolbar();
   1.117  
   1.118  	// Update actions in mapeditor
   1.119  	mapEditor->updateActions();