I have still those two patches in my tree:

1. namespace.diff: please apply, it fixes building with aspell.
2. 1226.diff: fixes bug 1226 and various subbugs (delete selection)
http://bugzilla.lyx.org/show_bug.cgi?id=1226

I have rediffed both just now.

Thanks,
Juergen
Index: src/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/ChangeLog,v
retrieving revision 1.1405
diff -u -r1.1405 ChangeLog
--- src/ChangeLog	2003/07/07 08:36:55	1.1405
+++ src/ChangeLog	2003/07/08 06:13:24
@@ -1,3 +1,7 @@
+2003-07-01  Juergen Spitzmueller  <[EMAIL PROTECTED]>
+
+	* aspell.C: add missing namespace lyx::support
+
 2003-07-07  Alfredo Brauntein  <[EMAIL PROTECTED]>
 
 	* BufferView.[Ch] (newFile): Add
Index: src/aspell.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/aspell.C,v
retrieving revision 1.1
diff -u -r1.1 aspell.C
--- src/aspell.C	2003/03/26 01:20:24	1.1
+++ src/aspell.C	2003/07/08 06:13:25
@@ -19,6 +19,8 @@
 #include "aspell_local.h"
 #include "WordLangTuple.h"

+using namespace lyx::support;
+
 using std::endl;
 
 ASpell::ASpell(BufferParams const &, string const & lang)
@@ -85,14 +87,14 @@
 	AspellSpeller * m = it->second.speller;
 
 	int word_ok = aspell_speller_check(m, word.word().c_str(), -1);
-	lyx::Assert(word_ok != -1);
+	Assert(word_ok != -1);
 
 	if (word_ok) {
 		res = OK;
 	} else {
 		AspellWordList const * sugs =
 			aspell_speller_suggest(m, word.word().c_str(), -1);
-		lyx::Assert(sugs != 0);
+		Assert(sugs != 0);
 		els = aspell_word_list_elements(sugs);
 		if (aspell_word_list_empty(sugs))
 			res = UNKNOWN;
Index: src/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/ChangeLog,v
retrieving revision 1.1405
diff -u -r1.1405 ChangeLog
--- src/ChangeLog	2003/07/07 08:36:55	1.1405
+++ src/ChangeLog	2003/07/08 06:13:24
@@ -131,6 +135,11 @@
 	* lyx_main.C (init): honor LYX_DIR_14x and LYX_USERDIR_14x
 
 	* version.C.in: change docversion to 1.4
+
+2003-06-16  Juergen Spitzmueller  <[EMAIL PROTECTED]>
+
+	* text3.C: introduce function overwriteSelection() and use it
+	to delete selections in some cases (bugs 1226, 673, 702, 954).

 2003-06-22  Alfredo Braunstein  <[EMAIL PROTECTED]>

Index: src/text3.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/text3.C,v
retrieving revision 1.86
diff -u -r1.86 text3.C
--- src/text3.C	2003/07/01 11:51:19	1.86
+++ src/text3.C	2003/07/08 06:13:27
@@ -140,6 +140,15 @@
 		return inset;
 	}
 
+	void overwriteSelection(LyXText * lt)
+	{
+		if (lt->selection.set()) {
+			lt->update();
+			lt->cutSelection(true, false);
+			lt->update();
+		}
+	}
+
 } // anon namespace
 
 
@@ -369,6 +378,7 @@
 {
 	lt->update();
 	InsetSpecialChar * new_inset = new InsetSpecialChar(kind);
+	overwriteSelection(lt);
 	if (!bv->insertInset(new_inset))
 		delete new_inset;
 	else
@@ -724,6 +734,8 @@
 			break;
 
 		bv->beforeChange(this);
+		// FIXME: WTF doesn't this work?
+		// overwriteSelection(bv->getLyXText());
 		insertInset(new InsetNewline);
 		update();
 		setCursor(cursor.par(), cursor.pos());
@@ -834,6 +846,8 @@
 
 	case LFUN_BREAKPARAGRAPH:
 		bv->beforeChange(this);
+		// FIXME: WTF doesn't this work?
+		// overwriteSelection(bv->getLyXText());
 		breakParagraph(bv->buffer()->paragraphs, 0);
 		update();
 		selection.cursor = cursor;
@@ -843,6 +857,8 @@
 
 	case LFUN_BREAKPARAGRAPHKEEPLAYOUT:
 		bv->beforeChange(this);
+		// FIXME: WTF doesn't this work?
+		// overwriteSelection(bv->getLyXText());
 		breakParagraph(bv->buffer()->paragraphs, 1);
 		update();
 		selection.cursor = cursor;
@@ -856,6 +872,8 @@
 		// Otherwise, do the same as LFUN_BREAKPARAGRAPH.
 		LyXCursor cur = cursor;
 		bv->beforeChange(this);
+		// FIXME: WTF doesn't this work?
+		// overwriteSelection(bv->getLyXText());
 		if (cur.pos() == 0) {
 			if (cur.par()->params().spaceTop() == VSpace(VSpace::NONE)) {
 				setParagraph(
@@ -1028,6 +1046,7 @@
 
 	case LFUN_PASTE: {
 		cmd.message(_("Paste"));
+		overwriteSelection(bv->getLyXText());
 		// clear the selection
 		bv->toggleSelection();
 		clearSelection();
@@ -1200,6 +1219,7 @@
 	}
 
 	case LFUN_QUOTE: {
+		overwriteSelection(bv->getLyXText());
 		ParagraphList::iterator pit = cursor.par();
 		lyx::pos_type pos = cursor.pos();
 		char c;
@@ -1221,6 +1241,7 @@
 	}
 
 	case LFUN_DATE_INSERT: {
+		overwriteSelection(bv->getLyXText());
 		time_t now_time_t = time(NULL);
 		struct tm * now_tm = localtime(&now_time_t);
 		setlocale(LC_TIME, "");

Reply via email to