Re: plans for LyX, was: fourth release of the LyXWinInstaller

2005-11-24 Thread Angus Leeming
[EMAIL PROTECTED] wrote:

 Hi Angus,
 
In fact, I've just done this ;-) Uwe, feel free to grab the updated
binaries and libraries for your installer.
 
 Thanks for the new installer!
 
 Have you included the latest qtwin library?

Yes.

 The menu entries are shown with  bold font which looks pretty ugly. I
 haven't tested the latest qtwin sources but the snapshot of 2005-10-31
 doesn't have this bug and, browsing through the recent patches, I see
 no reason why it should have changed since then.
 
 Just in case you are willing to build another installer, could you please
 include the documentation for LyX 1.3?

Hmmm. I never got the command line cvs working on Windows (never tried too
hard either) and have been using TortoiseCVS instead. However, the
configure script that pulls over the docs requires the command line cvs.

I suppose that I could grab them explicitly. I see lib/Makefile.am has

cvs -Q export -r BRANCH_1_3_X -d doc lyxdoc

I'll have a go.

 It would also be nice if you compiled the sources with
 --with-version-suffix (which helps people who switch between 1.4 and
 1.3). 

Hm. The problem here is the LyX User directory only, no?
C:\Documents and Settings\Angus\Application Data\LyX
Why don't we use

 string const get_default_user_support_dir(string const  home_dir)
 {
 #if defined (USE_WINDOWS_PACKAGING)
 (void)home_dir; // Silence warning about unused variable.

  string const user_dir =
  (string(PACKAGE) == lyx) ? LyX : PACKAGE;
  GetFolderPath win32_folder_path;
  return AddPath(win32_folder_path(GetFolderPath::APPDATA),
-user_dir);
+user_dir + '_' + VERSION);
 #elif defined (USE_MACOSX_PACKAGING)

which would give us 
C:\Documents and Settings\Angus\Application Data\LyX_1.3.7

Jean-Marc?

-- 
Angus



Re: plans for LyX, was: fourth release of the LyXWinInstaller

2005-11-24 Thread Jean-Marc Lasgouttes
 Angus == Angus Leeming [EMAIL PROTECTED] writes:

Angus Hm. The problem here is the LyX User directory only, no?
Angus Why don't we use
[...]
Angus which would give us C:\Documents and Settings\Angus\Application
Angus Data\LyX_1.3.7

First, the '_' is very un-windows-ish, it should be a space instead.

Second, I do not think users would be thrilled to have to copy their
application data every time they update LyX. Using LyX 1.3 would
probably be better.

In any case, I am not sure this is worth the trouble. You please
_some_ users with automatic code, and will undoubtlessly piss off some
other people.

Note that this could probably be an installer option (the installer
could set some env. variables, or pass options to LyX).

JMarc


Re: plans for LyX, was: fourth release of the LyXWinInstaller

2005-11-24 Thread Angus Leeming
Angus Leeming wrote:
 It would also be nice if you compiled the sources with
 --with-version-suffix (which helps people who switch between 1.4 and
 1.3).
 
 Hm. The problem here is the LyX User directory only, no?
 C:\Documents and Settings\Angus\Application Data\LyX
 Why don't we use
 
  string const get_default_user_support_dir(string const  home_dir)
  {
  #if defined (USE_WINDOWS_PACKAGING)
  (void)home_dir; // Silence warning about unused variable.
 
   string const user_dir =
   (string(PACKAGE) == lyx) ? LyX : PACKAGE;
   GetFolderPath win32_folder_path;
   return AddPath(win32_folder_path(GetFolderPath::APPDATA),
 -user_dir);
 +user_dir + '_' + VERSION);
  #elif defined (USE_MACOSX_PACKAGING)

Or rather

string const user_dir =
string(PACKAGE) == lyx ?
string(LyX) + '_' + VERSION : PACKAGE;

GetFolderPath win32_folder_path;
return AddPath(win32_folder_path(GetFolderPath::APPDATA),
   user_dir);

 which would give us
 C:\Documents and Settings\Angus\Application Data\LyX_1.3.7
 
 Jean-Marc?

-- 
Angus



Re: plans for LyX, was: fourth release of the LyXWinInstaller

2005-11-24 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:

 Angus == Angus Leeming [EMAIL PROTECTED]
 writes:
 
 Angus Hm. The problem here is the LyX User directory only, no?
 Angus Why don't we use
 [...]
 Angus which would give us C:\Documents and Settings\Angus\Application
 Angus Data\LyX_1.3.7
 
 First, the '_' is very un-windows-ish, it should be a space instead.

You're just trying to stress test any paths with spaces problems.

 Second, I do not think users would be thrilled to have to copy their
 application data every time they update LyX. Using LyX 1.3 would
 probably be better.

Right.

 In any case, I am not sure this is worth the trouble. You please
 _some_ users with automatic code, and will undoubtlessly piss off some
 other people.

Oh, sure. But, frankly, I quite like Michael and I don't like some others
who have pissed me off ;-)

 Note that this could probably be an installer option (the installer
 could set some env. variables, or pass options to LyX).

You mean that since LyX is invoked through a .bat file, Michael could move
his user support directory to LyX 1.3 and then invoke lyx with the
-userdir option?

I think you're right. Michael, over to you.

Just for interest, does anyone know the magic to modify this to extract
-userdir foo from any options that are passed in?

@echo off
if %LANG%== SET LANG=fr_FR
if %~1 == ~1 goto win95
start LyX C:\Program Files\LyX\bin\lyx.exe %*
goto end
:win95
start LyX C:\Program Files\LyX\bin\lyx.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
:end

-- 
Angus



amsart.layout (convertion from 1.3 to 1.4)

2005-11-24 Thread Jose' Matos
Hi,
while search for those cursed files without layout (the modern version 
of 
headless knights), I found bug 666: 
http://bugzilla.lyx.org/show_bug.cgi?id=666

There you can find a file from David that uses amsart layout. After my 
latest 
fixes that involved to support older tabular format 3 the last missing :-) I 
am able to load it in lyx 1.3 and after some removals from preamble the file 
shows correctly. Wow. :-)

This does not work for 1.4, apparently the Address style is deactivated 
in 
1.4 but there is no replacement for older versions.

Does the proper fix involves lyx2lyx? What should be done?

-- 
José Abílio


Re: [PATCH] Re: bug 1952/1953

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
 1/ make textInset return an InsetText object; Assert on inTexted()

Then I have to convert it back to InsetBase in undo.C to pass it to 
setInsetOwner. How can I do this?

 2/ the loop in undo.C should use normal iterators instead of
 const_iterators, so that the const_cast is not needed.

OK.

Jürgen


Re: [PATCH] Re: bug 1952/1953

2005-11-24 Thread Jean-Marc Lasgouttes
 Juergen == Juergen Spitzmueller [EMAIL PROTECTED] writes:

Juergen Jean-Marc Lasgouttes wrote:
 1/ make textInset return an InsetText object; Assert on inTexted()

Juergen Then I have to convert it back to InsetBase in undo.C to pass
Juergen it to setInsetOwner. How can I do this?

Why do you need that? Doesn't InsetText derive from InsetBase?

JMarc


Re: [PATCH] Re: bug 1952/1953

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
 Juergen Then I have to convert it back to InsetBase in undo.C to pass
 Juergen it to setInsetOwner. How can I do this?

 Why do you need that? Doesn't InsetText derive from InsetBase?

I just can't get it to compile. Attached is what I have now.
Or do you mean I should use a InsetBase * DocIterator::textInset() method and 
just return an insettext?

Jürgen
Index: dociterator.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/dociterator.C,v
retrieving revision 1.32
diff -p -u -r1.32 dociterator.C
--- dociterator.C	25 Oct 2005 09:14:11 -	1.32
+++ dociterator.C	24 Nov 2005 15:13:17 -
@@ -20,6 +20,8 @@
 
 #include mathed/math_data.h
 #include mathed/math_inset.h
+#include insets/insettabular.h
+#include insets/insettext.h
 
 #include boost/assert.hpp
 #include boost/current_function.hpp
@@ -87,6 +89,18 @@ InsetBase const * DocIterator::prevInset
 	if (inMathed())
 		return prevAtom().nucleus();
 	return paragraph().isInset(pos() - 1) ? paragraph().getInset(pos() - 1) : 0;
+}
+
+
+InsetText * DocIterator::textInset() const
+{
+	BOOST_ASSERT(inTexted());
+	// if we are in a tabular, we need the cell
+	if (inset().lyxCode() == InsetBase::TABULAR_CODE) {
+		InsetTabular  tabular = static_castInsetTabular(inset());
+		return tabular.cell(idx()).get();
+	}
+	return static_castInsetText*(inset());
 }
 
 
Index: dociterator.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/dociterator.h,v
retrieving revision 1.24
diff -p -u -r1.24 dociterator.h
--- dociterator.h	25 Oct 2005 09:14:11 -	1.24
+++ dociterator.h	24 Nov 2005 15:13:18 -
@@ -18,6 +18,7 @@
 #include iosfwd
 
 class LyXText;
+class InsetText;
 class MathAtom;
 class Paragraph;
 class Row;
@@ -164,6 +165,8 @@ public:
 	LyXText * text();
 	///
 	LyXText const * text() const;
+	/// the containing text inset (i.e. cell in tabular)
+	InsetText * textInset() const;
 	///
 	InsetBase * innerInsetOfType(int code) const;
 	///
Index: undo.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/undo.C,v
retrieving revision 1.68
diff -p -u -r1.68 undo.C
--- undo.C	13 Oct 2005 17:20:30 -	1.68
+++ undo.C	24 Nov 2005 15:13:19 -
@@ -187,10 +187,10 @@ bool textUndoOrRedo(BufferView  bv,
 
 		// this ugly stuff is needed until we get rid of the
 		// inset_owner backpointer
-		ParagraphList::const_iterator pit = undo.pars.begin();
-		ParagraphList::const_iterator end = undo.pars.end();
+		ParagraphList::iterator pit = undo.pars.begin();
+		ParagraphList::iterator const end = undo.pars.end();
 		for (; pit != end; ++pit)
-			const_castParagraph (*pit).setInsetOwner(dit.inset());
+			pit-setInsetOwner(dit.textInset());
 		plist.insert(first, undo.pars.begin(), undo.pars.end());
 	}
 



Re: [PATCH] Re: bug 1952/1953

2005-11-24 Thread Jean-Marc Lasgouttes
 Juergen == Juergen Spitzmueller [EMAIL PROTECTED] writes:

Juergen Jean-Marc Lasgouttes wrote: Then I have to convert it back to
Juergen InsetBase in undo.C to pass it to setInsetOwner. How can I do
Juergen this?
  Why do you need that? Doesn't InsetText derive from InsetBase?

Juergen I just can't get it to compile. Attached is what I have now.
Juergen Or do you mean I should use a InsetBase *
Juergen DocIterator::textInset() method and just return an insettext?

I think I see what you mean. OK, so let it return an InsetBase, but
rename the method to something like realInset().

JMarc


[PATCH] bug 2096: LyX file inserting is broken

2005-11-24 Thread Jean-Marc Lasgouttes

After a lot of head scratching (a first patch with cut and paste, plus
many ruminations on code merging), I came up with the following
patch to fix LyX file insertion. As an added bonus, it fixes the
situation where inInset could be NULL.

I'd appreciate if someone could give it a good testing.

JMarc

Index: src/BufferView_pimpl.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.599
diff -u -p -r1.599 BufferView_pimpl.C
--- src/BufferView_pimpl.C	7 Nov 2005 15:06:41 -	1.599
+++ src/BufferView_pimpl.C	24 Nov 2005 15:42:14 -
@@ -881,8 +881,10 @@ void BufferView::Pimpl::MenuInsertLyXFil
 	BOOST_ASSERT(cursor_.inTexted());
 
 	string const fname = MakeAbsPath(filename);
-	bool const res = buffer_-readFile(fname, cursor_.pit());
+	recordUndo(cursor_);
+	bool const res = buffer_-readFile(fname, cursor_.top());
 	resizeCurrentBuffer();
+	bv_-showErrorList(_(Parse));
 
 	string s = res ? _(Document %1$s inserted.)
 	   : _(Could not insert document %1$s);
Index: src/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2325
diff -u -p -r1.2325 ChangeLog
--- src/ChangeLog	17 Nov 2005 09:19:02 -	1.2325
+++ src/ChangeLog	24 Nov 2005 15:42:14 -
@@ -1,3 +1,16 @@
+2005-11-24  Jean-Marc Lasgouttes  [EMAIL PROTECTED]
+
+	Fix bug 2096.
+	
+	* text.C (read): take a pit_type parameter that indicates where
+	the new text should go.
+
+	* buffer.C (readDocument, readFile): take a CursorSlice as
+	parameter, and make sure it is correctly propagated.
+
+	* BufferView_pimpl.C (MenuInsertLyXFile): adapt to
+	Buffer::readFile changes; show error list at the end.
+
 2005-11-15  Jean-Marc Lasgouttes  [EMAIL PROTECTED]
 
 	* text.C (leftMargin): honor the NextNoIndent tag in layouts.
Index: src/buffer.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.629
diff -u -p -r1.629 buffer.C
--- src/buffer.C	13 Oct 2005 10:59:37 -	1.629
+++ src/buffer.C	24 Nov 2005 15:42:15 -
@@ -461,7 +461,7 @@ int Buffer::readHeader(LyXLex  lex)
 // Uwe C. Schroeder
 // changed to be public and have one parameter
 // Returns false if \end_document is not read (Asger)
-bool Buffer::readDocument(LyXLex  lex)
+bool Buffer::readDocument(LyXLex  lex, CursorSlice  slice)
 {
 	lex.next();
 	string const token = lex.getString();
@@ -470,7 +470,9 @@ bool Buffer::readDocument(LyXLex  lex)
 		error(ErrorItem(_(Document header error), s, -1, 0, 0));
 	}
 
-	if (paragraphs().empty()) {
+	bool const new_buffer = slice.text()-paragraphs().empty();
+
+	if (new_buffer) {
 		readHeader(lex);
 		if (!params().getLyXTextClass().load()) {
 			string theclass = params().getLyXTextClass().name();
@@ -488,7 +490,11 @@ bool Buffer::readDocument(LyXLex  lex)
 		tmpbuf.readHeader(lex);
 	}
 
-	return text().read(*this, lex);
+	bool const res = slice.text()-read(*this, lex, slice.pit());
+	for_each(slice.text()-paragraphs().begin(), 
+		 slice.text()-paragraphs().end(),
+		 bind(Paragraph::setInsetOwner, _1, slice.inset()));
+	return res;
 }
 
 
@@ -556,7 +562,8 @@ bool Buffer::readFile(string const  fil
 
 	// remove dummy empty par
 	paragraphs().clear();
-	bool ret = readFile(filename, paragraphs().size());
+	CursorSlice dummyslice(inset());
+	bool ret = readFile(filename, dummyslice);
 
 	// After we have read a file, we must ensure that the buffer
 	// language is set and used in the gui.
@@ -567,11 +574,11 @@ bool Buffer::readFile(string const  fil
 }
 
 
-bool Buffer::readFile(string const  filename, pit_type const pit)
+bool Buffer::readFile(string const  filename, CursorSlice  slice)
 {
 	LyXLex lex(0, 0);
 	lex.setFile(filename);
-	return readFile(lex, filename, pit);
+	return readFile(lex, filename, slice);
 }
 
 
@@ -587,7 +594,8 @@ void Buffer::fully_loaded(bool const val
 }
 
 
-bool Buffer::readFile(LyXLex  lex, string const  filename, pit_type const pit)
+bool Buffer::readFile(LyXLex  lex, string const  filename, 
+		  CursorSlice  slice)
 {
 	BOOST_ASSERT(!filename.empty());
 
@@ -668,14 +676,14 @@ bool Buffer::readFile(LyXLex  lex, stri
 	  filename));
 			return false;
 		} else {
-			bool const ret = readFile(tmpfile, pit);
+			bool const ret = readFile(tmpfile, slice);
 			// Do stuff with tmpfile name and buffer name here.
 			return ret;
 		}
 
 	}
 
-	if (readDocument(lex)) {
+	if (readDocument(lex, slice)) {
 		Alert::error(_(Document format failure),
 			 bformat(_(%1$s ended unexpectedly, which means
 that it is probably corrupted.),
Index: src/buffer.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.h,v
retrieving revision 1.193
diff -u -p -r1.193 buffer.h
--- src/buffer.h	17 Jul 2005 23:02:58 -	1.193
+++ 

Re: Missing latex classes in the lyx package

2005-11-24 Thread Jean-Marc Lasgouttes
 Edjard == Edjard Mota [EMAIL PROTECTED] writes:

Edjard  Could you, or someone, give the directions? I feel like
Edjard coding and would be more than pleased to help.
 
I do not really know, unfortunately. I guess a proposal of the UI we
want would be the first thing to do.

Do people use different templates for the same textclass, or can we
just have a 1:1 correspondence between the two?

This is 1.5 material, of course.

JMarc


Re: [Patch in bugzilla] for 1966, and others

2005-11-24 Thread Jean-Marc Lasgouttes
 Martin == Martin Vermeer [EMAIL PROTECTED] writes:

Martin Next is the bug that scrolling is irregular/too fast. If
Martin bugzilla were working, I could tell you what number :-(

If you know what you are doing, I guess this can go in.

JMarc


Re: Mac: LyX-1.3.x (gcc-4) crash on launch

2005-11-24 Thread Jean-Marc Lasgouttes
 Bennett == Bennett Helm [EMAIL PROTECTED] writes:

Bennett LyX-1.3.x refuses to compile on Mac with gcc  4.0; with
Bennett gcc-4.0.1, it compiles but crashes on launch. Here's what gdb
Bennett says:

A shot in the dark: what happens of you set 
#undef MODERN_STL_STREAMS
in src/config.h? I am not even sure this would compile...

JMarc


Re: [PATCH] Re: bug: indentation

2005-11-24 Thread Jean-Marc Lasgouttes
 Bennett == Bennett Helm [EMAIL PROTECTED] writes:

 The following patch fixes the regression for me. I'd appreciate if
 someone could test too (especially since the code is slightly
 simpler than what it was in 1.3.x).

Bennett Works for me.

Thanks. This got applied a few days ago.

JMarc


Re: [PATCH] Re: bug 1952/1953

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
 I think I see what you mean. OK, so let it return an InsetBase, but
 rename the method to something like realInset().

The attached patch works for me.

Jürgen
Index: dociterator.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/dociterator.C,v
retrieving revision 1.32
diff -p -u -r1.32 dociterator.C
--- dociterator.C	25 Oct 2005 09:14:11 -	1.32
+++ dociterator.C	24 Nov 2005 16:04:25 -
@@ -20,6 +20,7 @@
 
 #include mathed/math_data.h
 #include mathed/math_inset.h
+#include insets/insettabular.h
 
 #include boost/assert.hpp
 #include boost/current_function.hpp
@@ -87,6 +88,18 @@ InsetBase const * DocIterator::prevInset
 	if (inMathed())
 		return prevAtom().nucleus();
 	return paragraph().isInset(pos() - 1) ? paragraph().getInset(pos() - 1) : 0;
+}
+
+
+InsetBase * DocIterator::realInset() const
+{
+	BOOST_ASSERT(inTexted());
+	// if we are in a tabular, we need the cell
+	if (inset().lyxCode() == InsetBase::TABULAR_CODE) {
+		InsetTabular  tabular = static_castInsetTabular(inset());
+		return tabular.cell(idx()).get();
+	}
+	return inset();
 }
 
 
Index: dociterator.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/dociterator.h,v
retrieving revision 1.24
diff -p -u -r1.24 dociterator.h
--- dociterator.h	25 Oct 2005 09:14:11 -	1.24
+++ dociterator.h	24 Nov 2005 16:04:25 -
@@ -164,6 +164,8 @@ public:
 	LyXText * text();
 	///
 	LyXText const * text() const;
+	/// the containing inset or the cell, respectively
+	InsetBase * realInset() const;
 	///
 	InsetBase * innerInsetOfType(int code) const;
 	///
Index: undo.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/undo.C,v
retrieving revision 1.68
diff -p -u -r1.68 undo.C
--- undo.C	13 Oct 2005 17:20:30 -	1.68
+++ undo.C	24 Nov 2005 16:04:26 -
@@ -187,10 +187,10 @@ bool textUndoOrRedo(BufferView  bv,
 
 		// this ugly stuff is needed until we get rid of the
 		// inset_owner backpointer
-		ParagraphList::const_iterator pit = undo.pars.begin();
-		ParagraphList::const_iterator end = undo.pars.end();
+		ParagraphList::iterator pit = undo.pars.begin();
+		ParagraphList::iterator const end = undo.pars.end();
 		for (; pit != end; ++pit)
-			const_castParagraph (*pit).setInsetOwner(dit.inset());
+			pit-setInsetOwner(dit.realInset());
 		plist.insert(first, undo.pars.begin(), undo.pars.end());
 	}
 



Re: [PATCH] Re: bug 1952/1953

2005-11-24 Thread Jean-Marc Lasgouttes
 Juergen == Juergen Spitzmueller [EMAIL PROTECTED] writes:

Juergen Jean-Marc Lasgouttes wrote:
 I think I see what you mean. OK, so let it return an InsetBase, but
 rename the method to something like realInset().

Juergen The attached patch works for me.

Put it in, then.

JMarc


bug 1656

2005-11-24 Thread Juergen Spitzmueller
http://bugzilla.lyx.org/show_bug.cgi?id=1656

Shouldn't this patch be applied? Personally, I don't get the described patch, 
but Martin has confirmed that the problem is solved by the patch.

Jürgen


Re: bug 1656

2005-11-24 Thread Stephan Witt

Juergen Spitzmueller wrote:

http://bugzilla.lyx.org/show_bug.cgi?id=1656

Shouldn't this patch be applied? Personally, I don't get the described patch, 
but Martin has confirmed that the problem is solved by the patch.


Jürgen


Just in case nobody knows... I have no karma to apply it.

Stephan
---





Re: bug 1656

2005-11-24 Thread Jean-Marc Lasgouttes
 Juergen == Juergen Spitzmueller [EMAIL PROTECTED] writes:

Juergen http://bugzilla.lyx.org/show_bug.cgi?id=1656 Shouldn't this
Juergen patch be applied? Personally, I don't get the described
Juergen patch, but Martin has confirmed that the problem is solved by
Juergen the patch.

The only question I have about this patch is whether we lose something
when the session is closed while LyX is running and there are unsaved
files. What happens with or without the patch?

JMarc


[PATCH] disable LFUN_PASTE when there is nothing in clipboard

2005-11-24 Thread Jean-Marc Lasgouttes

This is a regression wrt 1.3.x. The patch is trivial, I am going to
commit soon unless someone complains.

JMarc

Index: src/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2326
diff -u -p -r1.2326 ChangeLog
--- src/ChangeLog	24 Nov 2005 16:22:38 -	1.2326
+++ src/ChangeLog	24 Nov 2005 16:44:58 -
@@ -1,3 +1,12 @@
+2005-11-24  Jean-Marc Lasgouttes  [EMAIL PROTECTED]
+
+	* CutAndPaste.C (numberOfSelections): new helper function.
+
+	* lyxfunc.C (getStatus): remove support for LFUN_COPY and LFUN_CUT.
+
+	* text3.C (getStatus): move code for LFUN_CUT and LFUN_COPY from
+	LyXFunc::getStatus; implement LFUN_PASTE.
+
 2005-11-17  Jürgen Spitzmüller  [EMAIL PROTECTED]
 
 	* dociterator.[Ch]: new member realInset() that returns the cell
Index: src/CutAndPaste.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/CutAndPaste.C,v
retrieving revision 1.158
diff -u -p -r1.158 CutAndPaste.C
--- src/CutAndPaste.C	12 Oct 2005 18:44:52 -	1.158
+++ src/CutAndPaste.C	24 Nov 2005 16:44:58 -
@@ -472,6 +472,12 @@ std::vectorstring const availableSelec
 }
 
 
+lyx::size_type numberOfSelections()
+{
+	return theCuts.size();
+}
+
+
 void cutSelection(LCursor  cur, bool doclear, bool realcut)
 {
 	// This doesn't make sense, if there is no selection
Index: src/CutAndPaste.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/CutAndPaste.h,v
retrieving revision 1.41
diff -u -p -r1.41 CutAndPaste.h
--- src/CutAndPaste.h	12 Oct 2005 18:44:52 -	1.41
+++ src/CutAndPaste.h	24 Nov 2005 16:44:58 -
@@ -32,6 +32,8 @@ namespace cap {
 ///
 std::vectorstd::string const availableSelections(Buffer const  buffer);
 ///
+lyx::size_type numberOfSelections();
+///
 std::string getSelection(Buffer const  buffer, size_t sel_index);
 
 ///
Index: src/lyxfunc.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.672
diff -u -p -r1.672 lyxfunc.C
--- src/lyxfunc.C	17 Nov 2005 08:41:55 -	1.672
+++ src/lyxfunc.C	24 Nov 2005 16:44:58 -
@@ -411,10 +411,6 @@ FuncStatus LyXFunc::getStatus(FuncReques
 		enable = cmd.argument == custom
 			|| Exporter::IsExportable(*buf, cmd.argument);
 		break;
-	case LFUN_CUT:
-	case LFUN_COPY:
-		enable = cur.selection();
-		break;
 
 	case LFUN_RUNCHKTEX:
 		enable = buf-isLatex()  lyxrc.chktex_command != none;
Index: src/text3.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.318
diff -u -p -r1.318 text3.C
--- src/text3.C	17 Nov 2005 08:41:56 -	1.318
+++ src/text3.C	24 Nov 2005 16:44:58 -
@@ -1765,6 +1765,15 @@ bool LyXText::getStatus(LCursor  cur, F
 		flag.setOnOff(font.family() == LyXFont::TYPEWRITER_FAMILY);
 		return true;
 
+	case LFUN_CUT:
+	case LFUN_COPY:
+		enable = cur.selection();
+		break;
+
+	case LFUN_PASTE:
+		enable = lyx::cap::numberOfSelections()  0;
+		break;
+
 	case LFUN_DELETE_WORD_FORWARD:
 	case LFUN_DELETE_WORD_BACKWARD:
 	case LFUN_DELETE_LINE_FORWARD:
@@ -1808,9 +1817,6 @@ bool LyXText::getStatus(LCursor  cur, F
 	case LFUN_LOWCASE_WORD:
 	case LFUN_CAPITALIZE_WORD:
 	case LFUN_TRANSPOSE_CHARS:
-	case LFUN_PASTE:
-	case LFUN_CUT:
-	case LFUN_COPY:
 	case LFUN_GETXY:
 	case LFUN_SETXY:
 	case LFUN_GETFONT:


[PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Jean-Marc Lasgouttes

What about this? Of course, it would be better to add a virtual
function to InsetBase like asString that either uses plaintext or does
nothing, but I think this is good enough for now.

What do you think?

BTW, this also fixes 2028. 617, which is related should be marked as
fixedintrunk, I think.

JMarc

Index: src/paragraph.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.416
diff -u -p -r1.416 paragraph.C
--- src/paragraph.C	17 Nov 2005 08:41:56 -	1.416
+++ src/paragraph.C	24 Nov 2005 17:02:47 -
@@ -1597,8 +1597,24 @@ string const Paragraph::asString(Buffer 
 		value_type const c = getUChar(buffer.params(), i);
 		if (IsPrintable(c))
 			os  c;
-		else if (c == META_INSET)
-			getInset(i)-plaintext(buffer, os, runparams);
+		else if (c == META_INSET) {
+			InsetBase const * inset = getInset(i);
+			switch (inset-lyxCode()) {
+			case InsetBase::QUOTE_CODE:
+			case InsetBase::REF_CODE:
+			case InsetBase::URL_CODE:
+			case InsetBase::ACCENT_CODE:
+			case InsetBase::MATH_CODE:
+			case InsetBase::SPACE_CODE:
+			case InsetBase::SPECIALCHAR_CODE:
+			case InsetBase::CITE_CODE:
+			case InsetBase::CHARSTYLE_CODE:
+inset-plaintext(buffer, os, runparams);
+break;
+			default:
+break;
+			}
+		}
 	}
 
 	return os.str();


Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
 What about this? Of course, it would be better to add a virtual
 function to InsetBase like asString that either uses plaintext or does
 nothing, but I think this is good enough for now.

 What do you think?

I think it's ok, though I'd also prefer a virtual function.

Jürgen


Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Jean-Marc Lasgouttes
 Juergen == Juergen Spitzmueller [EMAIL PROTECTED] writes:

Juergen Jean-Marc Lasgouttes wrote:
 What about this? Of course, it would be better to add a virtual
 function to InsetBase like asString that either uses plaintext or
 does nothing, but I think this is good enough for now.
 
 What do you think?

Juergen I think it's ok, though I'd also prefer a virtual function.

Do you feel like doing this tedious-but-trivial task?

JMarc


Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
 Juergen I think it's ok, though I'd also prefer a virtual function.

 Do you feel like doing this tedious-but-trivial task?

If you have a look at bug 1953.

Jürgen


Re: [PATCH] disable LFUN_PASTE when there is nothing in clipboard

2005-11-24 Thread Georg Baum
Jean-Marc Lasgouttes wrote:

 This is a regression wrt 1.3.x. The patch is trivial, I am going to
 commit soon unless someone complains.

Very nice. I stumbled over this some days ago too, but was too busy to fix
it.


Georg



Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Jean-Marc Lasgouttes
 Juergen == Juergen Spitzmueller [EMAIL PROTECTED] writes:

Juergen Jean-Marc Lasgouttes wrote: I think it's ok, though I'd also
Juergen prefer a virtual function.
  Do you feel like doing this tedious-but-trivial task?

Juergen If you have a look at bug 1953.

What about disabling changing to variable width cell if there are
several paragraphs?

A simpler fix could be to put this bug on the 1.4.1 radar. It is
rather obscure.

JMarc


Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Georg Baum
Juergen Spitzmueller wrote:

 I think it's ok, though I'd also prefer a virtual function.

Me too. The disadvantage is of course that you need to touch more files, but
I think that it is a safe change.

I think we should create a prize for simple patches that fix several bugs at
once :-)


Georg



Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
 Juergen If you have a look at bug 1953.

 What about disabling changing to variable width cell if there are
 several paragraphs?

I think this is not very user-friendly.
I thought about calling mergeParagraphs for all paragraphs in the cell 
somewhere. But first I'd like to understand what exactly happend in 1.3. I 
still don't understand where the paragraphs are merged there.

 A simpler fix could be to put this bug on the 1.4.1 radar. It is
 rather obscure.

I think it should be fixed for 1.4, if possible.

Jürgen



Re: bug 1656

2005-11-24 Thread Stephan Witt

Jean-Marc Lasgouttes wrote:

Juergen == Juergen Spitzmueller [EMAIL PROTECTED] writes:



Juergen http://bugzilla.lyx.org/show_bug.cgi?id=1656 Shouldn't this
Juergen patch be applied? Personally, I don't get the described
Juergen patch, but Martin has confirmed that the problem is solved by
Juergen the patch.

The only question I have about this patch is whether we lose something
when the session is closed while LyX is running and there are unsaved
files. What happens with or without the patch?


I'm comiling the cvs-updated 1.4.x tree now. I'll answer your question
tomorrow, I hope.

Stephan
---


Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Georg Baum
Juergen Spitzmueller wrote:

 I thought about calling mergeParagraphs for all paragraphs in the cell
 somewhere. But first I'd like to understand what exactly happend in 1.3. I
 still don't understand where the paragraphs are merged there.

Me neither. I have spent some time trying to find it out, but found nothing.
What I then did was to append this to InsetText::setAutoBreakRows:

// merge all paragraphs to one
BufferParams const  bp = text_.buffer_owner-params();
while (paragraphs().size()  1)
mergeParagraph(bp, paragraphs(), 0);

Unfortunately it resulted in some crahes that I could not yet track down.

 A simpler fix could be to put this bug on the 1.4.1 radar. It is
 rather obscure.
 
 I think it should be fixed for 1.4, if possible.

I agree. It is a regression, and it is IMHO not too unusual to change a
column fom fixed width to floating.


Georg



Re: Missing latex classes in the lyx package

2005-11-24 Thread Edjard Mota


Jean-Marc Lasgouttes [EMAIL PROTECTED] escreveu:
 Edjard == Edjard Mota writes:

Edjard Could you, or someone, give the directions? I feel like
Edjard coding and would be more than pleased to help.

JMarc I do not really know, unfortunately. I guess a proposal of the 
  JMarc UI we want would be the first thing to do.

  Ok. Sorry about my ignorance, but how do we make such a proposal?
  
JMarc Do people use different templates for the same textclass, or 
  JMarc can we just have a 1:1 correspondence between the two?

  It is possible since it would be nice to allow different customizations
  for the same texclass. But we need some feedback from people who have been 
creating templates.
   
  JMarc This is 1.5 material, of course.

  Ok, I search for it.
  
JMarc

  br
   
  Edjard



-
 Yahoo! Acesso Grátis: Internet rápida e grátis.
Instale o discador agora!

Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Juergen Spitzmueller
Georg Baum wrote:
 Me neither. I have spent some time trying to find it out, but found
 nothing. What I then did was to append this to InsetText::setAutoBreakRows:

         // merge all paragraphs to one
         BufferParams const  bp = text_.buffer_owner-params();
         while (paragraphs().size()  1)
                 mergeParagraph(bp, paragraphs(), 0);

This is what I had in mind, too.

 Unfortunately it resulted in some crahes that I could not yet track down.

Too bad.

Jürgen


Re: plans for LyX, was: fourth release of the LyXWinInstaller

2005-11-24 Thread Michael Gerz

Angus Leeming wrote:


The menu entries are shown with  bold font which looks pretty ugly. I
haven't tested the latest qtwin sources but the snapshot of 2005-10-31
doesn't have this bug and, browsing through the recent patches, I see
no reason why it should have changed since then.
   

I am puzzled. I just compiled the lastest CVS of qtwin. If I start its 
designer, the menu items (File, Edit, ...) have normal font, whereas 
menu items in your LyX 1.3.7cvs have bold font. What does 
qt-3/bin/designer look like on your machine?



Hmmm. I never got the command line cvs working on Windows (never tried too
hard either) and have been using TortoiseCVS instead. However, the
configure script that pulls over the docs requires the command line cvs.

I suppose that I could grab them explicitly. I see lib/Makefile.am has

   cvs -Q export -r BRANCH_1_3_X -d doc lyxdoc

I'll have a go.
 



Why don't you use cvs from the MSYS package? I don't know what option 
-Q means but the rest looks reasonable, in particular -r BRANCH_1_3_X.



It would also be nice if you compiled the sources with
--with-version-suffix (which helps people who switch between 1.4 and
1.3). 
   



Hm. The problem here is the LyX User directory only, no?
   C:\Documents and Settings\Angus\Application Data\LyX
Why don't we use
   
string const get_default_user_support_dir(string const  home_dir)

{
#if defined (USE_WINDOWS_PACKAGING)
(void)home_dir; // Silence warning about unused variable.

 string const user_dir =
 (string(PACKAGE) == lyx) ? LyX : PACKAGE;
 GetFolderPath win32_folder_path;
 return AddPath(win32_folder_path(GetFolderPath::APPDATA),
-user_dir);
+user_dir + '_' + VERSION);
#elif defined (USE_MACOSX_PACKAGING)

which would give us 
   C:\Documents and Settings\Angus\Application Data\LyX_1.3.7
 



Hmmm, I was pretty sure that --with-version-suffix works without any 
code change. Please ignore my request. Actually, it is enough if _I_ use 
--with-version-suffix for LyX 1.4.0.


Thanks for all the effort!

Michael



Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
 Do you feel like doing this tedious-but-trivial task?

What do you think about the attached?
There's also a plaintext member in formulamacro. Should this be considered, 
too?

Jürgen
Index: paragraph.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.416
diff -p -u -r1.416 paragraph.C
--- paragraph.C	17 Nov 2005 08:41:56 -	1.416
+++ paragraph.C	24 Nov 2005 19:28:38 -
@@ -1598,7 +1598,7 @@ string const Paragraph::asString(Buffer 
 		if (IsPrintable(c))
 			os  c;
 		else if (c == META_INSET)
-			getInset(i)-plaintext(buffer, os, runparams);
+			getInset(i)-tocString(buffer, os, runparams);
 	}
 
 	return os.str();
Index: insets/insetbase.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbase.h,v
retrieving revision 1.61
diff -p -u -r1.61 insetbase.h
--- insets/insetbase.h	17 Nov 2005 08:41:53 -	1.61
+++ insets/insetbase.h	24 Nov 2005 19:28:42 -
@@ -191,6 +191,9 @@ public:
 	/// docbook output
 	virtual int docbook(Buffer const , std::ostream  os,
 		OutputParams const ) const;
+	/// the string that is passed to the TOC
+	virtual int tocString(Buffer const , std::ostream ,
+		OutputParams const ) const { return 0; };
 
 	/** This enum indicates by which means the inset can be modified:
 	- NOT_EDITABLE: the inset's content can not be modified at all 
Index: insets/insetcharstyle.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcharstyle.C,v
retrieving revision 1.38
diff -p -u -r1.38 insetcharstyle.C
--- insets/insetcharstyle.C	2 Nov 2005 13:54:33 -	1.38
+++ insets/insetcharstyle.C	24 Nov 2005 19:28:43 -
@@ -316,6 +316,13 @@ int InsetCharStyle::plaintext(Buffer con
 }
 
 
+int InsetCharStyle::tocString(Buffer const  buf, ostream  os,
+		   OutputParams const  op) const
+{
+	return plaintext(buf, os, op);
+}
+
+
 void InsetCharStyle::validate(LaTeXFeatures  features) const
 {
 	// Force inclusion of preamble snippet in layout file
Index: insets/insetcharstyle.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcharstyle.h,v
retrieving revision 1.15
diff -p -u -r1.15 insetcharstyle.h
--- insets/insetcharstyle.h	10 Sep 2005 06:51:54 -	1.15
+++ insets/insetcharstyle.h	24 Nov 2005 19:28:43 -
@@ -80,6 +80,9 @@ public:
 	///
 	int plaintext(Buffer const , std::ostream ,
 		  OutputParams const ) const;
+	/// the string that is passed to the TOC
+	virtual int tocString(Buffer const , std::ostream  os,
+		OutputParams const ) const;
 	///
 	void validate(LaTeXFeatures ) const;
 
Index: insets/insetcite.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcite.C,v
retrieving revision 1.88
diff -p -u -r1.88 insetcite.C
--- insets/insetcite.C	26 Oct 2004 21:16:44 -	1.88
+++ insets/insetcite.C	24 Nov 2005 19:28:43 -
@@ -353,6 +353,13 @@ int InsetCitation::docbook(Buffer const 
 }
 
 
+int InsetCitation::tocString(Buffer const  buf, ostream  os,
+		   OutputParams const  op) const
+{
+	return plaintext(buf, os, op);
+}
+
+
 // Have to overwrite the default InsetCommand method in order to check that
 // the \cite command is valid. Eg, the user has natbib enabled, inputs some
 // citations and then changes his mind, turning natbib support off. The output
Index: insets/insetcite.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcite.h,v
retrieving revision 1.56
diff -p -u -r1.56 insetcite.h
--- insets/insetcite.h	19 Jan 2005 15:03:30 -	1.56
+++ insets/insetcite.h	24 Nov 2005 19:28:43 -
@@ -38,6 +38,9 @@ public:
 	///
 	int docbook(Buffer const , std::ostream ,
 		  OutputParams const ) const;
+	/// the string that is passed to the TOC
+	virtual int tocString(Buffer const , std::ostream  os,
+		OutputParams const ) const;
 	///
 	void validate(LaTeXFeatures ) const;
 
Index: insets/insetlatexaccent.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlatexaccent.C,v
retrieving revision 1.96
diff -p -u -r1.96 insetlatexaccent.C
--- insets/insetlatexaccent.C	17 May 2005 11:11:45 -	1.96
+++ insets/insetlatexaccent.C	24 Nov 2005 19:28:44 -
@@ -601,6 +601,13 @@ int InsetLatexAccent::docbook(Buffer con
 }
 
 
+int InsetLatexAccent::tocString(Buffer const  buf, ostream  os,
+		   OutputParams const  op) const
+{
+	return plaintext(buf, os, op);
+}
+
+
 bool InsetLatexAccent::directWrite() const
 {
 	return true;
Index: insets/insetlatexaccent.h
===
RCS file: 

Re: [PATCH] bug 2096: LyX file inserting is broken

2005-11-24 Thread Georg Baum
Am Donnerstag, 24. November 2005 16:47 schrieb Jean-Marc Lasgouttes:
 
 After a lot of head scratching (a first patch with cut and paste, plus
 many ruminations on code merging), I came up with the following
 patch to fix LyX file insertion. As an added bonus, it fixes the
 situation where inInset could be NULL.
 
 I'd appreciate if someone could give it a good testing.

It works if the cursor is in a new empty paragraph.
It tries to eat all available memory (and more) if the cursor is inside a 
section.
Unavailable layouts are parsed as errors and not converted as in cut and 
paste.

I read your comment at http://bugzilla.lyx.org/show_bug.cgi?id=2096 and 
actually like the paste solution much better, because we can use the 
cut-and-paste mechanism that changes layouts, does necessary conversions 
for ERT etc. Attached is a patch that implements this approach without 
cluttering the clipboard and with displaying of error messages. The only 
drawback I could find is that it inserts an additional paragraph if the 
inserted file contains more than one paragraph.


Georg
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/buffer.C lyx-1.4-cvs/src/buffer.C
--- lyx-1.4-clean/src/buffer.C	2005-10-13 20:30:20.0 +0200
+++ lyx-1.4-cvs/src/buffer.C	2005-11-24 20:29:55.0 +0100
@@ -556,7 +556,9 @@ bool Buffer::readFile(string const  fil
 
 	// remove dummy empty par
 	paragraphs().clear();
-	bool ret = readFile(filename, paragraphs().size());
+	LyXLex lex(0, 0);
+	lex.setFile(filename);
+	bool ret = readFile(lex, filename);
 
 	// After we have read a file, we must ensure that the buffer
 	// language is set and used in the gui.
@@ -567,14 +569,6 @@ bool Buffer::readFile(string const  fil
 }
 
 
-bool Buffer::readFile(string const  filename, pit_type const pit)
-{
-	LyXLex lex(0, 0);
-	lex.setFile(filename);
-	return readFile(lex, filename, pit);
-}
-
-
 bool Buffer::fully_loaded() const
 {
 	return pimpl_-file_fully_loaded;
@@ -587,7 +581,7 @@ void Buffer::fully_loaded(bool const val
 }
 
 
-bool Buffer::readFile(LyXLex  lex, string const  filename, pit_type const pit)
+bool Buffer::readFile(LyXLex  lex, string const  filename)
 {
 	BOOST_ASSERT(!filename.empty());
 
@@ -668,7 +662,7 @@ bool Buffer::readFile(LyXLex  lex, stri
 	  filename));
 			return false;
 		} else {
-			bool const ret = readFile(tmpfile, pit);
+			bool const ret = readFile(tmpfile);
 			// Do stuff with tmpfile name and buffer name here.
 			return ret;
 		}
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/buffer.h lyx-1.4-cvs/src/buffer.h
--- lyx-1.4-clean/src/buffer.h	2005-07-18 21:19:31.0 +0200
+++ lyx-1.4-cvs/src/buffer.h	2005-11-24 20:29:55.0 +0100
@@ -93,8 +93,6 @@ public:
 	/// load a new file
 	bool readFile(std::string const  filename);
 
-	bool readFile(std::string const  filename, lyx::pit_type pit);
-
 	/// read the header, returns number of unknown tokens
 	int readHeader(LyXLex  lex);
 
@@ -341,8 +339,7 @@ private:
 	\param par if != 0 insert the file.
 	\return \c false if method fails.
 	*/
-	bool readFile(LyXLex , std::string const  filename,
-		  lyx::pit_type pit);
+	bool readFile(LyXLex , std::string const  filename);
 
 	bool do_writeFile(std::ostream  ofs) const;
 
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/BufferView.C lyx-1.4-cvs/src/BufferView.C
--- lyx-1.4-clean/src/BufferView.C	2005-07-16 10:58:21.0 +0200
+++ lyx-1.4-cvs/src/BufferView.C	2005-11-24 20:55:08.0 +0100
@@ -114,9 +114,9 @@ void BufferView::newFile(string const  
 }
 
 
-bool BufferView::loadLyXFile(string const  fn, bool tl)
+bool BufferView::loadLyXFile(string const  fn, bool tl, bool se)
 {
-	return pimpl_-loadLyXFile(fn, tl);
+	return pimpl_-loadLyXFile(fn, tl, se);
 }
 
 
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/bufferview_funcs.C lyx-1.4-cvs/src/bufferview_funcs.C
--- lyx-1.4-clean/src/bufferview_funcs.C	2005-11-10 20:37:39.0 +0100
+++ lyx-1.4-cvs/src/bufferview_funcs.C	2005-11-24 20:29:55.0 +0100
@@ -205,8 +205,13 @@ Point coordOffset(DocIterator const  di
 Point getPos(DocIterator const  dit, bool boundary)
 {
 	CursorSlice const  bot = dit.bottom();
-	CoordCache::InnerParPosCache const  cache =
-		theCoords.getParPos().find(bot.text())-second;
+	CoordCache::ParPosCache::const_iterator cit =
+		theCoords.getParPos().find(bot.text());
+	if (cit == theCoords.getParPos().end()) {
+		//lyxerr  cursor out of view  std::endl;
+		return Point(-1, -1);
+	}
+	CoordCache::InnerParPosCache const  cache = cit-second;
 	CoordCache::InnerParPosCache::const_iterator it = cache.find(bot.pit());
 	if (it == cache.end()) {
 		//lyxerr  cursor out of view  std::endl;
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/BufferView.h lyx-1.4-cvs/src/BufferView.h
--- lyx-1.4-clean/src/BufferView.h	2005-06-10 18:46:10.0 +0200
+++ lyx-1.4-cvs/src/BufferView.h	2005-11-24 20:29:55.0 +0100
@@ -95,7 +95,8 @@ public:
 	void newFile(std::string const  fname, std::string const  tname,
 		   

Re: [Patch in bugzilla] for 1966, and others

2005-11-24 Thread Martin Vermeer
On Thu, Nov 24, 2005 at 04:54:23PM +0100, Jean-Marc Lasgouttes wrote:
  Martin == Martin Vermeer [EMAIL PROTECTED] writes:
 
 Martin Next is the bug that scrolling is irregular/too fast. If
 Martin bugzilla were working, I could tell you what number :-(
 
 If you know what you are doing, I guess this can go in.

Thanks for the confidence, but I would like the people who filed the
complaint to verify that this indeed addresses it (1966). It does 
improve LyX behaviour though, even if it would not.

Also I want opinions on the 200 ms - 500 ms thing. What is a reasonable
value?

- Martin



pgpClaAjw7FyK.pgp
Description: PGP signature


Re: plans for LyX, was: fourth release of the LyXWinInstaller

2005-11-24 Thread Angus Leeming
Michael Gerz wrote:
 Angus Leeming wrote:
The menu entries are shown with  bold font which looks pretty ugly. I
haven't tested the latest qtwin sources but the snapshot of 2005-10-31
doesn't have this bug and, browsing through the recent patches, I see
no reason why it should have changed since then.

 I am puzzled. I just compiled the lastest CVS of qtwin. If I start its
 designer, the menu items (File, Edit, ...) have normal font, whereas
 menu items in your LyX 1.3.7cvs have bold font. What does
 qt-3/bin/designer look like on your machine?

Why not substitute your qt_mt3.dll for mine and see how LyX looks then?

 Why don't you use cvs from the MSYS package?

It can't get through the Windows/Norton firewalls.

 Hmmm, I was pretty sure that --with-version-suffix works without any
 code change.

It does. But then lyx.exe is lyx_1.3.7cvs.exe, etc.

-- 
Angus



Re: plans for LyX, was: fourth release of the LyXWinInstaller

2005-11-24 Thread Angus Leeming
[EMAIL PROTECTED] wrote:

> Hi Angus,
> 
>>In fact, I've just done this ;-) Uwe, feel free to grab the updated
>>binaries and libraries for your installer.
> 
> Thanks for the new installer!
> 
> Have you included the latest qtwin library?

Yes.

> The menu entries are shown with  bold font which looks pretty ugly. I
> haven't tested the latest qtwin sources but the snapshot of 2005-10-31
> doesn't have this "bug" and, browsing through the recent patches, I see
> no reason why it should have changed since then.
> 
> Just in case you are willing to build another installer, could you please
> include the documentation for LyX 1.3?

Hmmm. I never got the command line cvs working on Windows (never tried too
hard either) and have been using TortoiseCVS instead. However, the
configure script that pulls over the docs requires the command line cvs.

I suppose that I could grab them explicitly. I see lib/Makefile.am has

cvs -Q export -r BRANCH_1_3_X -d doc lyxdoc

I'll have a go.

> It would also be nice if you compiled the sources with
> --with-version-suffix (which helps people who switch between 1.4 and
> 1.3). 

Hm. The problem here is the LyX User directory only, no?
C:\Documents and Settings\Angus\Application Data\LyX
Why don't we use

 string const get_default_user_support_dir(string const & home_dir)
 {
 #if defined (USE_WINDOWS_PACKAGING)
 (void)home_dir; // Silence warning about unused variable.

  string const user_dir =
  (string(PACKAGE) == "lyx") ? "LyX" : PACKAGE;
  GetFolderPath win32_folder_path;
  return AddPath(win32_folder_path(GetFolderPath::APPDATA),
-user_dir);
+user_dir + '_' + VERSION);
 #elif defined (USE_MACOSX_PACKAGING)

which would give us 
C:\Documents and Settings\Angus\Application Data\LyX_1.3.7

Jean-Marc?

-- 
Angus



Re: plans for LyX, was: fourth release of the LyXWinInstaller

2005-11-24 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> Hm. The problem here is the LyX User directory only, no?
Angus> Why don't we use
[...]
Angus> which would give us C:\Documents and Settings\Angus\Application
Angus> Data\LyX_1.3.7

First, the '_' is very un-windows-ish, it should be a space instead.

Second, I do not think users would be thrilled to have to copy their
application data every time they update LyX. Using "LyX 1.3" would
probably be better.

In any case, I am not sure this is worth the trouble. You please
_some_ users with automatic code, and will undoubtlessly piss off some
other people.

Note that this could probably be an installer option (the installer
could set some env. variables, or pass options to LyX).

JMarc


Re: plans for LyX, was: fourth release of the LyXWinInstaller

2005-11-24 Thread Angus Leeming
Angus Leeming wrote:
>> It would also be nice if you compiled the sources with
>> --with-version-suffix (which helps people who switch between 1.4 and
>> 1.3).
> 
> Hm. The problem here is the LyX User directory only, no?
> C:\Documents and Settings\Angus\Application Data\LyX
> Why don't we use
> 
>  string const get_default_user_support_dir(string const & home_dir)
>  {
>  #if defined (USE_WINDOWS_PACKAGING)
>  (void)home_dir; // Silence warning about unused variable.
> 
>   string const user_dir =
>   (string(PACKAGE) == "lyx") ? "LyX" : PACKAGE;
>   GetFolderPath win32_folder_path;
>   return AddPath(win32_folder_path(GetFolderPath::APPDATA),
> -user_dir);
> +user_dir + '_' + VERSION);
>  #elif defined (USE_MACOSX_PACKAGING)

Or rather

string const user_dir =
string(PACKAGE) == "lyx" ?
string("LyX") + '_' + VERSION : PACKAGE;

GetFolderPath win32_folder_path;
return AddPath(win32_folder_path(GetFolderPath::APPDATA),
   user_dir);

> which would give us
> C:\Documents and Settings\Angus\Application Data\LyX_1.3.7
> 
> Jean-Marc?

-- 
Angus



Re: plans for LyX, was: fourth release of the LyXWinInstaller

2005-11-24 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:

>> "Angus" == Angus Leeming <[EMAIL PROTECTED]>
>> writes:
> 
> Angus> Hm. The problem here is the LyX User directory only, no?
> Angus> Why don't we use
> [...]
> Angus> which would give us C:\Documents and Settings\Angus\Application
> Angus> Data\LyX_1.3.7
> 
> First, the '_' is very un-windows-ish, it should be a space instead.

You're just trying to stress test any "paths with spaces" problems.

> Second, I do not think users would be thrilled to have to copy their
> application data every time they update LyX. Using "LyX 1.3" would
> probably be better.

Right.

> In any case, I am not sure this is worth the trouble. You please
> _some_ users with automatic code, and will undoubtlessly piss off some
> other people.

Oh, sure. But, frankly, I quite like Michael and I don't like some others
who have pissed me off ;-)

> Note that this could probably be an installer option (the installer
> could set some env. variables, or pass options to LyX).

You mean that since LyX is invoked through a .bat file, Michael could move
his user support directory to "LyX 1.3" and then invoke lyx with the
-userdir option?

I think you're right. Michael, over to you.

Just for interest, does anyone know the magic to modify this to extract
"-userdir foo" from any options that are passed in?

@echo off
if "%LANG%"=="" SET LANG=fr_FR
if "%~1" == "~1" goto win95
start "LyX" "C:\Program Files\LyX\bin\lyx.exe" %*
goto end
:win95
start "LyX" "C:\Program Files\LyX\bin\lyx.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9
:end

-- 
Angus



amsart.layout (convertion from 1.3 to 1.4)

2005-11-24 Thread Jose' Matos
Hi,
while search for those cursed files without layout (the modern version 
of 
headless knights), I found bug 666: 
http://bugzilla.lyx.org/show_bug.cgi?id=666

There you can find a file from David that uses amsart layout. After my 
latest 
fixes that involved to support older tabular format 3 the last missing :-) I 
am able to load it in lyx 1.3 and after some removals from preamble the file 
shows correctly. Wow. :-)

This does not work for 1.4, apparently the Address style is deactivated 
in 
1.4 but there is no replacement for older versions.

Does the proper fix involves lyx2lyx? What should be done?

-- 
José Abílio


Re: [PATCH] Re: bug 1952/1953

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
> 1/ make textInset return an InsetText object; Assert on inTexted()

Then I have to convert it back to InsetBase in undo.C to pass it to 
setInsetOwner. How can I do this?

> 2/ the loop in undo.C should use normal iterators instead of
> const_iterators, so that the const_cast is not needed.

OK.

Jürgen


Re: [PATCH] Re: bug 1952/1953

2005-11-24 Thread Jean-Marc Lasgouttes
> "Juergen" == Juergen Spitzmueller <[EMAIL PROTECTED]> writes:

Juergen> Jean-Marc Lasgouttes wrote:
>> 1/ make textInset return an InsetText object; Assert on inTexted()

Juergen> Then I have to convert it back to InsetBase in undo.C to pass
Juergen> it to setInsetOwner. How can I do this?

Why do you need that? Doesn't InsetText derive from InsetBase?

JMarc


Re: [PATCH] Re: bug 1952/1953

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
> Juergen> Then I have to convert it back to InsetBase in undo.C to pass
> Juergen> it to setInsetOwner. How can I do this?
>
> Why do you need that? Doesn't InsetText derive from InsetBase?

I just can't get it to compile. Attached is what I have now.
Or do you mean I should use a InsetBase * DocIterator::textInset() method and 
just return an insettext?

Jürgen
Index: dociterator.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/dociterator.C,v
retrieving revision 1.32
diff -p -u -r1.32 dociterator.C
--- dociterator.C	25 Oct 2005 09:14:11 -	1.32
+++ dociterator.C	24 Nov 2005 15:13:17 -
@@ -20,6 +20,8 @@
 
 #include "mathed/math_data.h"
 #include "mathed/math_inset.h"
+#include "insets/insettabular.h"
+#include "insets/insettext.h"
 
 #include 
 #include 
@@ -87,6 +89,18 @@ InsetBase const * DocIterator::prevInset
 	if (inMathed())
 		return prevAtom().nucleus();
 	return paragraph().isInset(pos() - 1) ? paragraph().getInset(pos() - 1) : 0;
+}
+
+
+InsetText * DocIterator::textInset() const
+{
+	BOOST_ASSERT(inTexted());
+	// if we are in a tabular, we need the cell
+	if (inset().lyxCode() == InsetBase::TABULAR_CODE) {
+		InsetTabular & tabular = static_cast(inset());
+		return tabular.cell(idx()).get();
+	}
+	return static_cast(());
 }
 
 
Index: dociterator.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/dociterator.h,v
retrieving revision 1.24
diff -p -u -r1.24 dociterator.h
--- dociterator.h	25 Oct 2005 09:14:11 -	1.24
+++ dociterator.h	24 Nov 2005 15:13:18 -
@@ -18,6 +18,7 @@
 #include 
 
 class LyXText;
+class InsetText;
 class MathAtom;
 class Paragraph;
 class Row;
@@ -164,6 +165,8 @@ public:
 	LyXText * text();
 	///
 	LyXText const * text() const;
+	/// the containing text inset (i.e. cell in tabular)
+	InsetText * textInset() const;
 	///
 	InsetBase * innerInsetOfType(int code) const;
 	///
Index: undo.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/undo.C,v
retrieving revision 1.68
diff -p -u -r1.68 undo.C
--- undo.C	13 Oct 2005 17:20:30 -	1.68
+++ undo.C	24 Nov 2005 15:13:19 -
@@ -187,10 +187,10 @@ bool textUndoOrRedo(BufferView & bv,
 
 		// this ugly stuff is needed until we get rid of the
 		// inset_owner backpointer
-		ParagraphList::const_iterator pit = undo.pars.begin();
-		ParagraphList::const_iterator end = undo.pars.end();
+		ParagraphList::iterator pit = undo.pars.begin();
+		ParagraphList::iterator const end = undo.pars.end();
 		for (; pit != end; ++pit)
-			const_cast(*pit).setInsetOwner(());
+			pit->setInsetOwner(dit.textInset());
 		plist.insert(first, undo.pars.begin(), undo.pars.end());
 	}
 



Re: [PATCH] Re: bug 1952/1953

2005-11-24 Thread Jean-Marc Lasgouttes
> "Juergen" == Juergen Spitzmueller <[EMAIL PROTECTED]> writes:

Juergen> Jean-Marc Lasgouttes wrote: Then I have to convert it back to
Juergen> InsetBase in undo.C to pass it to setInsetOwner. How can I do
Juergen> this?
>>  Why do you need that? Doesn't InsetText derive from InsetBase?

Juergen> I just can't get it to compile. Attached is what I have now.
Juergen> Or do you mean I should use a InsetBase *
Juergen> DocIterator::textInset() method and just return an insettext?

I think I see what you mean. OK, so let it return an InsetBase, but
rename the method to something like realInset().

JMarc


[PATCH] bug 2096: LyX file inserting is broken

2005-11-24 Thread Jean-Marc Lasgouttes

After a lot of head scratching (a first patch with cut and paste, plus
many ruminations on code merging), I came up with the following
patch to fix LyX file insertion. As an added bonus, it fixes the
situation where inInset could be NULL.

I'd appreciate if someone could give it a good testing.

JMarc

Index: src/BufferView_pimpl.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.599
diff -u -p -r1.599 BufferView_pimpl.C
--- src/BufferView_pimpl.C	7 Nov 2005 15:06:41 -	1.599
+++ src/BufferView_pimpl.C	24 Nov 2005 15:42:14 -
@@ -881,8 +881,10 @@ void BufferView::Pimpl::MenuInsertLyXFil
 	BOOST_ASSERT(cursor_.inTexted());
 
 	string const fname = MakeAbsPath(filename);
-	bool const res = buffer_->readFile(fname, cursor_.pit());
+	recordUndo(cursor_);
+	bool const res = buffer_->readFile(fname, cursor_.top());
 	resizeCurrentBuffer();
+	bv_->showErrorList(_("Parse"));
 
 	string s = res ? _("Document %1$s inserted.")
 	   : _("Could not insert document %1$s");
Index: src/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2325
diff -u -p -r1.2325 ChangeLog
--- src/ChangeLog	17 Nov 2005 09:19:02 -	1.2325
+++ src/ChangeLog	24 Nov 2005 15:42:14 -
@@ -1,3 +1,16 @@
+2005-11-24  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	Fix bug 2096.
+	
+	* text.C (read): take a pit_type parameter that indicates where
+	the new text should go.
+
+	* buffer.C (readDocument, readFile): take a CursorSlice as
+	parameter, and make sure it is correctly propagated.
+
+	* BufferView_pimpl.C (MenuInsertLyXFile): adapt to
+	Buffer::readFile changes; show error list at the end.
+
 2005-11-15  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* text.C (leftMargin): honor the NextNoIndent tag in layouts.
Index: src/buffer.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.629
diff -u -p -r1.629 buffer.C
--- src/buffer.C	13 Oct 2005 10:59:37 -	1.629
+++ src/buffer.C	24 Nov 2005 15:42:15 -
@@ -461,7 +461,7 @@ int Buffer::readHeader(LyXLex & lex)
 // Uwe C. Schroeder
 // changed to be public and have one parameter
 // Returns false if "\end_document" is not read (Asger)
-bool Buffer::readDocument(LyXLex & lex)
+bool Buffer::readDocument(LyXLex & lex, CursorSlice & slice)
 {
 	lex.next();
 	string const token = lex.getString();
@@ -470,7 +470,9 @@ bool Buffer::readDocument(LyXLex & lex)
 		error(ErrorItem(_("Document header error"), s, -1, 0, 0));
 	}
 
-	if (paragraphs().empty()) {
+	bool const new_buffer = slice.text()->paragraphs().empty();
+
+	if (new_buffer) {
 		readHeader(lex);
 		if (!params().getLyXTextClass().load()) {
 			string theclass = params().getLyXTextClass().name();
@@ -488,7 +490,11 @@ bool Buffer::readDocument(LyXLex & lex)
 		tmpbuf.readHeader(lex);
 	}
 
-	return text().read(*this, lex);
+	bool const res = slice.text()->read(*this, lex, slice.pit());
+	for_each(slice.text()->paragraphs().begin(), 
+		 slice.text()->paragraphs().end(),
+		 bind(::setInsetOwner, _1, ()));
+	return res;
 }
 
 
@@ -556,7 +562,8 @@ bool Buffer::readFile(string const & fil
 
 	// remove dummy empty par
 	paragraphs().clear();
-	bool ret = readFile(filename, paragraphs().size());
+	CursorSlice dummyslice(inset());
+	bool ret = readFile(filename, dummyslice);
 
 	// After we have read a file, we must ensure that the buffer
 	// language is set and used in the gui.
@@ -567,11 +574,11 @@ bool Buffer::readFile(string const & fil
 }
 
 
-bool Buffer::readFile(string const & filename, pit_type const pit)
+bool Buffer::readFile(string const & filename, CursorSlice & slice)
 {
 	LyXLex lex(0, 0);
 	lex.setFile(filename);
-	return readFile(lex, filename, pit);
+	return readFile(lex, filename, slice);
 }
 
 
@@ -587,7 +594,8 @@ void Buffer::fully_loaded(bool const val
 }
 
 
-bool Buffer::readFile(LyXLex & lex, string const & filename, pit_type const pit)
+bool Buffer::readFile(LyXLex & lex, string const & filename, 
+		  CursorSlice & slice)
 {
 	BOOST_ASSERT(!filename.empty());
 
@@ -668,14 +676,14 @@ bool Buffer::readFile(LyXLex & lex, stri
 	  filename));
 			return false;
 		} else {
-			bool const ret = readFile(tmpfile, pit);
+			bool const ret = readFile(tmpfile, slice);
 			// Do stuff with tmpfile name and buffer name here.
 			return ret;
 		}
 
 	}
 
-	if (readDocument(lex)) {
+	if (readDocument(lex, slice)) {
 		Alert::error(_("Document format failure"),
 			 bformat(_("%1$s ended unexpectedly, which means"
    " that it is probably corrupted."),
Index: src/buffer.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.h,v
retrieving revision 1.193
diff -u -p -r1.193 buffer.h
--- src/buffer.h	17 Jul 2005 

Re: Missing latex classes in the lyx package

2005-11-24 Thread Jean-Marc Lasgouttes
> "Edjard" == Edjard Mota <[EMAIL PROTECTED]> writes:

Edjard>  Could you, or someone, give the directions? I feel like
Edjard> coding and would be more than pleased to help.
 
I do not really know, unfortunately. I guess a proposal of the UI we
want would be the first thing to do.

Do people use different templates for the same textclass, or can we
just have a 1:1 correspondence between the two?

This is 1.5 material, of course.

JMarc


Re: [Patch in bugzilla] for 1966, and others

2005-11-24 Thread Jean-Marc Lasgouttes
> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:

Martin> Next is the bug that scrolling is irregular/too fast. If
Martin> bugzilla were working, I could tell you what number :-(

If you know what you are doing, I guess this can go in.

JMarc


Re: Mac: LyX-1.3.x (gcc-4) crash on launch

2005-11-24 Thread Jean-Marc Lasgouttes
> "Bennett" == Bennett Helm <[EMAIL PROTECTED]> writes:

Bennett> LyX-1.3.x refuses to compile on Mac with gcc < 4.0; with
Bennett> gcc-4.0.1, it compiles but crashes on launch. Here's what gdb
Bennett> says:

A shot in the dark: what happens of you set 
#undef MODERN_STL_STREAMS
in src/config.h? I am not even sure this would compile...

JMarc


Re: [PATCH] Re: bug: indentation

2005-11-24 Thread Jean-Marc Lasgouttes
> "Bennett" == Bennett Helm <[EMAIL PROTECTED]> writes:

>> The following patch fixes the regression for me. I'd appreciate if
>> someone could test too (especially since the code is slightly
>> simpler than what it was in 1.3.x).

Bennett> Works for me.

Thanks. This got applied a few days ago.

JMarc


Re: [PATCH] Re: bug 1952/1953

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
> I think I see what you mean. OK, so let it return an InsetBase, but
> rename the method to something like realInset().

The attached patch works for me.

Jürgen
Index: dociterator.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/dociterator.C,v
retrieving revision 1.32
diff -p -u -r1.32 dociterator.C
--- dociterator.C	25 Oct 2005 09:14:11 -	1.32
+++ dociterator.C	24 Nov 2005 16:04:25 -
@@ -20,6 +20,7 @@
 
 #include "mathed/math_data.h"
 #include "mathed/math_inset.h"
+#include "insets/insettabular.h"
 
 #include 
 #include 
@@ -87,6 +88,18 @@ InsetBase const * DocIterator::prevInset
 	if (inMathed())
 		return prevAtom().nucleus();
 	return paragraph().isInset(pos() - 1) ? paragraph().getInset(pos() - 1) : 0;
+}
+
+
+InsetBase * DocIterator::realInset() const
+{
+	BOOST_ASSERT(inTexted());
+	// if we are in a tabular, we need the cell
+	if (inset().lyxCode() == InsetBase::TABULAR_CODE) {
+		InsetTabular & tabular = static_cast(inset());
+		return tabular.cell(idx()).get();
+	}
+	return ();
 }
 
 
Index: dociterator.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/dociterator.h,v
retrieving revision 1.24
diff -p -u -r1.24 dociterator.h
--- dociterator.h	25 Oct 2005 09:14:11 -	1.24
+++ dociterator.h	24 Nov 2005 16:04:25 -
@@ -164,6 +164,8 @@ public:
 	LyXText * text();
 	///
 	LyXText const * text() const;
+	/// the containing inset or the cell, respectively
+	InsetBase * realInset() const;
 	///
 	InsetBase * innerInsetOfType(int code) const;
 	///
Index: undo.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/undo.C,v
retrieving revision 1.68
diff -p -u -r1.68 undo.C
--- undo.C	13 Oct 2005 17:20:30 -	1.68
+++ undo.C	24 Nov 2005 16:04:26 -
@@ -187,10 +187,10 @@ bool textUndoOrRedo(BufferView & bv,
 
 		// this ugly stuff is needed until we get rid of the
 		// inset_owner backpointer
-		ParagraphList::const_iterator pit = undo.pars.begin();
-		ParagraphList::const_iterator end = undo.pars.end();
+		ParagraphList::iterator pit = undo.pars.begin();
+		ParagraphList::iterator const end = undo.pars.end();
 		for (; pit != end; ++pit)
-			const_cast(*pit).setInsetOwner(());
+			pit->setInsetOwner(dit.realInset());
 		plist.insert(first, undo.pars.begin(), undo.pars.end());
 	}
 



Re: [PATCH] Re: bug 1952/1953

2005-11-24 Thread Jean-Marc Lasgouttes
> "Juergen" == Juergen Spitzmueller <[EMAIL PROTECTED]> writes:

Juergen> Jean-Marc Lasgouttes wrote:
>> I think I see what you mean. OK, so let it return an InsetBase, but
>> rename the method to something like realInset().

Juergen> The attached patch works for me.

Put it in, then.

JMarc


bug 1656

2005-11-24 Thread Juergen Spitzmueller
http://bugzilla.lyx.org/show_bug.cgi?id=1656

Shouldn't this patch be applied? Personally, I don't get the described patch, 
but Martin has confirmed that the problem is solved by the patch.

Jürgen


Re: bug 1656

2005-11-24 Thread Stephan Witt

Juergen Spitzmueller wrote:

http://bugzilla.lyx.org/show_bug.cgi?id=1656

Shouldn't this patch be applied? Personally, I don't get the described patch, 
but Martin has confirmed that the problem is solved by the patch.


Jürgen


Just in case nobody knows... I have no karma to apply it.

Stephan
---





Re: bug 1656

2005-11-24 Thread Jean-Marc Lasgouttes
> "Juergen" == Juergen Spitzmueller <[EMAIL PROTECTED]> writes:

Juergen> http://bugzilla.lyx.org/show_bug.cgi?id=1656 Shouldn't this
Juergen> patch be applied? Personally, I don't get the described
Juergen> patch, but Martin has confirmed that the problem is solved by
Juergen> the patch.

The only question I have about this patch is whether we lose something
when the session is closed while LyX is running and there are unsaved
files. What happens with or without the patch?

JMarc


[PATCH] disable LFUN_PASTE when there is nothing in clipboard

2005-11-24 Thread Jean-Marc Lasgouttes

This is a regression wrt 1.3.x. The patch is trivial, I am going to
commit soon unless someone complains.

JMarc

Index: src/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2326
diff -u -p -r1.2326 ChangeLog
--- src/ChangeLog	24 Nov 2005 16:22:38 -	1.2326
+++ src/ChangeLog	24 Nov 2005 16:44:58 -
@@ -1,3 +1,12 @@
+2005-11-24  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* CutAndPaste.C (numberOfSelections): new helper function.
+
+	* lyxfunc.C (getStatus): remove support for LFUN_COPY and LFUN_CUT.
+
+	* text3.C (getStatus): move code for LFUN_CUT and LFUN_COPY from
+	LyXFunc::getStatus; implement LFUN_PASTE.
+
 2005-11-17  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
 	* dociterator.[Ch]: new member realInset() that returns the cell
Index: src/CutAndPaste.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/CutAndPaste.C,v
retrieving revision 1.158
diff -u -p -r1.158 CutAndPaste.C
--- src/CutAndPaste.C	12 Oct 2005 18:44:52 -	1.158
+++ src/CutAndPaste.C	24 Nov 2005 16:44:58 -
@@ -472,6 +472,12 @@ std::vector const availableSelec
 }
 
 
+lyx::size_type numberOfSelections()
+{
+	return theCuts.size();
+}
+
+
 void cutSelection(LCursor & cur, bool doclear, bool realcut)
 {
 	// This doesn't make sense, if there is no selection
Index: src/CutAndPaste.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/CutAndPaste.h,v
retrieving revision 1.41
diff -u -p -r1.41 CutAndPaste.h
--- src/CutAndPaste.h	12 Oct 2005 18:44:52 -	1.41
+++ src/CutAndPaste.h	24 Nov 2005 16:44:58 -
@@ -32,6 +32,8 @@ namespace cap {
 ///
 std::vector const availableSelections(Buffer const & buffer);
 ///
+lyx::size_type numberOfSelections();
+///
 std::string getSelection(Buffer const & buffer, size_t sel_index);
 
 ///
Index: src/lyxfunc.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.672
diff -u -p -r1.672 lyxfunc.C
--- src/lyxfunc.C	17 Nov 2005 08:41:55 -	1.672
+++ src/lyxfunc.C	24 Nov 2005 16:44:58 -
@@ -411,10 +411,6 @@ FuncStatus LyXFunc::getStatus(FuncReques
 		enable = cmd.argument == "custom"
 			|| Exporter::IsExportable(*buf, cmd.argument);
 		break;
-	case LFUN_CUT:
-	case LFUN_COPY:
-		enable = cur.selection();
-		break;
 
 	case LFUN_RUNCHKTEX:
 		enable = buf->isLatex() && lyxrc.chktex_command != "none";
Index: src/text3.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.318
diff -u -p -r1.318 text3.C
--- src/text3.C	17 Nov 2005 08:41:56 -	1.318
+++ src/text3.C	24 Nov 2005 16:44:58 -
@@ -1765,6 +1765,15 @@ bool LyXText::getStatus(LCursor & cur, F
 		flag.setOnOff(font.family() == LyXFont::TYPEWRITER_FAMILY);
 		return true;
 
+	case LFUN_CUT:
+	case LFUN_COPY:
+		enable = cur.selection();
+		break;
+
+	case LFUN_PASTE:
+		enable = lyx::cap::numberOfSelections() > 0;
+		break;
+
 	case LFUN_DELETE_WORD_FORWARD:
 	case LFUN_DELETE_WORD_BACKWARD:
 	case LFUN_DELETE_LINE_FORWARD:
@@ -1808,9 +1817,6 @@ bool LyXText::getStatus(LCursor & cur, F
 	case LFUN_LOWCASE_WORD:
 	case LFUN_CAPITALIZE_WORD:
 	case LFUN_TRANSPOSE_CHARS:
-	case LFUN_PASTE:
-	case LFUN_CUT:
-	case LFUN_COPY:
 	case LFUN_GETXY:
 	case LFUN_SETXY:
 	case LFUN_GETFONT:


[PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Jean-Marc Lasgouttes

What about this? Of course, it would be better to add a virtual
function to InsetBase like asString that either uses plaintext or does
nothing, but I think this is good enough for now.

What do you think?

BTW, this also fixes 2028. 617, which is related should be marked as
fixedintrunk, I think.

JMarc

Index: src/paragraph.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.416
diff -u -p -r1.416 paragraph.C
--- src/paragraph.C	17 Nov 2005 08:41:56 -	1.416
+++ src/paragraph.C	24 Nov 2005 17:02:47 -
@@ -1597,8 +1597,24 @@ string const Paragraph::asString(Buffer 
 		value_type const c = getUChar(buffer.params(), i);
 		if (IsPrintable(c))
 			os << c;
-		else if (c == META_INSET)
-			getInset(i)->plaintext(buffer, os, runparams);
+		else if (c == META_INSET) {
+			InsetBase const * inset = getInset(i);
+			switch (inset->lyxCode()) {
+			case InsetBase::QUOTE_CODE:
+			case InsetBase::REF_CODE:
+			case InsetBase::URL_CODE:
+			case InsetBase::ACCENT_CODE:
+			case InsetBase::MATH_CODE:
+			case InsetBase::SPACE_CODE:
+			case InsetBase::SPECIALCHAR_CODE:
+			case InsetBase::CITE_CODE:
+			case InsetBase::CHARSTYLE_CODE:
+inset->plaintext(buffer, os, runparams);
+break;
+			default:
+break;
+			}
+		}
 	}
 
 	return os.str();


Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
> What about this? Of course, it would be better to add a virtual
> function to InsetBase like asString that either uses plaintext or does
> nothing, but I think this is good enough for now.
>
> What do you think?

I think it's ok, though I'd also prefer a virtual function.

Jürgen


Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Jean-Marc Lasgouttes
> "Juergen" == Juergen Spitzmueller <[EMAIL PROTECTED]> writes:

Juergen> Jean-Marc Lasgouttes wrote:
>> What about this? Of course, it would be better to add a virtual
>> function to InsetBase like asString that either uses plaintext or
>> does nothing, but I think this is good enough for now.
>> 
>> What do you think?

Juergen> I think it's ok, though I'd also prefer a virtual function.

Do you feel like doing this tedious-but-trivial task?

JMarc


Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
> Juergen> I think it's ok, though I'd also prefer a virtual function.
>
> Do you feel like doing this tedious-but-trivial task?

If you have a look at bug 1953.

Jürgen


Re: [PATCH] disable LFUN_PASTE when there is nothing in clipboard

2005-11-24 Thread Georg Baum
Jean-Marc Lasgouttes wrote:

> This is a regression wrt 1.3.x. The patch is trivial, I am going to
> commit soon unless someone complains.

Very nice. I stumbled over this some days ago too, but was too busy to fix
it.


Georg



Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Jean-Marc Lasgouttes
> "Juergen" == Juergen Spitzmueller <[EMAIL PROTECTED]> writes:

Juergen> Jean-Marc Lasgouttes wrote: I think it's ok, though I'd also
Juergen> prefer a virtual function.
>>  Do you feel like doing this tedious-but-trivial task?

Juergen> If you have a look at bug 1953.

What about disabling changing to variable width cell if there are
several paragraphs?

A simpler fix could be to put this bug on the 1.4.1 radar. It is
rather obscure.

JMarc


Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Georg Baum
Juergen Spitzmueller wrote:

> I think it's ok, though I'd also prefer a virtual function.

Me too. The disadvantage is of course that you need to touch more files, but
I think that it is a safe change.

I think we should create a prize for simple patches that fix several bugs at
once :-)


Georg



Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
> Juergen> If you have a look at bug 1953.
>
> What about disabling changing to variable width cell if there are
> several paragraphs?

I think this is not very user-friendly.
I thought about calling mergeParagraphs for all paragraphs in the cell 
somewhere. But first I'd like to understand what exactly happend in 1.3. I 
still don't understand where the paragraphs are merged there.

> A simpler fix could be to put this bug on the 1.4.1 radar. It is
> rather obscure.

I think it should be fixed for 1.4, if possible.

Jürgen



Re: bug 1656

2005-11-24 Thread Stephan Witt

Jean-Marc Lasgouttes wrote:

"Juergen" == Juergen Spitzmueller <[EMAIL PROTECTED]> writes:



Juergen> http://bugzilla.lyx.org/show_bug.cgi?id=1656 Shouldn't this
Juergen> patch be applied? Personally, I don't get the described
Juergen> patch, but Martin has confirmed that the problem is solved by
Juergen> the patch.

The only question I have about this patch is whether we lose something
when the session is closed while LyX is running and there are unsaved
files. What happens with or without the patch?


I'm comiling the cvs-updated 1.4.x tree now. I'll answer your question
tomorrow, I hope.

Stephan
---


Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Georg Baum
Juergen Spitzmueller wrote:

> I thought about calling mergeParagraphs for all paragraphs in the cell
> somewhere. But first I'd like to understand what exactly happend in 1.3. I
> still don't understand where the paragraphs are merged there.

Me neither. I have spent some time trying to find it out, but found nothing.
What I then did was to append this to InsetText::setAutoBreakRows:

// merge all paragraphs to one
BufferParams const & bp = text_.buffer_owner->params();
while (paragraphs().size() > 1)
mergeParagraph(bp, paragraphs(), 0);

Unfortunately it resulted in some crahes that I could not yet track down.

>> A simpler fix could be to put this bug on the 1.4.1 radar. It is
>> rather obscure.
> 
> I think it should be fixed for 1.4, if possible.

I agree. It is a regression, and it is IMHO not too unusual to change a
column fom fixed width to floating.


Georg



Re: Missing latex classes in the lyx package

2005-11-24 Thread Edjard Mota


Jean-Marc Lasgouttes <[EMAIL PROTECTED]> escreveu:
> "Edjard" == Edjard Mota writes:

Edjard> Could you, or someone, give the directions? I feel like
Edjard> coding and would be more than pleased to help.

JMarc> I do not really know, unfortunately. I guess a proposal of the 
  JMarc> UI we want would be the first thing to do.

  Ok. Sorry about my ignorance, but how do we make such a proposal?
  
JMarc> Do people use different templates for the same textclass, or 
  JMarc> can we just have a 1:1 correspondence between the two?

  It is possible since it would be nice to allow different customizations
  for the same texclass. But we need some feedback from people who have been 
creating templates.
   
  JMarc> This is 1.5 material, of course.

  Ok, I search for it.
  
JMarc

  br
   
  Edjard



-
 Yahoo! Acesso Grátis: Internet rápida e grátis.
Instale o discador agora!

Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Juergen Spitzmueller
Georg Baum wrote:
> Me neither. I have spent some time trying to find it out, but found
> nothing. What I then did was to append this to InsetText::setAutoBreakRows:
>
>         // merge all paragraphs to one
>         BufferParams const & bp = text_.buffer_owner->params();
>         while (paragraphs().size() > 1)
>                 mergeParagraph(bp, paragraphs(), 0);

This is what I had in mind, too.

> Unfortunately it resulted in some crahes that I could not yet track down.

Too bad.

Jürgen


Re: plans for LyX, was: fourth release of the LyXWinInstaller

2005-11-24 Thread Michael Gerz

Angus Leeming wrote:


The menu entries are shown with  bold font which looks pretty ugly. I
haven't tested the latest qtwin sources but the snapshot of 2005-10-31
doesn't have this "bug" and, browsing through the recent patches, I see
no reason why it should have changed since then.
   

I am puzzled. I just compiled the lastest CVS of qtwin. If I start its 
"designer", the menu items (File, Edit, ...) have normal font, whereas 
menu items in your LyX 1.3.7cvs have bold font. What does 
qt-3/bin/designer look like on your machine?



Hmmm. I never got the command line cvs working on Windows (never tried too
hard either) and have been using TortoiseCVS instead. However, the
configure script that pulls over the docs requires the command line cvs.

I suppose that I could grab them explicitly. I see lib/Makefile.am has

   cvs -Q export -r BRANCH_1_3_X -d doc lyxdoc

I'll have a go.
 



Why don't you use "cvs" from the MSYS package? I don't know what option 
"-Q" means but the rest looks reasonable, in particular "-r BRANCH_1_3_X".



It would also be nice if you compiled the sources with
--with-version-suffix (which helps people who switch between 1.4 and
1.3). 
   



Hm. The problem here is the LyX User directory only, no?
   C:\Documents and Settings\Angus\Application Data\LyX
Why don't we use
   
string const get_default_user_support_dir(string const & home_dir)

{
#if defined (USE_WINDOWS_PACKAGING)
(void)home_dir; // Silence warning about unused variable.

 string const user_dir =
 (string(PACKAGE) == "lyx") ? "LyX" : PACKAGE;
 GetFolderPath win32_folder_path;
 return AddPath(win32_folder_path(GetFolderPath::APPDATA),
-user_dir);
+user_dir + '_' + VERSION);
#elif defined (USE_MACOSX_PACKAGING)

which would give us 
   C:\Documents and Settings\Angus\Application Data\LyX_1.3.7
 



Hmmm, I was pretty sure that --with-version-suffix works without any 
code change. Please ignore my request. Actually, it is enough if _I_ use 
--with-version-suffix for LyX 1.4.0.


Thanks for all the effort!

Michael



Re: [PATCH] bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section layout

2005-11-24 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
> Do you feel like doing this tedious-but-trivial task?

What do you think about the attached?
There's also a plaintext member in formulamacro. Should this be considered, 
too?

Jürgen
Index: paragraph.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.416
diff -p -u -r1.416 paragraph.C
--- paragraph.C	17 Nov 2005 08:41:56 -	1.416
+++ paragraph.C	24 Nov 2005 19:28:38 -
@@ -1598,7 +1598,7 @@ string const Paragraph::asString(Buffer 
 		if (IsPrintable(c))
 			os << c;
 		else if (c == META_INSET)
-			getInset(i)->plaintext(buffer, os, runparams);
+			getInset(i)->tocString(buffer, os, runparams);
 	}
 
 	return os.str();
Index: insets/insetbase.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbase.h,v
retrieving revision 1.61
diff -p -u -r1.61 insetbase.h
--- insets/insetbase.h	17 Nov 2005 08:41:53 -	1.61
+++ insets/insetbase.h	24 Nov 2005 19:28:42 -
@@ -191,6 +191,9 @@ public:
 	/// docbook output
 	virtual int docbook(Buffer const &, std::ostream & os,
 		OutputParams const &) const;
+	/// the string that is passed to the TOC
+	virtual int tocString(Buffer const &, std::ostream &,
+		OutputParams const &) const { return 0; };
 
 	/** This enum indicates by which means the inset can be modified:
 	- NOT_EDITABLE: the inset's content can not be modified at all 
Index: insets/insetcharstyle.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcharstyle.C,v
retrieving revision 1.38
diff -p -u -r1.38 insetcharstyle.C
--- insets/insetcharstyle.C	2 Nov 2005 13:54:33 -	1.38
+++ insets/insetcharstyle.C	24 Nov 2005 19:28:43 -
@@ -316,6 +316,13 @@ int InsetCharStyle::plaintext(Buffer con
 }
 
 
+int InsetCharStyle::tocString(Buffer const & buf, ostream & os,
+		   OutputParams const & op) const
+{
+	return plaintext(buf, os, op);
+}
+
+
 void InsetCharStyle::validate(LaTeXFeatures & features) const
 {
 	// Force inclusion of preamble snippet in layout file
Index: insets/insetcharstyle.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcharstyle.h,v
retrieving revision 1.15
diff -p -u -r1.15 insetcharstyle.h
--- insets/insetcharstyle.h	10 Sep 2005 06:51:54 -	1.15
+++ insets/insetcharstyle.h	24 Nov 2005 19:28:43 -
@@ -80,6 +80,9 @@ public:
 	///
 	int plaintext(Buffer const &, std::ostream &,
 		  OutputParams const &) const;
+	/// the string that is passed to the TOC
+	virtual int tocString(Buffer const &, std::ostream & os,
+		OutputParams const &) const;
 	///
 	void validate(LaTeXFeatures &) const;
 
Index: insets/insetcite.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcite.C,v
retrieving revision 1.88
diff -p -u -r1.88 insetcite.C
--- insets/insetcite.C	26 Oct 2004 21:16:44 -	1.88
+++ insets/insetcite.C	24 Nov 2005 19:28:43 -
@@ -353,6 +353,13 @@ int InsetCitation::docbook(Buffer const 
 }
 
 
+int InsetCitation::tocString(Buffer const & buf, ostream & os,
+		   OutputParams const & op) const
+{
+	return plaintext(buf, os, op);
+}
+
+
 // Have to overwrite the default InsetCommand method in order to check that
 // the \cite command is valid. Eg, the user has natbib enabled, inputs some
 // citations and then changes his mind, turning natbib support off. The output
Index: insets/insetcite.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcite.h,v
retrieving revision 1.56
diff -p -u -r1.56 insetcite.h
--- insets/insetcite.h	19 Jan 2005 15:03:30 -	1.56
+++ insets/insetcite.h	24 Nov 2005 19:28:43 -
@@ -38,6 +38,9 @@ public:
 	///
 	int docbook(Buffer const &, std::ostream &,
 		  OutputParams const &) const;
+	/// the string that is passed to the TOC
+	virtual int tocString(Buffer const &, std::ostream & os,
+		OutputParams const &) const;
 	///
 	void validate(LaTeXFeatures &) const;
 
Index: insets/insetlatexaccent.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlatexaccent.C,v
retrieving revision 1.96
diff -p -u -r1.96 insetlatexaccent.C
--- insets/insetlatexaccent.C	17 May 2005 11:11:45 -	1.96
+++ insets/insetlatexaccent.C	24 Nov 2005 19:28:44 -
@@ -601,6 +601,13 @@ int InsetLatexAccent::docbook(Buffer con
 }
 
 
+int InsetLatexAccent::tocString(Buffer const & buf, ostream & os,
+		   OutputParams const & op) const
+{
+	return plaintext(buf, os, op);
+}
+
+
 bool InsetLatexAccent::directWrite() const
 {
 	return true;
Index: insets/insetlatexaccent.h
===
RCS file: 

Re: [PATCH] bug 2096: LyX file inserting is broken

2005-11-24 Thread Georg Baum
Am Donnerstag, 24. November 2005 16:47 schrieb Jean-Marc Lasgouttes:
> 
> After a lot of head scratching (a first patch with cut and paste, plus
> many ruminations on code merging), I came up with the following
> patch to fix LyX file insertion. As an added bonus, it fixes the
> situation where inInset could be NULL.
> 
> I'd appreciate if someone could give it a good testing.

It works if the cursor is in a new empty paragraph.
It tries to eat all available memory (and more) if the cursor is inside a 
section.
Unavailable layouts are parsed as errors and not converted as in cut and 
paste.

I read your comment at http://bugzilla.lyx.org/show_bug.cgi?id=2096 and 
actually like the paste solution much better, because we can use the 
cut-and-paste mechanism that changes layouts, does necessary conversions 
for ERT etc. Attached is a patch that implements this approach without 
cluttering the clipboard and with displaying of error messages. The only 
drawback I could find is that it inserts an additional paragraph if the 
inserted file contains more than one paragraph.


Georg
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/buffer.C lyx-1.4-cvs/src/buffer.C
--- lyx-1.4-clean/src/buffer.C	2005-10-13 20:30:20.0 +0200
+++ lyx-1.4-cvs/src/buffer.C	2005-11-24 20:29:55.0 +0100
@@ -556,7 +556,9 @@ bool Buffer::readFile(string const & fil
 
 	// remove dummy empty par
 	paragraphs().clear();
-	bool ret = readFile(filename, paragraphs().size());
+	LyXLex lex(0, 0);
+	lex.setFile(filename);
+	bool ret = readFile(lex, filename);
 
 	// After we have read a file, we must ensure that the buffer
 	// language is set and used in the gui.
@@ -567,14 +569,6 @@ bool Buffer::readFile(string const & fil
 }
 
 
-bool Buffer::readFile(string const & filename, pit_type const pit)
-{
-	LyXLex lex(0, 0);
-	lex.setFile(filename);
-	return readFile(lex, filename, pit);
-}
-
-
 bool Buffer::fully_loaded() const
 {
 	return pimpl_->file_fully_loaded;
@@ -587,7 +581,7 @@ void Buffer::fully_loaded(bool const val
 }
 
 
-bool Buffer::readFile(LyXLex & lex, string const & filename, pit_type const pit)
+bool Buffer::readFile(LyXLex & lex, string const & filename)
 {
 	BOOST_ASSERT(!filename.empty());
 
@@ -668,7 +662,7 @@ bool Buffer::readFile(LyXLex & lex, stri
 	  filename));
 			return false;
 		} else {
-			bool const ret = readFile(tmpfile, pit);
+			bool const ret = readFile(tmpfile);
 			// Do stuff with tmpfile name and buffer name here.
 			return ret;
 		}
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/buffer.h lyx-1.4-cvs/src/buffer.h
--- lyx-1.4-clean/src/buffer.h	2005-07-18 21:19:31.0 +0200
+++ lyx-1.4-cvs/src/buffer.h	2005-11-24 20:29:55.0 +0100
@@ -93,8 +93,6 @@ public:
 	/// load a new file
 	bool readFile(std::string const & filename);
 
-	bool readFile(std::string const & filename, lyx::pit_type pit);
-
 	/// read the header, returns number of unknown tokens
 	int readHeader(LyXLex & lex);
 
@@ -341,8 +339,7 @@ private:
 	\param par if != 0 insert the file.
 	\return \c false if method fails.
 	*/
-	bool readFile(LyXLex &, std::string const & filename,
-		  lyx::pit_type pit);
+	bool readFile(LyXLex &, std::string const & filename);
 
 	bool do_writeFile(std::ostream & ofs) const;
 
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/BufferView.C lyx-1.4-cvs/src/BufferView.C
--- lyx-1.4-clean/src/BufferView.C	2005-07-16 10:58:21.0 +0200
+++ lyx-1.4-cvs/src/BufferView.C	2005-11-24 20:55:08.0 +0100
@@ -114,9 +114,9 @@ void BufferView::newFile(string const & 
 }
 
 
-bool BufferView::loadLyXFile(string const & fn, bool tl)
+bool BufferView::loadLyXFile(string const & fn, bool tl, bool se)
 {
-	return pimpl_->loadLyXFile(fn, tl);
+	return pimpl_->loadLyXFile(fn, tl, se);
 }
 
 
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/bufferview_funcs.C lyx-1.4-cvs/src/bufferview_funcs.C
--- lyx-1.4-clean/src/bufferview_funcs.C	2005-11-10 20:37:39.0 +0100
+++ lyx-1.4-cvs/src/bufferview_funcs.C	2005-11-24 20:29:55.0 +0100
@@ -205,8 +205,13 @@ Point coordOffset(DocIterator const & di
 Point getPos(DocIterator const & dit, bool boundary)
 {
 	CursorSlice const & bot = dit.bottom();
-	CoordCache::InnerParPosCache const & cache =
-		theCoords.getParPos().find(bot.text())->second;
+	CoordCache::ParPosCache::const_iterator cit =
+		theCoords.getParPos().find(bot.text());
+	if (cit == theCoords.getParPos().end()) {
+		//lyxerr << "cursor out of view" << std::endl;
+		return Point(-1, -1);
+	}
+	CoordCache::InnerParPosCache const & cache = cit->second;
 	CoordCache::InnerParPosCache::const_iterator it = cache.find(bot.pit());
 	if (it == cache.end()) {
 		//lyxerr << "cursor out of view" << std::endl;
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/BufferView.h lyx-1.4-cvs/src/BufferView.h
--- lyx-1.4-clean/src/BufferView.h	2005-06-10 18:46:10.0 +0200
+++ lyx-1.4-cvs/src/BufferView.h	2005-11-24 20:29:55.0 +0100
@@ -95,7 +95,8 @@ public:
 	void 

Re: [Patch in bugzilla] for 1966, and others

2005-11-24 Thread Martin Vermeer
On Thu, Nov 24, 2005 at 04:54:23PM +0100, Jean-Marc Lasgouttes wrote:
> > "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> 
> Martin> Next is the bug that scrolling is irregular/too fast. If
> Martin> bugzilla were working, I could tell you what number :-(
> 
> If you know what you are doing, I guess this can go in.

Thanks for the confidence, but I would like the people who filed the
complaint to verify that this indeed addresses it (1966). It does 
improve LyX behaviour though, even if it would not.

Also I want opinions on the 200 ms -> 500 ms thing. What is a reasonable
value?

- Martin



pgpClaAjw7FyK.pgp
Description: PGP signature


Re: plans for LyX, was: fourth release of the LyXWinInstaller

2005-11-24 Thread Angus Leeming
Michael Gerz wrote:
> Angus Leeming wrote:
>>>The menu entries are shown with  bold font which looks pretty ugly. I
>>>haven't tested the latest qtwin sources but the snapshot of 2005-10-31
>>>doesn't have this "bug" and, browsing through the recent patches, I see
>>>no reason why it should have changed since then.

> I am puzzled. I just compiled the lastest CVS of qtwin. If I start its
> "designer", the menu items (File, Edit, ...) have normal font, whereas
> menu items in your LyX 1.3.7cvs have bold font. What does
> qt-3/bin/designer look like on your machine?

Why not substitute your qt_mt3.dll for mine and see how LyX looks then?

> Why don't you use "cvs" from the MSYS package?

It can't get through the Windows/Norton firewalls.

> Hmmm, I was pretty sure that --with-version-suffix works without any
> code change.

It does. But then lyx.exe is lyx_1.3.7cvs.exe, etc.

-- 
Angus