On Thu, 2006-04-27 at 18:03 +0200, Abdelrazak Younes wrote:
> Martin Vermeer a écrit :
> > OK for trunk? No functionality change.
> 
> Except that it will break Qt4 compilation, no objection. Are you sure 
> you don't want to remove the enum and create four functions instead? 
> Looks to me that you look for the same thing two times.
> 
> Abdel.

That would be like this. Yes, you'll have to do some work on qt4. I
don't have it working so leave it to you.

- Martin

Index: BufferView_pimpl.C
===================================================================
--- BufferView_pimpl.C	(revision 13751)
+++ BufferView_pimpl.C	(working copy)
@@ -1235,21 +1235,21 @@ bool BufferView::Pimpl::dispatch(FuncReq
 	}
 
 	case LFUN_OUTLINE_UP:
-		lyx::toc::outline(lyx::toc::UP, cursor_);
+		lyx::toc::outline(lyx::toc::Up, cursor_);
 		cursor_.text()->setCursor(cursor_, cursor_.pit(), 0);
 		updateLabels(*buffer_);
 		break;
 	case LFUN_OUTLINE_DOWN:
-		lyx::toc::outline(lyx::toc::DOWN, cursor_);
+		lyx::toc::outline(lyx::toc::Down, cursor_);
 		cursor_.text()->setCursor(cursor_, cursor_.pit(), 0);
 		updateLabels(*buffer_);
 		break;
 	case LFUN_OUTLINE_IN:
-		lyx::toc::outline(lyx::toc::IN, cursor_);
+		lyx::toc::outline(lyx::toc::In, cursor_);
 		updateLabels(*buffer_);
 		break;	
 	case LFUN_OUTLINE_OUT:
-		lyx::toc::outline(lyx::toc::OUT, cursor_);
+		lyx::toc::outline(lyx::toc::Out, cursor_);
 		updateLabels(*buffer_);
 		break;
 
Index: frontends/controllers/ControlToc.C
===================================================================
--- frontends/controllers/ControlToc.C	(revision 13757)
+++ frontends/controllers/ControlToc.C	(working copy)
@@ -45,22 +45,27 @@ bool ControlToc::canOutline(string const
 }
 
 
-void ControlToc::outline(toc::OutlineOp op)
+void ControlToc::outlineUp()
 {
-	switch (op) {
-	case toc::UP:
-		kernel().dispatch(FuncRequest(LFUN_OUTLINE_UP));
-		break;
-	case toc::DOWN:
-		kernel().dispatch(FuncRequest(LFUN_OUTLINE_DOWN));
-		break;
-	case toc::IN:
-		kernel().dispatch(FuncRequest(LFUN_OUTLINE_IN));
-		break;
-	case toc::OUT:
-		kernel().dispatch(FuncRequest(LFUN_OUTLINE_OUT));
-		break;
-	}
+	kernel().dispatch(FuncRequest(LFUN_OUTLINE_UP));
+}
+
+
+void ControlToc::outlineDown()
+{
+	kernel().dispatch(FuncRequest(LFUN_OUTLINE_DOWN));
+}
+
+
+void ControlToc::outlineIn()
+{
+	kernel().dispatch(FuncRequest(LFUN_OUTLINE_IN));
+}
+
+
+void ControlToc::outlineOut()
+{
+	kernel().dispatch(FuncRequest(LFUN_OUTLINE_OUT));
 }
 
 
Index: toc.C
===================================================================
--- toc.C	(revision 13751)
+++ toc.C	(working copy)
@@ -143,7 +143,7 @@ void outline(OutlineOp mode,  LCursor & 
 	int const thistoclevel = s->layout()->toclevel;
 	int toclevel;
 	switch (mode) {
-		case UP: {
+		case Up: {
 			if (p != end)
 				++p;
 			for (; p != end; ++p) {
@@ -175,7 +175,7 @@ void outline(OutlineOp mode,  LCursor & 
 			pars.erase(s, t);
 		break;
 		}
-		case DOWN: {
+		case Down: {
 			   if (p != end)
 				++p;
 			for (; p != end; ++p) {
@@ -206,7 +206,7 @@ void outline(OutlineOp mode,  LCursor & 
 			pars.erase(s, t);
 		break;
 		}
-		case IN:
+		case In:
 			for (; lit != lend; ++lit) {
 				if ((*lit)->toclevel == thistoclevel + 1 &&
 				    s->layout()->labeltype == (*lit)->labeltype) {
@@ -215,7 +215,7 @@ void outline(OutlineOp mode,  LCursor & 
 				}
 			}
 		break;
-		case OUT:
+		case Out:
 			for (; lit != lend; ++lit) {
 				if ((*lit)->toclevel == thistoclevel - 1 &&
 				    s->layout()->labeltype == (*lit)->labeltype) {
Index: toc.h
===================================================================
--- toc.h	(revision 13751)
+++ toc.h	(working copy)
@@ -56,10 +56,10 @@ std::string const getGuiName(std::string
 
 /// the type of outline operation
 enum OutlineOp {
-	UP, // Move this header with text down
-	DOWN,   // Move this header with text up
-	IN, // Make this header deeper
-	OUT // Make this header shallower
+	Up, // Move this header with text down
+	Down,   // Move this header with text up
+	In, // Make this header deeper
+	Out // Make this header shallower
 };
 
 
Index: frontends/qt3/QToc.C
===================================================================
--- frontends/qt3/QToc.C	(revision 13757)
+++ frontends/qt3/QToc.C	(working copy)
@@ -223,28 +223,28 @@ void QToc::set_depth(int depth)
 
 void QToc::moveup()
 {
-	controller().outline(toc::UP);
+	controller().outlineUp();
 	updateToc(depth_);
 }
 
 
 void QToc::movedn()
 {
-	controller().outline(toc::DOWN);
+	controller().outlineDown();
 	updateToc(depth_);
 }
 
 
 void QToc::movein()
 {
-	controller().outline(toc::IN);
+	controller().outlineIn();
 	updateToc(depth_);
 }
 
 
 void QToc::moveout()
 {
-	controller().outline(toc::OUT);
+	controller().outlineOut();
 	updateToc(depth_);
 }
 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to