[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-devel
Subject:    RE:  Re: feature request
From:       "Leuven, E." <E.Leuven () uva ! nl>
Date:       2006-04-08 19:52:07
Message-ID: D1B515FFD30A1B4289F6E13EA363CAFDA17D93 () struik ! uva ! nl
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


>> what happens in setCounter(,)?
> It is misnamed (should be setLabel, I am working on that).
> This would set the bullet depending on the depth of the
> current paragraph.

i don't understand why anything needs to be 'set' if we are only =
checking whether something needs to be done

...

if the attached looks ok then i am gonna commit it

thanks, edwin


[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>RE:  Re: feature request</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>&gt;&gt; what happens in setCounter(,)?<BR>
&gt; It is misnamed (should be setLabel, I am working on that).<BR>
&gt; This would set the bullet depending on the depth of the<BR>
&gt; current paragraph.<BR>
<BR>
i don't understand why anything needs to be 'set' if we are only checking whether \
something needs to be done<BR> <BR>
...<BR>
<BR>
if the attached looks ok then i am gonna commit it<BR>
<BR>
thanks, edwin<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>


["par5.diff" (text/x-diff)]

Index: src/LyXAction.C
===================================================================
--- src/LyXAction.C	(revision 13601)
+++ src/LyXAction.C	(working copy)
@@ -353,6 +353,8 @@
 		{ LFUN_MOUSE_RELEASE, "", ReadOnly },
 		{ LFUN_MOUSE_DOUBLE, "", ReadOnly },
 		{ LFUN_MOUSE_TRIPLE, "", ReadOnly },
+		{ LFUN_PARAGRAPH_MOVE_DOWN, "paragraph-move-down", Noop },
+		{ LFUN_PARAGRAPH_MOVE_UP, "paragraph-move-up", Noop },
 		{ LFUN_NOACTION, "", Noop }
 	};
 
Index: src/lyxfunc.C
===================================================================
--- src/lyxfunc.C	(revision 13601)
+++ src/lyxfunc.C	(working copy)
@@ -558,6 +558,18 @@
 		flag = getStatus(func);
 	}
 
+	case LFUN_PARAGRAPH_MOVE_UP: {
+		if (cur)
+			enable = cur.pit()>0;
+		break;
+	}
+
+	case LFUN_PARAGRAPH_MOVE_DOWN: {
+		if (cur)
+			enable = cur.pit()<cur.lastpit();
+		break;
+	}
+
 	case LFUN_MENUNEW:
 	case LFUN_MENUNEWTMPLT:
 	case LFUN_WORDFINDFORWARD:
Index: src/text3.C
===================================================================
--- src/text3.C	(revision 13601)
+++ src/text3.C	(working copy)
@@ -44,6 +44,7 @@
 #include "ParagraphParameters.h"
 #include "undo.h"
 #include "vspace.h"
+#include "pariterator.h"
 
 #include "frontends/Dialogs.h"
 #include "frontends/LyXView.h"
@@ -320,6 +321,30 @@
 
 	switch (cmd.action) {
 
+	case LFUN_PARAGRAPH_MOVE_DOWN: {
+		ParIterator pit_old(cur);
+		lyx::pit_type i = cur.pit();
+		std::swap(pars_[i], pars_[i+1]);
+		ParIterator pit_new(cur);
+		++cur.pit();
+		if (needsUpdateCounters(cur.buffer(), pit_old) ||
+		    needsUpdateCounters(cur.buffer(), pit_new))
+			updateCounters(cur.buffer());
+		needsUpdate = true;
+		break;
+	}
+	case LFUN_PARAGRAPH_MOVE_UP: {
+		ParIterator pit_old(cur);
+		lyx::pit_type i = cur.pit();
+		std::swap(pars_[i], pars_[i-1]);
+		ParIterator pit_new(cur);
+		--cur.pit();
+		if (needsUpdateCounters(cur.buffer(), pit_old) ||
+		    needsUpdateCounters(cur.buffer(), pit_new))
+			updateCounters(cur.buffer());
+		needsUpdate = true;
+		break;
+	}
 	case LFUN_APPENDIX: {
 		Paragraph & par = cur.paragraph();
 		bool start = !par.params().startOfAppendix();
Index: src/lfuns.h
===================================================================
--- src/lfuns.h	(revision 13601)
+++ src/lfuns.h	(working copy)
@@ -358,6 +358,9 @@
 	LFUN_BIBDB_DEL,
 	LFUN_INSERT_CITATION,
 	LFUN_OUTLINE,			// Vermeer 20060323
+	// 275
+	LFUN_PARAGRAPH_MOVE_DOWN,                // Edwin 20060408
+	LFUN_PARAGRAPH_MOVE_UP,                  // Edwin 20060408
 
 	LFUN_LASTACTION                  // end of the table
 };
Index: lib/bind/cua.bind
===================================================================
--- lib/bind/cua.bind	(revision 13601)
+++ lib/bind/cua.bind	(working copy)
@@ -102,6 +102,8 @@
 # Motion group
 #
 
+\bind "M-Up"			"paragraph-move-up"
+\bind "M-Down"			"paragraph-move-down"
 \bind "C-Right"			"word-forward"
 \bind "C-Left"			"word-backward"
 \bind "C-Up"			"paragraph-up"
Index: lib/bind/emacs.bind
===================================================================
--- lib/bind/emacs.bind	(revision 13601)
+++ lib/bind/emacs.bind	(working copy)
@@ -139,6 +139,8 @@
 # Motion group
 #
 
+\bind "M-Up"			"paragraph-move-up"
+\bind "M-Down"			"paragraph-move-down"
 \bind "C-Right"			"word-forward"
 \bind "C-Left"			"word-backward"
 \bind "C-Up"			"paragraph-up"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic