Re: LyX and vTeX

2003-05-30 Thread Charpentier Philippe
On Tue, 27 May 2003 11:46:20 +0200
Andre Poenitz [EMAIL PROTECTED] wrote:

 On Tue, May 27, 2003 at 11:43:22AM +0200, Charpentier Philippe wrote:
  sometimes I find usefull to use vlatex instead of pdflatex to
  produce a PDF file. Is it possible (in any version of LyX and
  for the user i.e. without modifying the source) to add an NEW entry
  in the view menu (i.e. in ViewFormats) like PDF (vlatex) for a
  complete compilation with vlatex, in such a way that both
  PDF (pdflatex) and PDF (vlatex) appear in the view menu?
 
 Yes.
 
 You need to define a new format (say PDFvlatex) and a converter
 LaTeX - PDFvlatex in the Preferences-Converters menus.
 
 Andre'
 

I did that for lyx-1.2.3 and lyx-1.3.2. Precisely I wrote

\format pdf4 pdf PDF (vlatex)  (in the FORMATS SECTION)

and

\converter latex pdf4 /usr/local/vtex/bin/vlatex $$i latex (in the CONVERTERS 
SECTION)

With lyx-1.2.3 all is fine. But with lyx-1.3.2, if there is a latex error in the
document, lyx crashes with the following output:

lyx: /usr/include/g++-3/std/bastring.cc:126: basic_stringcharT, traits, Allocator 
basic_stringcharT, traits, Allocator::replace (unsigned int, unsigned int, const 
basic_stringcharT, traits, Allocator , unsigned int, unsigned int) [with charT = 
char, traits = string_char_traitschar, Allocator = __default_alloc_templatetrue, 
0]:  l'assertion `!(pos2  len2)' a échoué.
/home/pcharpen/bin/monlyxqt: line 6:  8816 Abandon

Why?
Ph. C.

More precisely:

the test was made on a RedHat-7.2. Running lyx-1.3.2 with -dbg latex gives (with a 
\usepackage{al} in the preamble):

Log line: ! LaTeX Error: File `al.sty' not found.
lyx: /usr/include/g++-3/std/bastring.cc:126: basic_stringcharT, traits, Allocator 
basic_stringcharT, traits, Allocator::replace (unsigned int, unsigned int, const 
basic_stringcharT, traits, Allocator , unsigned int, unsigned int) [with charT = 
char, traits = string_char_traitschar, Allocator = __default_alloc_templatetrue, 
0]:  l'assertion `!(pos2  len2)' a échoué.
Abandon

The same test on a RedHat-8.0 gives, for BOTH lyx-1.2.3 and lyx-1.3.2, a crash of lyx 
with:

Log line: ! LaTeX Error: File `al.sty' not found.
Abandon

Is this a bug in LyX?

Ph. C.


Re: [PATCH] Re: bug: text-footnote

2003-05-30 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
 Just that the user does not expect that the clipboard is modified.
 There should not be any clipboard modification without an explicit
 cut/copy.

Well then how about this? (As I said, the current implementation is more 
confusing than helpful).

 The solution would be to modify CutAndPaste to allow an alternative
 temporary clipboard, but this is probably a lot of work.

Certainly no work for me.

Regards,
Jürgen.

P.S.: For the sake of power users, I vote for the possibility to add a Don't 
ask again checkbox to the Alert dialogs.
Index: src/text3.C
===
RCS file: /cvs/lyx/lyx-devel/src/text3.C,v
retrieving revision 1.76
diff -u -r1.76 text3.C
--- src/text3.C	2003/05/27 17:29:01	1.76
+++ src/text3.C	2003/05/28 06:58:34
@@ -27,6 +27,7 @@
 #include box.h
 #include language.h
 #include support/tostr.h
+#include frontends/Alert.h
 #include frontends/LyXView.h
 #include frontends/screen.h
 #include frontends/Dialogs.h
@@ -365,6 +366,8 @@
 {
 	lt-update();
 	InsetSpecialChar * new_inset = new InsetSpecialChar(kind);
+	if (lt-selection.set())
+		lt-cutSelection(true, false);
 	if (!bv-insertInset(new_inset))
 		delete new_inset;
 	else
@@ -379,18 +382,28 @@
 	BufferView * bv = cmd.view();
 
 	if (inset) {
-		bool gotsel = false;
-		if (lt-selection.set()) {
-			lt-cutSelection(true, false);
-			gotsel = true;
+		bool use_clipboard = false;
+		if (lt-selection.set()  pastesel) {
+			string const inset_name = inset-getInsetName();
+			string text = bformat(_(Do you want to insert the selected text into\n
+the %1$s inset (using the clipboard)?), inset_name);
+			int const ret = Alert::prompt(_(Paste selection to inset?),
+text, 1, 1, _(Insert), _(Don't insert));
+			if (ret == 0) {
+use_clipboard = true;
+bv-owner()-dispatch(FuncRequest(LFUN_CUT));
+			} else
+bv-owner()-dispatch(FuncRequest(LFUN_DELETE));
+		} else if (lt-selection.set()  !pastesel) {
+bv-owner()-dispatch(FuncRequest(LFUN_DELETE));
 		}
 		if (bv-insertInset(inset)) {
 			if (edit) {
 FuncRequest cmd(bv, LFUN_INSET_EDIT, left);
 inset-localDispatch(cmd);
 			}
-			if (gotsel  pastesel)
-bv-owner()-dispatch(FuncRequest(LFUN_PASTESELECTION));
+			if (use_clipboard)
+	bv-owner()-dispatch(FuncRequest(LFUN_PASTE));
 		}
 		else
 			delete inset;
@@ -736,7 +749,7 @@
 			// just comment out the line below...
 		} else {
 			update();
-			cutSelection(bv, true);
+			cutSelection(true, false);
 			update();
 		}
 		moveCursorUpdate(bv, false);


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Lars Gullik Bjønnes
Andre Poenitz [EMAIL PROTECTED] writes:

| On Wed, May 28, 2003 at 09:05:23AM +0200, Lars Gullik Bjønnes wrote:
|  | I think std::list::const_iterator  has a corresponding constructor.
|  
|  Show me.
| 
| I don't find it in the Standard right now.

Right... :-)
 
| But:
| 
|   templatetypename _Tp, typename _Ref, typename _Ptr
| struct _List_iterator : public _List_iterator_base
| {
|   typedef _List_iterator_Tp,_Tp,_Tp* iterator;
|   typedef _List_iterator_Tp,const _Tp,const _Tp* const_iterator;
|   typedef _List_iterator_Tp,_Ref,_Ptr _Self;
| 
|   typedef _Tp value_type;
|   typedef _Ptr pointer;
|   typedef _Ref reference;
|   typedef _List_node_Tp _Node;
| 
|   _List_iterator(_Node* __x)
|   : _List_iterator_base(__x)
|   { }
| 
|   _List_iterator()
|   { }
| 
|   _List_iterator(const iterator __x) // --
|   : _List_iterator_base(__x._M_node)
|   { }
| 
| and
| 
|   #include list
| 
|   int main()
|   {
|   std::listint l;
|   std::listint::const_iterator it = l.end();
|   }
| 
| compiles with g++ and Comeau.

Note also that we have just as much need for going const_iterator -
iterator.

|  No... That is like converting string to a int with a reinterpret_cast
|  and expecting tings to work... different types.
| 
| It certainly is undefined behaviour. But every std::list::iterator I know
| of is binary compatible with its corresponding std::list::const_iterator
| (in contrast to your string/int example) even if that's not required at
| all. So it works in practice.

Is 'works' in practice good enough?

-- 
Lgb


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Lars Gullik Bjønnes
Andre Poenitz [EMAIL PROTECTED] writes:

| On Wed, May 28, 2003 at 09:44:29AM +0200, Lars Gullik Bjønnes wrote:
|  | It certainly is undefined behaviour. But every std::list::iterator I know
|  | of is binary compatible with its corresponding std::list::const_iterator
|  | (in contrast to your string/int example) even if that's not required at
|  | all. So it works in practice.
|  
|  Is 'works' in practice good enough?
| 
| We are talking about the transition phase to std::list, don't we?

So so sure...
 
| If so, it is certainly 'good enough' as it would be better then most of the
| other stuff like undo etc. ;-}
| 
| I was just trying to give a hint how that 'cumbersome' conversion can be
| done in one line.

but it is not iterator - const_iterator that is cumbersom (as you
have shown), but const_iterator - iterator.
 
-- 
Lgb


Re: [Devel] [meta-PATCH] bibtex inset crashes on reading in (Angus !)

2003-05-30 Thread Lars Gullik Bjønnes
John Levon [EMAIL PROTECTED] writes:

|  o make readInset() handle only bibtex, and do s/BibTeX/bibtex/ in
|lyx2lyx

This one I think, but I have no strong feeling about this.

-- 
Lgb


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Lars Gullik Bjønnes
Andre Poenitz [EMAIL PROTECTED] writes:

|  to fit.  All problems larger than  has been solved by a
|  const_cast.

This ^^
 
| Wouldn't it be better in such cases to change the functions' signature to 
| 
|   int getEndLabel(ParagraphList::const_iterator...

Perhaps. But I am not willing to open that issue now... It is some
easy to come in the situation that you need to convert
ParagraphList::iterator to ParagraphList::const_iterator and that is
reall cumbersome.

-- 
Lgb


Re: [Devel] [patch] Drop ParagraphList::find

2003-05-30 Thread Lars Gullik Bjønnes
Andre Poenitz [EMAIL PROTECTED] writes:

| On Tue, May 27, 2003 at 11:27:55PM +0200, Lars Gullik Bjønnes wrote:
| +bool operator==(Paragraph const  lhs, Paragraph const  rhs)
| +{
| +#warning FIXME this implementatoin must be completely wrong...
| +   return lhs == rhs;
| +}
| 
| As the warning says.
| 
| Wouldn't it be more prudent to use a special-purpose comparator when
| needed instead of giving the 'standard' operator==() wrong semantics?

Possibly.

-- 
Lgb


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Lars Gullik Bjønnes
Andre Poenitz [EMAIL PROTECTED] writes:

|  Perhaps. But I am not willing to open that issue now... It is some
|  easy to come in the situation that you need to convert
|  ParagraphList::iterator to ParagraphList::const_iterator and that is
|  reall cumbersome.
| 
| I think std::list::const_iterator  has a corresponding constructor.

Show me.
 
| Cumbersome... a reinterpret_cast in that constructor would work ;-)

No... That is like converting string to a int with a reinterpret_cast
and expecting tings to work... different types.

-- 
Lgb


[patch] Switch to std::list

2003-05-30 Thread Lars Gullik Bjønnes

Mostly just a simple switch-over, but some small other things as well.

Have a look.

? src/less
? src/frontends/xforms/lyx_forms.h
? src/frontends/xforms/lyx_xpm.h
Index: src/CutAndPaste.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/CutAndPaste.h,v
retrieving revision 1.25
diff -u -p -r1.25 CutAndPaste.h
--- src/CutAndPaste.h	20 May 2003 16:51:29 -	1.25
+++ src/CutAndPaste.h	27 May 2003 23:03:28 -
@@ -59,7 +59,7 @@ int nrOfParagraphs();
 */
 int SwitchLayoutsBetweenClasses(lyx::textclass_type c1,
 lyx::textclass_type c2,
-ParagraphList  par, 
+ParagraphList  par,
 ErrorList );
 ///
 bool checkPastePossible();
Index: src/ParagraphList.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ParagraphList.h,v
retrieving revision 1.18
diff -u -p -r1.18 ParagraphList.h
--- src/ParagraphList.h	27 May 2003 22:41:02 -	1.18
+++ src/ParagraphList.h	27 May 2003 23:03:29 -
@@ -3,7 +3,7 @@
 #ifndef PARAGRAPH_LIST_H
 #define PARAGRAPH_LIST_H
 
-#define NO_STD_LIST 1
+//#define NO_STD_LIST 1
 
 #ifndef NO_STD_LIST
 
@@ -11,7 +11,11 @@
 
 #include list
 
-typedef std::listParagraph ParagraphList;
+struct ParagraphList : public std::listParagraph
+{
+};
+
+typedef std::pairParagraphList::iterator, int PitPosPair;
 
 #else
 
Index: src/paragraph.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.h,v
retrieving revision 1.83
diff -u -p -r1.83 paragraph.h
--- src/paragraph.h	27 May 2003 22:41:03 -	1.83
+++ src/paragraph.h	27 May 2003 23:03:30 -
@@ -18,11 +18,11 @@
 #include support/types.h
 #include changes.h
 
-#include ParagraphList.h
 #include LString.h
 
 #include boost/optional.hpp
 
+class Buffer;
 class BufferParams;
 class BufferView;
 class Counters;
@@ -32,11 +32,12 @@ class LaTeXFeatures;
 class LatexRunParams;
 class ParagraphParameters;
 class TexRow;
+class ParagraphList;
 
 // Define this if you want to try out the new storage container for
 // paragraphs. (Lgb)
 // This is non working and far from finished.
-#define NO_STD_LIST 1
+//#define NO_STD_LIST 1
 
 /// A Paragraph holds all text, attributes and insets in a text paragraph
 class Paragraph  {
@@ -337,6 +338,7 @@ inline bool isDeletedText(Paragraph cons
 {
 	return par.lookupChange(pos) == Change::DELETED;
 }
+
 
 bool operator==(Paragraph const  lhs, Paragraph const  rhs);
 
Index: src/paragraph_funcs.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph_funcs.C,v
retrieving revision 1.42
diff -u -p -r1.42 paragraph_funcs.C
--- src/paragraph_funcs.C	27 May 2003 22:41:03 -	1.42
+++ src/paragraph_funcs.C	27 May 2003 23:03:30 -
@@ -379,7 +379,7 @@ TeXEnvironment(Buffer const * buf,
 	do {
 		par = TeXOnePar(buf, paragraphs, par, os, texrow, runparams);
 
-		if (par != const_castParagraphList(paragraphs).end() par-params().depth()  pit-params().depth()) {
+		if (par != const_castParagraphList(paragraphs).end()  par-params().depth()  pit-params().depth()) {
 			if (par-layout()-isParagraph()) {
 
 			// Thinko!
@@ -610,13 +610,17 @@ TeXOnePar(Buffer const * buf,
 			texrow.newline();
 		}
 		break;
-	case LATEX_ENVIRONMENT:
+	case LATEX_ENVIRONMENT: {
 		// if its the last paragraph of the current environment
 		// skip it otherwise fall through
-		if (boost::next(pit) != const_castParagraphList(paragraphs).end()
-		 (boost::next(pit)-layout() != pit-layout()
-			|| boost::next(pit)-params().depth() != pit-params().depth()))
+		ParagraphList::iterator next = boost::next(pit);
+
+		if (next != const_castParagraphList(paragraphs).end()
+		 (next-layout() != pit-layout()
+			|| next-params().depth() != pit-params().depth()))
 			break;
+	}
+
 		// fall through possible
 	default:
 		// we don't need it for the last paragraph!!!
Index: src/insets/inset.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.C,v
retrieving revision 1.94
diff -u -p -r1.94 inset.C
--- src/insets/inset.C	26 May 2003 09:13:53 -	1.94
+++ src/insets/inset.C	27 May 2003 23:03:33 -
@@ -26,8 +26,6 @@
 
 #include support/lstrings.h
 
-using std::endl;
-
 
 // Initialization of the counter for the inset id's,
 unsigned int Inset::inset_id = 0;
Index: src/insets/inset.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.h,v
retrieving revision 1.92
diff -u -p -r1.92 inset.h
--- src/insets/inset.h	26 May 2003 09:13:53 -	1.92
+++ src/insets/inset.h	27 May 2003 23:03:33 -
@@ -30,10 +30,10 @@ class LatexRunParams;
 class LyXText;
 class LyXLex;
 class Paragraph;
-class ParagraphList;
 class LyXCursor;
 class FuncRequest;
 class WordLangTuple;
+class ParagraphList;
 
 struct LaTeXFeatures;
 

[patch] Drop ParagraphList::find

2003-05-30 Thread Lars Gullik Bjønnes

I just realized that there is no such thing as find in std::list.

So this patch removes that and replaces it with std::find.

? src/frontends/xforms/lyx_forms.h
? src/frontends/xforms/lyx_xpm.h
Index: src/ParagraphList.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ParagraphList.C,v
retrieving revision 1.24
diff -u -p -r1.24 ParagraphList.C
--- src/ParagraphList.C	27 May 2003 17:28:59 -	1.24
+++ src/ParagraphList.C	27 May 2003 20:54:43 -
@@ -315,17 +315,4 @@ bool ParagraphList::empty() const
 	return parlist == 0;
 }
 
-
-ParagraphList::iterator ParagraphList::find(Paragraph const  p)
-{
-	iterator it = begin();
-	iterator last = end();
-	for (;it != last; ++it) {
-		if (*it == p)
-			break;
-	}
-	return it;
-}
-
-
 #endif
Index: src/ParagraphList.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ParagraphList.h,v
retrieving revision 1.16
diff -u -p -r1.16 ParagraphList.h
--- src/ParagraphList.h	27 May 2003 17:28:59 -	1.16
+++ src/ParagraphList.h	27 May 2003 20:54:43 -
@@ -99,8 +99,6 @@ public:
 	int size() const;
 	///
 	bool empty() const;
-	///
-	iterator find(Paragraph const );
 private:
 	///
 	Paragraph * parlist;
Index: src/paragraph.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.275
diff -u -p -r1.275 paragraph.C
--- src/paragraph.C	26 May 2003 09:13:51 -	1.275
+++ src/paragraph.C	27 May 2003 20:54:43 -
@@ -1396,3 +1396,10 @@ bool Paragraph::isFreeSpacing() const
 		return (pimpl_-inset_owner-owner()-lyxCode() == Inset::ERT_CODE);
 	return false;
 }
+
+
+bool operator==(Paragraph const  lhs, Paragraph const  rhs)
+{
+#warning FIXME this implementatoin must be completely wrong...
+	return lhs == rhs;
+}
Index: src/paragraph.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.h,v
retrieving revision 1.81
diff -u -p -r1.81 paragraph.h
--- src/paragraph.h	25 May 2003 08:49:48 -	1.81
+++ src/paragraph.h	27 May 2003 20:54:43 -
@@ -337,4 +337,6 @@ inline bool isDeletedText(Paragraph cons
 	return par.lookupChange(pos) == Change::DELETED;
 }
 
+bool operator==(Paragraph const  lhs, Paragraph const  rhs);
+
 #endif // PARAGRAPH_H
Index: src/text.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.363
diff -u -p -r1.363 text.C
--- src/text.C	27 May 2003 17:28:59 -	1.363
+++ src/text.C	27 May 2003 20:54:44 -
@@ -147,7 +147,9 @@ int LyXText::workWidth() const
 
 int LyXText::workWidth(Inset const * inset) const
 {
-	ParagraphList::iterator par = ownerParagraphs().find(*inset-parOwner());
+	ParagraphList::iterator par = std::find(ownerParagraphs().begin(),
+		ownerParagraphs().end(),
+		*inset-parOwner());
 	//lyx::Assert(par);
 
 	pos_type pos = par-getPositionOfInset(inset);
Index: src/text2.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.363
diff -u -p -r1.363 text2.C
--- src/text2.C	27 May 2003 17:29:00 -	1.363
+++ src/text2.C	27 May 2003 20:54:45 -
@@ -1197,7 +1197,7 @@ void LyXText::setCounter(Buffer const * 
 	isOK = true;
 	break;
 } else {
-	tmppit = ownerParagraphs().find(*in-parOwner());
+	tmppit = std::find(ownerParagraphs().begin(), ownerParagraphs().end(), *in-parOwner());
 }
 			}
 

-- 
Lgb


Re: [Devel] Re: [PATCH] Re: bug: text-footnote

2003-05-30 Thread Juergen Spitzmueller
John Levon wrote:
 Rejected. We don't fix our bugs by trying to fix our users. Or rather,
 we shouldn't.

OK. Then I'm out (no more ideas). But I vote for removing the current 
conversion. If we don't do it right, we should not do it at all.

Jürgen.


Re: More thoughts about external inset

2003-05-30 Thread Helge Hafting
On Mon, May 26, 2003 at 11:15:04AM -0400, Zvezdan Petkovic wrote:
 On Thu, May 22, 2003 at 10:47:29AM +0200, Helge Hafting wrote:
  Truetype fonts in pdf seems to work only with pdflatex, not
  dvi-ps-pdf. And the pdflatex way is noticeable faster too.
 
 People obviously do not bother to learn real LaTeX any more.
I don't claim to be an expert on latex.  Thats why I
say it _seems_ to not work.  The only dvi-ps-pdf
conversion I tried is the one that lyx does, running
this manually isn't something I want to do everytime.
 Try
   dvips -Ppdf -o file.ps file.dvi
 and you'll get Type1 TeX fonts (it's Type1, not TrueType, for printing).
 
I have no problem using type1 fonts in latex.  The problem was
to use _TrueType_ fonts because that was what the publisher
sent me, and produce a pdf file, because that is what they want.
And the font must be embedded, bitmaps aren't resolution independent.
The problem was solved by asking for a type1 version of the font,
which they happened to have.

 I agree that pdflatex is the more direct way to pdf.  I just want to
 point out that the first statement is not true.
 
Fine if you can point out a way to get truetype fonts in latex
into a pdf without pdflatex, but type1 won't do that.

Helge Hafting


Re: [Devel] Re: [PATCH] Re: bug: text-footnote

2003-05-30 Thread Juergen Spitzmueller
John Levon wrote:
 We wouldn't end up doing anything, we do barely anything fully
 correctly.

 Why can't we just use your patch, and file a bug on the broken clipboard
 behaviour ? It's a reasonable tradeoff of bugs IMHO.

Note that even if this might sound so, I am not frustrated at all. It's just 
that I proposed several implementations and there have been valid objections 
to any of these (though I have another point of view). I thought about 
another solution, but I cannot think of any that solves all problems (except 
the clipboard enhancements JMarc proposed, but they are off my skills). 

 (Do you want to send me your patch for 1.4 again ?)

Yes, shure.

Regards,
Jürgen
Index: src/text3.C
===
RCS file: /cvs/lyx/lyx-devel/src/text3.C,v
retrieving revision 1.73
diff -u -r1.73 text3.C
--- src/text3.C	2003/05/19 07:12:08	1.73
+++ src/text3.C	2003/05/21 12:05:57
@@ -371,7 +371,6 @@
 		bv-updateInset(new_inset);
 }
 
-
 void doInsertInset(LyXText * lt, FuncRequest const  cmd,
 		   bool edit, bool pastesel)
 {
@@ -381,7 +380,7 @@
 	if (inset) {
 		bool gotsel = false;
 		if (lt-selection.set()) {
-			lt-cutSelection(true, false);
+			bv-owner()-dispatch(FuncRequest(LFUN_CUT));
 			gotsel = true;
 		}
 		if (bv-insertInset(inset)) {
@@ -390,7 +389,7 @@
 inset-localDispatch(cmd);
 			}
 			if (gotsel  pastesel)
-bv-owner()-dispatch(FuncRequest(LFUN_PASTESELECTION));
+bv-owner()-dispatch(FuncRequest(LFUN_PASTE));
 		}
 		else
 			delete inset;


Re: 1.3.2 for Windoze

2003-05-30 Thread Ruurd Reitsma
 Just to mention another option:

 I've used 'InnoSetup' at the time I had to create a Windows version of my
 programms. That creates nice installers which can create icons on the
 desktop etc and had the benefit that InnoSetup itself as well as the
 created installers ran fine under Wine.


To get back at my original question: Can I put it on the lyx ftp site when
I'm done?

Ruurd





[crashing patch] Real copy constructors

2003-05-30 Thread Lars Gullik Bjønnes

We really need to make Inset::clone take no arguments, this cleans up
stuff and makes other things easier to understand... unfortunately it
is not so easy...

This patch does it, the brute force way, and as a result you get a lot
of nice crashes. Please have a look if you want to exercise your
problem solving abilities.

Compiles, links and runs kindo...

? src/less
? src/frontends/xforms/lyx_forms.h
? src/frontends/xforms/lyx_xpm.h
Index: src/paragraph.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.279
diff -u -p -r1.279 paragraph.C
--- src/paragraph.C 29 May 2003 11:19:50 -  1.279
+++ src/paragraph.C 29 May 2003 16:23:07 -
@@ -91,7 +91,7 @@ Paragraph::Paragraph(Paragraph const  l
InsetList::iterator it = insetlist.begin();
InsetList::iterator end = insetlist.end();
for (; it != end; ++it) {
-   it-inset = it-inset-clone(**buffer_);
+   it-inset = it-inset-clone();
// tell the new inset who is the boss now
it-inset-parOwner(this);
}
@@ -224,14 +224,14 @@ void Paragraph::validate(LaTeXFeatures 
 // First few functions needed for cut and paste and paragraph breaking.
 void Paragraph::copyIntoMinibuffer(Buffer const  buffer, pos_type pos) const
 {
-   BufferParams bparams = buffer.params;
+   BufferParams const  bparams = buffer.params;
 
minibuffer_char = getChar(pos);
minibuffer_font = getFontSettings(bparams, pos);
minibuffer_inset = 0;
if (minibuffer_char == Paragraph::META_INSET) {
if (getInset(pos)) {
-   minibuffer_inset = getInset(pos)-clone(buffer);
+   minibuffer_inset = getInset(pos)-clone();
} else {
minibuffer_inset = 0;
minibuffer_char = ' ';
Index: src/insets/inset.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.h,v
retrieving revision 1.94
diff -u -p -r1.94 inset.h
--- src/insets/inset.h  28 May 2003 23:09:14 -  1.94
+++ src/insets/inset.h  29 May 2003 16:23:08 -
@@ -209,7 +209,7 @@ public:
}
 
///
-   virtual Inset * clone(Buffer const ) const = 0;
+   virtual Inset * clone() const = 0;
 
/// returns true to override begin and end inset in file
virtual bool directWrite() const;
Index: src/insets/insetbibitem.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibitem.C,v
retrieving revision 1.14
diff -u -p -r1.14 insetbibitem.C
--- src/insets/insetbibitem.C   28 May 2003 06:47:15 -  1.14
+++ src/insets/insetbibitem.C   29 May 2003 16:23:08 -
@@ -43,20 +43,10 @@ InsetBibitem::~InsetBibitem()
 }
 
 
-Inset * InsetBibitem::clone(Buffer const ) const
+Inset * InsetBibitem::clone() const
 {
-   InsetBibitem * b = new InsetBibitem(params());
-   b-setCounter(counter);
-   return b;
+   return new InsetBibitem(*this);
 }
-
-
-// Inset * InsetBibitem::clone(Buffer const , bool) const
-// {
-// InsetBibitem * b = new InsetBibitem(params());
-// b-setCounter(counter);
-// return b;
-// }
 
 
 dispatch_result InsetBibitem::localDispatch(FuncRequest const  cmd)
Index: src/insets/insetbibitem.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibitem.h,v
retrieving revision 1.7
diff -u -p -r1.7 insetbibitem.h
--- src/insets/insetbibitem.h   28 May 2003 23:09:14 -  1.7
+++ src/insets/insetbibitem.h   29 May 2003 16:23:08 -
@@ -29,7 +29,7 @@ public:
///
~InsetBibitem();
///
-   Inset * clone(Buffer const ) const;
+   Inset * clone() const;
///
virtual dispatch_result localDispatch(FuncRequest const  cmd);
/** Currently \bibitem is used as a LyX2.x command,
Index: src/insets/insetbibtex.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibtex.h,v
retrieving revision 1.9
diff -u -p -r1.9 insetbibtex.h
--- src/insets/insetbibtex.h28 May 2003 23:09:14 -  1.9
+++ src/insets/insetbibtex.h29 May 2003 16:23:08 -
@@ -27,7 +27,7 @@ public:
///
~InsetBibtex();
///
-   Inset * clone(Buffer const ) const {
+   Inset * clone() const {
return new InsetBibtex(params());
}
/// small wrapper for the time being
Index: src/insets/insetcite.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcite.h,v
retrieving revision 1.33
diff -u -p -r1.33 insetcite.h
--- src/insets/insetcite.h  28 May 2003 23:09:14 -  1.33
+++ 

Re: [patch] More wild parlist work.

2003-05-30 Thread Asger Kunuk Alstrup Nielsen
On Tue, 27 May 2003, Andre Poenitz wrote:

 But we would need to be careful nevertheless as in some cases we would
 still have to invalidate iterators (i.e. when the underlying paragraph is
 removed).

 So in e.g. undo we'd better not remove the changed par from the list and
 re-insert a copy of an old one as this invalidates all iterators pointing
 to that paragraph and we might be interested in keeping a few of them
 alive...

I see what you mean. When a paragraph is removed, and thus moved to
undo stack, the iterators for error insets, cursors, and bookmarks
in those affected paragraphs surely should invalidate in the document.

But when you then undo, you want to restore the iterators. For this to
work, you need to move all the old iterators into your undo-structure,
and when you undo, restore all of these as well. (Alternatively, you can
choose to accept that iterators might break across the undo barrier,
although that's not too great.) In other words, it's logical to let all
iterators be part of the data structure itself as well.

Regards,
Asger


[PATCH] fix several button click does nothing

2003-05-30 Thread John Levon

Seems relatively straight forward. Comments ?

regards
john


Index: insets/insetcite.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcite.C,v
retrieving revision 1.53
diff -u -p -r1.53 insetcite.C
--- insets/insetcite.C  26 May 2003 09:13:53 -  1.53
+++ insets/insetcite.C  28 May 2003 03:53:14 -
@@ -334,7 +334,7 @@ dispatch_result InsetCitation::localDisp
break;
 
default:
-   return UNDISPATCHED;
+   return InsetCommand::localDispatch(cmd);
}
return DISPATCHED;
 }
Index: insets/insetinclude.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.C,v
retrieving revision 1.117
diff -u -p -r1.117 insetinclude.C
--- insets/insetinclude.C   26 May 2003 09:13:53 -  1.117
+++ insets/insetinclude.C   28 May 2003 03:53:16 -
@@ -136,7 +136,7 @@ dispatch_result InsetInclude::localDispa
return DISPATCHED;
 
default:
-   return UNDISPATCHED;
+   return InsetButton::localDispatch(cmd);
}
 }
 
Index: insets/insetindex.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetindex.C,v
retrieving revision 1.40
diff -u -p -r1.40 insetindex.C
--- insets/insetindex.C 26 May 2003 09:13:53 -  1.40
+++ insets/insetindex.C 28 May 2003 03:53:16 -
@@ -52,7 +52,7 @@ dispatch_result InsetIndex::localDispatc
return DISPATCHED;
 
default:
-   return UNDISPATCHED;
+   return InsetCommand::localDispatch(cmd);
}
 }
 
Index: insets/insetparent.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetparent.C,v
retrieving revision 1.50
diff -u -p -r1.50 insetparent.C
--- insets/insetparent.C26 May 2003 09:13:53 -  1.50
+++ insets/insetparent.C28 May 2003 03:53:16 -
@@ -56,7 +56,7 @@ dispatch_result InsetParent::localDispat
cmd.view()-owner()-dispatch(FuncRequest(LFUN_CHILDOPEN, 
getContents()));
return DISPATCHED;
default:
-   return UNDISPATCHED;
+   return InsetCommand::localDispatch(cmd);
}
 }
 
Index: insets/insetref.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetref.C,v
retrieving revision 1.64
diff -u -p -r1.64 insetref.C
--- insets/insetref.C   26 May 2003 09:13:53 -  1.64
+++ insets/insetref.C   28 May 2003 03:53:16 -
@@ -52,7 +52,7 @@ dispatch_result InsetRef::localDispatch(
return DISPATCHED;
 
default:
-   return UNDISPATCHED;
+   return InsetCommand::localDispatch(cmd);
}
 }
 
Index: insets/insettoc.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettoc.C,v
retrieving revision 1.43
diff -u -p -r1.43 insettoc.C
--- insets/insettoc.C   26 May 2003 09:13:54 -  1.43
+++ insets/insettoc.C   28 May 2003 03:53:22 -
@@ -66,7 +66,7 @@ dispatch_result InsetTOC::localDispatch(
InsetCommandMailer(toc, *this).showDialog(cmd.view());
return DISPATCHED;
default:
-   return UNDISPATCHED;
+   return InsetCommand::localDispatch(cmd);
}
 }
 


Stuff became very slow

2003-05-30 Thread John Levon

Load extended.lyx and find the first Itemize list, then increase the
depth of one of the items. Dead slow. Has to be fixed I think

Profiles later

john


Re: [Devel] Re: [PATCH] Re: bug: text-footnote

2003-05-30 Thread John Levon
On Wed, May 28, 2003 at 02:28:13PM +0200, Juergen Spitzmueller wrote:

 OK. Then I'm out (no more ideas). But I vote for removing the current 
 conversion. If we don't do it right, we should not do it at all.

We wouldn't end up doing anything, we do barely anything fully
correctly.

Why can't we just use your patch, and file a bug on the broken clipboard
behaviour ? It's a reasonable tradeoff of bugs IMHO.

(Do you want to send me your patch for 1.4 again ?)

john


[meta-PATCH] bibtex inset crashes on reading in (Angus !)

2003-05-30 Thread John Levon

The bibtex inset now constructs itself using InsetCommandParams
in factory.C with a name of bibtex. This breaks when you read it in,
since we are expecting BibTeX as the command name.

Possible fixes :

 o make createInset() set the command name to BibTeX (I assume this
   won't break the dialogs, which uses bibtex ?)

 o make readInset() handle bibtex as well

 o make readInset() handle only bibtex, and do s/BibTeX/bibtex/ in
   lyx2lyx

So ... which one ? or another ?

regards
john


Re: [PATCH] Re: bug: text-footnote

2003-05-30 Thread John Levon
On Tue, May 27, 2003 at 01:49:23PM +0200, Jean-Marc Lasgouttes wrote:

 The solution would be to modify CutAndPaste to allow an alternative
 temporary clipboard, but this is probably a lot of work.

It's probably not that much work once lars is finished actually.

I'm OK with Juergen's patch as is. The delete behaviour has been around
forever hasn't it ?

john


Re: [PATCH] fix exiting of cells with Escape

2003-05-30 Thread John Levon
On Tue, May 27, 2003 at 10:00:26AM +0200, Andre Poenitz wrote:

 But its a worthy goal...

It is. In 1.7 ... (Lars' new nickname for not gonna happen :)

john


Re: [PATCH] Re: bug: text-footnote

2003-05-30 Thread Lars Gullik Bjønnes
John Levon [EMAIL PROTECTED] writes:

| On Tue, May 27, 2003 at 01:49:23PM +0200, Jean-Marc Lasgouttes wrote:
| 
|  The solution would be to modify CutAndPaste to allow an alternative
|  temporary clipboard, but this is probably a lot of work.
| 
| It's probably not that much work once lars is finished actually.

Finished with what?

I am pretty finished with CutAndPaste.

-- 
Lgb


Re: [Devel] possible minipage partial fix

2003-05-30 Thread John Levon
On Wed, May 28, 2003 at 04:24:44AM +0100, John Levon wrote:

 This helps a little bit in that minipage gets the right height now ...
 sometimes...

Even better, I can't reproduce any problems at all with the below.
Please review and test.

Andre, I think Dimension::height() is strictly useless. From what I can
tell inset metrics look like :

   
   | Minipage || |
  |---|| |
  |   || \ ascent
  |Text here. ||
  |---|\__ descent

Thus, ascent() + descent() doesn't seem useful. It seems this is
different to how mathed does it.

regards
john


Index: insets/insetminipage.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.C,v
retrieving revision 1.73
diff -u -p -r1.73 insetminipage.C
--- insets/insetminipage.C  27 May 2003 13:54:59 -  1.73
+++ insets/insetminipage.C  28 May 2003 03:27:57 -
@@ -236,14 +236,14 @@ void InsetMinipage::dimension(BufferView
dimension_collapsed(dim);
else {
Dimension d;
-   InsetCollapsable::dimension(bv, font, dim);
+   InsetCollapsable::dimension(bv, font, d);
switch (params_.pos) {
case top:
dim.asc = d.asc;
dim.des = d.des;
break;
case center:
-   dim.asc = d.height() / 2;
+   dim.asc = d.ascent() + d.descent() / 2;
dim.des = dim.asc;
break;
case bottom:
@@ -251,6 +251,7 @@ void InsetMinipage::dimension(BufferView
dim.des = d.asc;
break;
}
+   dim.wid = d.wid;
}
 }
 


Re: [crashing patch] Real copy constructors

2003-05-30 Thread John Levon
On Thu, May 29, 2003 at 06:27:47PM +0200, Lars Gullik Bj?nnes wrote:

 This patch does it, the brute force way, and as a result you get a lot
 of nice crashes. Please have a look if you want to exercise your
 problem solving abilities.

Don't we have enough problems to solve already in terms of crashes ?
You didn't say what help this patch will be to solving the crashes ...

Sorry to whine but ...

regards
john


Re: [Devel] Re: [PATCH] Re: bug: text-footnote

2003-05-30 Thread John Levon
On Wed, May 28, 2003 at 09:08:35AM +0200, Juergen Spitzmueller wrote:

  Just that the user does not expect that the clipboard is modified.
  There should not be any clipboard modification without an explicit
  cut/copy.
 
 Well then how about this? (As I said, the current implementation is more 
 confusing than helpful).

Rejected. We don't fix our bugs by trying to fix our users. Or rather,
we shouldn't.

 P.S.: For the sake of power users, I vote for the possibility to add a Don't 
 ask again checkbox to the Alert dialogs.

Adding such means we failed in our error handling.

regards
john


Re: [Devel] possible minipage partial fix

2003-05-30 Thread John Levon
On Wed, May 28, 2003 at 08:37:00AM +0200, Andre Poenitz wrote:

 The notion 'ascent above baseline' (positive upwards) and 'descent below
 baseline' (positive downwards) is not mathed's invention (certainly not
 mine).

Didn't say it was.

  +   dim.asc = d.ascent() + d.descent() / 2;
 
 And that works?

Yes, try it. (start from top of row, add half of the row height).

 
 cvs diff to two weeks ago yields:
 
 -   i = (InsetCollapsable::ascent(bv, font)
 -+ InsetCollapsable::descent(bv, font)) / 2;
 +   dim.asc = d.height() / 2;
 +   dim.des = dim.asc;
 
 so this should be 
 
 dim.asc = (d.ascent() + d.descent()) / 2 
 
 which _is_ equivalent to
 
 dim.asc = d.height()  / 2 

*shrug*. Too much has changed for me to play the why game.

john


possible minipage partial fix

2003-05-30 Thread John Levon

This helps a little bit in that minipage gets the right height now ...
sometimes...

Andre, please look.

There is still total horkage for minipages alas. It thinks it has a 
width of 0. Andre, I don't see any handling of -1 widths. Where does the
correction from -1 - max text width happen ?

regards
john

p.s. I think we've reached the state in current CVS where going back is
impossible. Two of the most complex subsystems (inset metrics and undo)
will have to be rewritten. I reckon it will take six months or so to
get things back to a usable state since trying to fix things is so
incredibly difficult


Index: insets/insetminipage.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.C,v
retrieving revision 1.73
diff -u -p -r1.73 insetminipage.C
--- insets/insetminipage.C  27 May 2003 13:54:59 -  1.73
+++ insets/insetminipage.C  28 May 2003 02:44:57 -
@@ -236,7 +236,7 @@ void InsetMinipage::dimension(BufferView
dimension_collapsed(dim);
else {
Dimension d;
-   InsetCollapsable::dimension(bv, font, dim);
+   InsetCollapsable::dimension(bv, font, d);
switch (params_.pos) {
case top:
dim.asc = d.asc;


Re: [patch] More wild parlist work.

2003-05-30 Thread John Levon
On Tue, May 27, 2003 at 11:11:37AM +0200, Andre Poenitz wrote:

 If there is really an UI issue, this can be brushed over later
 (like 'jump ahead two positions on Cursor-Right when the next inset is
 invisible)

strictly shutting up on UI issues as told, this makes for ugly core
code. Little hacks like this is what left text.C in the state that it is

regards
john


Re: Stuff became very slow

2003-05-30 Thread John Levon
On Thu, May 29, 2003 at 02:32:00AM +0100, John Levon wrote:

 Load extended.lyx and find the first Itemize list, then increase the
 depth of one of the items. Dead slow. Has to be fixed I think

Lars, looks like you're right about find_if :

CPU: PIII, speed 863.195 MHz (estimated)
Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a unit mask of 
0x00 (No unit mask) count 23150
vma  samples  %   image name   symbol name
08153028 7349  8.5427 lyx  VSpace::operator==(VSpace 
const) const
08092b84 6755  7.8522 lyx  
vectorboost::shared_ptrParameterStruct::iterator 
find_ifvectorboost::shared_ptrParameterStruct::iterator, 
ShareContainerParameterStruct::isEqual(vectorboost::shared_ptrParameterStruct::iterator,
 vectorboost::shared_ptrParameterStruct::iterator, 
ShareContainerParameterStruct::isEqual, random_access_iterator_tag)
00069a10 5671  6.5921 libstdc++.so.5.0.1   string::find(char const*, 
unsigned, unsigned) const
0006a250 3331  3.8720 libstdc++.so.5.0.1   string::compare(string const) 
const
4201e850 3047  3.5419 libc-2.3.2.so__GI_setlocale
9f30 1762  2.0482 libpthread-0.10.so   __pthread_alt_unlock
420745e0 1698  1.9738 libc-2.3.2.so_int_malloc
4207b8d0 1603  1.8634 libc-2.3.2.sostrlen
a120 1532  1.7808 libpthread-0.10.so   __pthread_alt_lock
4207a6a0 1476  1.7157 libc-2.3.2.sostrcmp
4207d870 1381  1.6053 libc-2.3.2.somemcpy
4202a510 1278  1.4856 libc-2.3.2.so__GI_getenv
0806ddf8 1264  1.4693 lyx  
_Rb_tree_base_iterator::_M_increment()
42047c80 1144  1.3298 libc-2.3.2.so_IO_vfprintf_internal
0813bdb4 1095  1.2729 lyx  LyXText::setCounter(Buffer 
const*, _List_iteratorParagraph, Paragraph, Paragraph*)
08093d94 999   1.1613 lyx  Spacing::getValue() const
4207a530 943   1.0962 libc-2.3.2.soindex
080bdc5c 883   1.0264 lyx  Counters::reset(string const)

What does this ParameterStruct lookup do ?

regards
john


Re: Stuff became very slow

2003-05-30 Thread Lars Gullik Bjønnes
John Levon [EMAIL PROTECTED] writes:

| On Thu, May 29, 2003 at 02:32:00AM +0100, John Levon wrote:
| 
|  Load extended.lyx and find the first Itemize list, then increase the
|  depth of one of the items. Dead slow. Has to be fixed I think
| 
| Lars, looks like you're right about find_if :
| 
| CPU: PIII, speed 863.195 MHz (estimated)
| Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a unit mask of 
0x00 (No unit mask) count 23150
| vma  samples  %   image name   symbol name
| 08153028 7349  8.5427 lyx  VSpace::operator==(VSpace 
const) const
| 08092b84 6755  7.8522 lyx  
vectorboost::shared_ptrParameterStruct::iterator 
find_ifvectorboost::shared_ptrParameterStruct::iterator, 
ShareContainerParameterStruct::isEqual(vectorboost::shared_ptrParameterStruct::iterator,
 vectorboost::shared_ptrParameterStruct::iterator, 
ShareContainerParameterStruct::isEqual, random_access_iterator_tag)
| 00069a10 5671  6.5921 libstdc++.so.5.0.1   string::find(char const*, 
unsigned, unsigned) const
| 0006a250 3331  3.8720 libstdc++.so.5.0.1   string::compare(string 
const) const
| 4201e850 3047  3.5419 libc-2.3.2.so__GI_setlocale
| 9f30 1762  2.0482 libpthread-0.10.so   __pthread_alt_unlock
| 420745e0 1698  1.9738 libc-2.3.2.so_int_malloc
| 4207b8d0 1603  1.8634 libc-2.3.2.sostrlen
| a120 1532  1.7808 libpthread-0.10.so   __pthread_alt_lock
| 4207a6a0 1476  1.7157 libc-2.3.2.sostrcmp
| 4207d870 1381  1.6053 libc-2.3.2.somemcpy
| 4202a510 1278  1.4856 libc-2.3.2.so__GI_getenv
| 0806ddf8 1264  1.4693 lyx  
_Rb_tree_base_iterator::_M_increment()
| 42047c80 1144  1.3298 libc-2.3.2.so_IO_vfprintf_internal
| 0813bdb4 1095  1.2729 lyx  LyXText::setCounter(Buffer 
const*, _List_iteratorParagraph, Paragraph, Paragraph*)
| 08093d94 999   1.1613 lyx  Spacing::getValue() const
| 4207a530 943   1.0962 libc-2.3.2.soindex
| 080bdc5c 883   1.0264 lyx  Counters::reset(string const)
| 
| What does this ParameterStruct lookup do ?

Lookups Paragraph Parameters.

It is very hard to say anything without a call trace...

I wonder what made this come up now...
Can it be some iterator search that searches from the beginning of the
document all the time?

-- 
Lgb


Re: Stuff became very slow

2003-05-30 Thread John Levon
On Fri, May 30, 2003 at 12:32:44AM +0200, Lars Gullik Bj?nnes wrote:

 I wonder what made this come up now...
 Can it be some iterator search that searches from the beginning of the
 document all the time?

getParFromID via undo ?

john


graphics cache file path horkage

2003-05-30 Thread John Levon

Is there anyone who knows this code ? Angus ?

We seem to be storing relative paths in the InsetGraphics
cache (see cache_-update()). This is broken across e.g. file-save as.
It also causes significant problems in trying to fix the current
massive horkage in the tree.

I believe we should *always* store an absolute path at
runtime. At save time, we can convert it to a relative path.

Does this make sense ?

regards
john


[PATCH] remove spurious Buffer usage in InsetRef::clone()

2003-05-30 Thread John Levon

Please review. This is a necessary starting point to the optional
brekage

john


Index: insetcommand.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcommand.C,v
retrieving revision 1.75
diff -u -p -r1.75 insetcommand.C
--- insetcommand.C  26 May 2003 09:13:53 -  1.75
+++ insetcommand.C  30 May 2003 00:49:53 -
@@ -31,9 +31,10 @@ InsetCommand::InsetCommand(InsetCommandP
 {}
 
 
-// InsetCommand::InsetCommand(InsetCommandParams const  p, bool)
-// : p_(p.getCmdName(), p.getContents(), p.getOptions())
-// {}
+InsetCommand::InsetCommand(InsetCommand const  ic)
+   p_(ic.p_)
+{
+}
 
 
 void InsetCommand::setParams(InsetCommandParams const  p)
Index: insetcommand.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcommand.h,v
retrieving revision 1.63
diff -u -p -r1.63 insetcommand.h
--- insetcommand.h  28 May 2003 23:09:14 -  1.63
+++ insetcommand.h  30 May 2003 00:49:54 -
@@ -33,6 +33,8 @@ public:
explicit
InsetCommand(InsetCommandParams const );
///
+   InsetCommand(InsetCommand const );
+   ///
void write(Buffer const *, std::ostream  os) const
{ p_.write(os); }
///
Index: insetfloatlist.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloatlist.h,v
retrieving revision 1.22
diff -u -p -r1.22 insetfloatlist.h
--- insetfloatlist.h26 May 2003 09:13:53 -  1.22
+++ insetfloatlist.h30 May 2003 00:49:55 -
@@ -30,10 +30,6 @@ public:
return new InsetFloatList(getCmdName());
}
///
-   //Inset * clone(Buffer const , bool = false) const {
-   //  return new InsetFloatList(getCmdName());
-   //}
-   ///
dispatch_result localDispatch(FuncRequest const  cmd);
///
string const getScreenLabel(Buffer const *) const;
Index: insetref.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetref.C,v
retrieving revision 1.65
diff -u -p -r1.65 insetref.C
--- insetref.C  28 May 2003 16:36:54 -  1.65
+++ insetref.C  30 May 2003 00:49:59 -
@@ -28,9 +28,10 @@ InsetRef::InsetRef(InsetCommandParams co
 {}
 
 
-// InsetRef::InsetRef(InsetCommandParams const  p, Buffer const  buf, bool)
-// : InsetCommand(p, false), isLatex(buf.isLatex())
-// {}
+InsetRef::InsetRef(InsetRef const  ir)
+   : InsetCommand(ir), isLatex(ir.isLatex)
+{
+}
 
 
 InsetRef::~InsetRef()
Index: insetref.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetref.h,v
retrieving revision 1.48
diff -u -p -r1.48 insetref.h
--- insetref.h  28 May 2003 23:09:14 -  1.48
+++ insetref.h  30 May 2003 00:49:59 -
@@ -35,13 +35,15 @@ public:
///
static string const  getName(int type);
 
-   ///
+
InsetRef(InsetCommandParams const , Buffer const );
-   ///
+
+   InsetRef(InsetRef const );
+
~InsetRef();
///
-   virtual Inset * clone(Buffer const  buffer) const {
-   return new InsetRef(params(), buffer);
+   virtual Inset * clone(Buffer const ) const {
+   return new InsetRef(*this);
}
///
dispatch_result localDispatch(FuncRequest const  cmd);


Re: graphics cache file path horkage

2003-05-30 Thread John Levon
On Fri, May 30, 2003 at 01:49:28AM +0100, John Levon wrote:

 I believe we should *always* store an absolute path at
 runtime. At save time, we can convert it to a relative path.

Here's an attempt at a patch. Not tested

john


Index: insetgraphics.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.176
diff -u -p -r1.176 insetgraphics.C
--- insetgraphics.C 28 May 2003 23:09:14 -  1.176
+++ insetgraphics.C 30 May 2003 01:21:21 -
@@ -182,7 +182,7 @@ void InsetGraphics::Cache::update(string
lyx::Assert(!file_with_path.empty());
 
string const path = OnlyPath(file_with_path);
-   loader.reset(file_with_path, parent_.params().as_grfxParams(path));
+   loader.reset(file_with_path, parent_.params().as_grfxParams());
 }
 
 
@@ -192,19 +192,20 @@ InsetGraphics::InsetGraphics()
 {}
 
 
-InsetGraphics::InsetGraphics(InsetGraphics const  ig,
-string const  filepath)
+#warning I have zero idea about the trackable()
+InsetGraphics::InsetGraphics(InsetGraphics const  ig)
: Inset(ig),
+ boost::signals::trackable(ig),
  graphic_label(uniqueID()),
  cache_(new Cache(*this))
 {
-   setParams(ig.params(), filepath);
+   setParams(ig.params());
 }
 
 
-Inset * InsetGraphics::clone(Buffer const  buffer) const
+Inset * InsetGraphics::clone(Buffer const ) const
 {
-   return new InsetGraphics(*this, buffer.filePath());
+   return new InsetGraphics(*this);
 }
 
 
@@ -222,8 +223,7 @@ dispatch_result InsetGraphics::localDisp
InsetGraphicsParams p;
InsetGraphicsMailer::string2params(cmd.argument, p);
if (!p.filename.empty()) {
-   string const filepath = cmd.view()-buffer()-filePath();
-   setParams(p, filepath);
+   setParams(p);
cmd.view()-updateInset(this);
}
return DISPATCHED;
@@ -327,18 +327,6 @@ BufferView * InsetGraphics::view() const
 void InsetGraphics::draw(BufferView * bv, LyXFont const  font,
 int baseline, float  x) const
 {
-   // MakeAbsPath returns params().filename unchanged if it absolute
-   // already.
-   string const file_with_path =
-   MakeAbsPath(params().filename, bv-buffer()-filePath());
-
-   // A 'paste' operation creates a new inset with the correct filepath,
-   // but then the 'old' inset stored in the 'copy' operation is actually
-   // added to the buffer.
-   // Thus, we should ensure that the filepath is correct.
-   if (file_with_path != cache_-loader.filename())
-   cache_-update(file_with_path);
-
cache_-view = bv-owner()-view();
int oasc = cache_-old_ascent;
 
@@ -408,10 +396,10 @@ Inset::EDITABLE InsetGraphics::editable(
 }
 
 
-void InsetGraphics::write(Buffer const *, ostream  os) const
+void InsetGraphics::write(Buffer const * buf, ostream  os) const
 {
os  Graphics\n;
-   params().Write(os);
+   params().Write(os, buf-filePath());
 }
 
 
@@ -420,15 +408,15 @@ void InsetGraphics::read(Buffer const * 
string const token = lex.getString();
 
if (token == Graphics)
-   readInsetGraphics(lex);
+   readInsetGraphics(lex, buf-filePath());
else
lyxerr[Debug::GRAPHICS]  Not a Graphics inset!\n;
 
-   cache_-update(MakeAbsPath(params().filename, buf-filePath()));
+   cache_-update(params().filename);
 }
 
 
-void InsetGraphics::readInsetGraphics(LyXLex  lex)
+void InsetGraphics::readInsetGraphics(LyXLex  lex, string const  bufpath)
 {
bool finished = false;
 
@@ -455,7 +443,7 @@ void InsetGraphics::readInsetGraphics(Ly
// TODO: Possibly open up a dialog?
}
else {
-   if (! params_.Read(lex, token))
+   if (!params_.Read(lex, token, bufpath))
lyxerr  Unknown token,   token  , skipping.
 std::endl;
}
@@ -518,17 +506,13 @@ string const InsetGraphics::prepareFile(
 {
// LaTeX can cope if the graphics file doesn't exist, so just return the
// filename.
-   string const orig_file = params().filename;
-   string orig_file_with_path =
-   MakeAbsPath(orig_file, buf-filePath());
-   lyxerr[Debug::GRAPHICS]  [InsetGraphics::prepareFile] orig_file = 
-orig_file  \n\twith path: 
-orig_file_with_path  endl;
+   string orig_file = params().filename;
+   string const rel_file = MakeRelPath(orig_file, buf-filePath());
 
-   if (!IsFileReadable(orig_file_with_path))
-   return orig_file;
+   if (!IsFileReadable(rel_file))
+   return 

InsetInclude::clone()

2003-05-30 Thread John Levon

Lars, this one is tricky for cross-buffer copy.

You need to add some code to iterate across all inset includes
in the buffer and replace masterFilename I think. Does this sound
sensible ?

Should InsetInclude store a Buffer * ?

Is Inset::clone() used anywhere else  than undo and copy/paste ?

regards
john


[PATCH] Re: graphics cache file path horkage

2003-05-30 Thread John Levon
On Fri, May 30, 2003 at 02:24:22AM +0100, John Levon wrote:

  I believe we should *always* store an absolute path at
  runtime. At save time, we can convert it to a relative path.

Fixed patch. It seems to work for me. It fixes the Save As bug.

Please please test.

john

p.s. sorry, no, I'm not taking maintainership of this code

Index: factory.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/factory.C,v
retrieving revision 1.29
diff -u -p -r1.29 factory.C
--- factory.C   22 May 2003 10:40:55 -  1.29
+++ factory.C   30 May 2003 02:15:38 -
@@ -211,8 +211,7 @@ Inset * createInset(FuncRequest const  
InsetGraphicsParams igp;
InsetGraphicsMailer::string2params(cmd.argument, igp);
InsetGraphics * inset = new InsetGraphics;
-   string const fpath = cmd.view()-buffer()-filePath();
-   inset-setParams(igp, fpath);
+   inset-setParams(igp);
return inset;
 
} else if (name == include) {
Index: insets/insetgraphics.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.176
diff -u -p -r1.176 insetgraphics.C
--- insets/insetgraphics.C  28 May 2003 23:09:14 -  1.176
+++ insets/insetgraphics.C  30 May 2003 02:15:44 -
@@ -182,7 +182,7 @@ void InsetGraphics::Cache::update(string
lyx::Assert(!file_with_path.empty());
 
string const path = OnlyPath(file_with_path);
-   loader.reset(file_with_path, parent_.params().as_grfxParams(path));
+   loader.reset(file_with_path, parent_.params().as_grfxParams());
 }
 
 
@@ -192,19 +192,20 @@ InsetGraphics::InsetGraphics()
 {}
 
 
-InsetGraphics::InsetGraphics(InsetGraphics const  ig,
-string const  filepath)
+#warning I have zero idea about the trackable()
+InsetGraphics::InsetGraphics(InsetGraphics const  ig)
: Inset(ig),
+ boost::signals::trackable(ig),
  graphic_label(uniqueID()),
  cache_(new Cache(*this))
 {
-   setParams(ig.params(), filepath);
+   setParams(ig.params());
 }
 
 
-Inset * InsetGraphics::clone(Buffer const  buffer) const
+Inset * InsetGraphics::clone(Buffer const ) const
 {
-   return new InsetGraphics(*this, buffer.filePath());
+   return new InsetGraphics(*this);
 }
 
 
@@ -222,8 +223,7 @@ dispatch_result InsetGraphics::localDisp
InsetGraphicsParams p;
InsetGraphicsMailer::string2params(cmd.argument, p);
if (!p.filename.empty()) {
-   string const filepath = cmd.view()-buffer()-filePath();
-   setParams(p, filepath);
+   setParams(p);
cmd.view()-updateInset(this);
}
return DISPATCHED;
@@ -327,18 +327,6 @@ BufferView * InsetGraphics::view() const
 void InsetGraphics::draw(BufferView * bv, LyXFont const  font,
 int baseline, float  x) const
 {
-   // MakeAbsPath returns params().filename unchanged if it absolute
-   // already.
-   string const file_with_path =
-   MakeAbsPath(params().filename, bv-buffer()-filePath());
-
-   // A 'paste' operation creates a new inset with the correct filepath,
-   // but then the 'old' inset stored in the 'copy' operation is actually
-   // added to the buffer.
-   // Thus, we should ensure that the filepath is correct.
-   if (file_with_path != cache_-loader.filename())
-   cache_-update(file_with_path);
-
cache_-view = bv-owner()-view();
int oasc = cache_-old_ascent;
 
@@ -408,10 +396,10 @@ Inset::EDITABLE InsetGraphics::editable(
 }
 
 
-void InsetGraphics::write(Buffer const *, ostream  os) const
+void InsetGraphics::write(Buffer const * buf, ostream  os) const
 {
os  Graphics\n;
-   params().Write(os);
+   params().Write(os, buf-filePath());
 }
 
 
@@ -420,15 +408,15 @@ void InsetGraphics::read(Buffer const * 
string const token = lex.getString();
 
if (token == Graphics)
-   readInsetGraphics(lex);
+   readInsetGraphics(lex, buf-filePath());
else
lyxerr[Debug::GRAPHICS]  Not a Graphics inset!\n;
 
-   cache_-update(MakeAbsPath(params().filename, buf-filePath()));
+   cache_-update(params().filename);
 }
 
 
-void InsetGraphics::readInsetGraphics(LyXLex  lex)
+void InsetGraphics::readInsetGraphics(LyXLex  lex, string const  bufpath)
 {
bool finished = false;
 
@@ -455,7 +443,7 @@ void InsetGraphics::readInsetGraphics(Ly
// TODO: Possibly open up a dialog?
}
else {
-   if (! params_.Read(lex, token))
+   if 

Re: Protected Blank

2003-05-30 Thread John Weiss
On Tue, May 20, 2003 at 08:37:35PM +0100, John Levon wrote:
 
 I think it would be clearer if these menu items  just said Protected
 Space etc. instead. Comments ?

Do it.

In fact, I question why it was ever changed to Protected Blank in
the first space.  It's a protected space, or a non-breaking space.
Those are the two standard terms.

-- 
John Weiss


[PATCH] make clone be clone() patch

2003-05-30 Thread John Levon

OK Lars this is as minimal as it gets. See the #warnings, I would
like you to fill those bits in.

I believe this works out OK because we do LyXTabular(bp) which does
indeed call InsetText(bp), *but* we then overwrite that with operator=.

I think we're OK, maybe ...

But we still have to reset InsetTabular::buffer for all the copied
paragraphs.

comments Lars ? I think it's probably a step forward anyway.

regards
john


Index: CutAndPaste.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/CutAndPaste.C,v
retrieving revision 1.99
diff -u -p -r1.99 CutAndPaste.C
--- CutAndPaste.C   21 May 2003 21:20:48 -  1.99
+++ CutAndPaste.C   30 May 2003 03:56:12 -
@@ -25,8 +25,6 @@
 #include paragraph_funcs.h
 #include debug.h
 
-#include insets/inseterror.h
-
 #include support/LAssert.h
 #include support/lstrings.h
 #include support/limited_stack.h
@@ -320,6 +318,10 @@ CutAndPaste::pasteSelection(ParagraphLis
} else
boost::next(last_paste)-stripLeadingSpaces();
}
+
+#warning FIXME: here we must update all InsetIncludes to have the buffer as the 
master filename
+#warning FIXME: and also reset all insettabular's buffer value to the target buffer
+#warning (that's right, another parameter to the function :()
 
return make_pair(PitPosPair(pit, pos), endpit);
 }
Index: buffer.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.475
diff -u -p -r1.475 buffer.C
--- buffer.C29 May 2003 01:13:15 -  1.475
+++ buffer.C30 May 2003 03:56:16 -
@@ -369,7 +369,6 @@ int Buffer::readParagraph(LyXLex  lex, 
lex.pushToken(token);
 
Paragraph par;
-   par.owningBuffer(*this);
par.params().depth(depth);
if (params.tracking_changes)
par.trackChanges();
Index: factory.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/factory.C,v
retrieving revision 1.29
diff -u -p -r1.29 factory.C
--- factory.C   22 May 2003 10:40:55 -  1.29
+++ factory.C   30 May 2003 03:56:17 -
@@ -211,8 +211,7 @@ Inset * createInset(FuncRequest const  
InsetGraphicsParams igp;
InsetGraphicsMailer::string2params(cmd.argument, igp);
InsetGraphics * inset = new InsetGraphics;
-   string const fpath = cmd.view()-buffer()-filePath();
-   inset-setParams(igp, fpath);
+   inset-setParams(igp);
return inset;
 
} else if (name == include) {
Index: paragraph.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.279
diff -u -p -r1.279 paragraph.C
--- paragraph.C 29 May 2003 11:19:50 -  1.279
+++ paragraph.C 30 May 2003 03:56:18 -
@@ -84,14 +84,13 @@ Paragraph::Paragraph(Paragraph const  l
// this is because of the dummy layout of the paragraphs that
// follow footnotes
layout_ = lp.layout();
-   buffer_ = lp.buffer_;
 
// copy everything behind the break-position to the new paragraph
insetlist = lp.insetlist;
InsetList::iterator it = insetlist.begin();
InsetList::iterator end = insetlist.end();
for (; it != end; ++it) {
-   it-inset = it-inset-clone(**buffer_);
+   it-inset = it-inset-clone();
// tell the new inset who is the boss now
it-inset-parOwner(this);
}
@@ -231,7 +230,7 @@ void Paragraph::copyIntoMinibuffer(Buffe
minibuffer_inset = 0;
if (minibuffer_char == Paragraph::META_INSET) {
if (getInset(pos)) {
-   minibuffer_inset = getInset(pos)-clone(buffer);
+   minibuffer_inset = getInset(pos)-clone();
} else {
minibuffer_inset = 0;
minibuffer_char = ' ';
Index: paragraph.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.h,v
retrieving revision 1.85
diff -u -p -r1.85 paragraph.h
--- paragraph.h 29 May 2003 11:19:51 -  1.85
+++ paragraph.h 30 May 2003 03:56:18 -
@@ -20,8 +20,6 @@
 
 #include LString.h
 
-#include boost/optional.hpp
-
 class Buffer;
 class BufferParams;
 class BufferView;
@@ -293,15 +291,10 @@ public:
ParagraphParameters const  params() const;
///
InsetList insetlist;
-   ///
-   void owningBuffer(Buffer const  b) {
-   buffer_.reset(b);
-   }
+
 private:
///
LyXLayout_ptr layout_;
-   ///
-   boost::optionalBuffer const * buffer_;
 

Re: Protected Blank

2003-05-30 Thread John Levon
On Thu, May 29, 2003 at 09:32:25PM -0400, John Weiss wrote:

 Do it.

It's already done (though I noticed a capitalisation error so it
wasn't pointless  ;)

I'm not too happy with Force Normal Space. What is '\ ' used for ? A
better name anybody ?

regards
john


Re: Protected Blank

2003-05-30 Thread Juergen Spitzmueller
John Levon wrote:
 I'm not too happy with Force Normal Space. 

Me neither.

 What is '\ ' used for ? A
 better name anybody ?

It forces normal, breakable space, especially after punctuation when latex 
guesses end of sentence (e.\,g.\ here). Basically it is the correct solution 
for most of the cases for where the user guide proposes protected space.

I don't know a good name though.

Jürgen.


Re: Protected Blank

2003-05-30 Thread Garst R. Reese
Juergen Spitzmueller wrote:
 
 John Levon wrote:
  I'm not too happy with Force Normal Space.
 
 Me neither.
 
  What is '\ ' used for ? A
  better name anybody ?
 
 It forces normal, breakable space, especially after punctuation when latex
 guesses end of sentence (e.\,g.\ here). Basically it is the correct solution
 for most of the cases for where the user guide proposes protected space.
 
 I don't know a good name though.
 
 Jürgen.
Why not just Normal Space ?
The word Force is redundant. You could even leave out Normal.

Garst


Re: Stuff became very slow

2003-05-30 Thread Andre Poenitz
On Thu, May 29, 2003 at 11:46:51PM +0100, John Levon wrote:
 On Fri, May 30, 2003 at 12:32:44AM +0200, Lars Gullik Bj?nnes wrote:
 
  I wonder what made this come up now...
  Can it be some iterator search that searches from the beginning of the
  document all the time?
 
 getParFromID via undo ?

Could well be.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


test

2003-05-30 Thread Andre Poenitz

Anybody out there?

Andre'



[patch] IU: draw()

2003-05-30 Thread Andre Poenitz

This is InsetUnificiation for draw()  

[And incidentally the second phase of the two-phase drawing,
and 80 lines of removed code]

There should be no user visible change, but I am not 100% sure because
of the 'float x' - 'int x' change.

Known drawback: For Insets that do not properly implement the first phase
(i.e. almost everything in src/insets) part of the metrics computation (the
width) is done twice per redraw.  But that's purely transitional and only
there to keep the patch small.

If there is nothing fundamentally wrong with it I'd like to apply that
as-is and fix code cosmetics if there are any later.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)
Index: insets/inset.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.h,v
retrieving revision 1.93
diff -u -p -r1.93 inset.h
--- insets/inset.h  28 May 2003 06:47:15 -  1.93
+++ insets/inset.h  28 May 2003 15:41:16 -
@@ -169,8 +169,6 @@ public:
int descent(BufferView *, LyXFont const ) const;
///
int width(BufferView *, LyXFont const ) const;
-   ///
-   virtual void draw(BufferView *, LyXFont const , int baseline, float  x) 
const = 0;
/// update the inset representation
virtual void update(BufferView *, bool = false)
{}
Index: insets/insetbase.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbase.h,v
retrieving revision 1.3
diff -u -p -r1.3 insetbase.h
--- insets/insetbase.h  10 Mar 2003 13:33:39 -  1.3
+++ insets/insetbase.h  28 May 2003 15:41:16 -
@@ -16,6 +16,8 @@
 
 class BufferView;
 class FuncRequest;
+class MetricsInfo;
+class PainterInfo;
 
 /** Dispatch result codes
DISPATCHED  = the inset catched the action
@@ -62,6 +64,8 @@ public:
 
/// small wrapper for the time being
virtual dispatch_result localDispatch(FuncRequest const  cmd);
+   ///
+   virtual void draw(PainterInfo  pi, int x, int y) const = 0;
 
///
virtual ~InsetBase() {}
Index: insets/insetbutton.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbutton.C,v
retrieving revision 1.29
diff -u -p -r1.29 insetbutton.C
--- insets/insetbutton.C27 May 2003 13:54:58 -  1.29
+++ insets/insetbutton.C28 May 2003 15:41:16 -
@@ -21,6 +21,7 @@
 #include frontends/Painter.h
 #include support/LAssert.h
 #include lyxfont.h
+#include metricsinfo.h
 #include frontends/font_metrics.h
 
 using std::ostream;
@@ -46,27 +47,23 @@ void InsetButton::dimension(BufferView *
 }
 
 
-void InsetButton::draw(BufferView * bv, LyXFont const ,
-   int baseline, float  x) const
+void InsetButton::draw(PainterInfo  pi, int x, int y) const
 {
-   lyx::Assert(bv);
-   cache(bv);
+   lyx::Assert(pi.base.bv);
+   cache(pi.base.bv);
 
-   Painter  pain = bv-painter();
// Draw it as a box with the LaTeX text
LyXFont font(LyXFont::ALL_SANE);
font.setColor(LColor::command).decSize();
 
-   string const s = getScreenLabel(bv-buffer());
+   string const s = getScreenLabel(pi.base.bv-buffer());
 
if (editable()) {
-   pain.buttonText(int(x) + 2, baseline, s, font);
+   pi.pain.buttonText(x + 2, y, s, font);
} else {
-   pain.rectText(int(x) + 2, baseline, s, font,
+   pi.pain.rectText(x + 2, y, s, font,
  LColor::commandbg, LColor::commandframe);
}
-
-   x += width(bv, font);
 }
 
 
Index: insets/insetbutton.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbutton.h,v
retrieving revision 1.18
diff -u -p -r1.18 insetbutton.h
--- insets/insetbutton.h23 May 2003 15:30:47 -  1.18
+++ insets/insetbutton.h28 May 2003 15:41:16 -
@@ -25,7 +25,7 @@ public:
///
void dimension(BufferView *, LyXFont const , Dimension ) const;
///
-   void draw(BufferView *, LyXFont const , int, float ) const;
+   void draw(PainterInfo  pi, int x, int y) const;
///
dispatch_result localDispatch(FuncRequest const  cmd);
 
Index: insets/insetcaption.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcaption.C,v
retrieving revision 1.30
diff -u -p -r1.30 insetcaption.C
--- insets/insetcaption.C   23 May 2003 08:59:43 -  1.30
+++ insets/insetcaption.C   28 May 2003 15:41:16 -
@@ -21,6 +21,7 @@
 #include debug.h
 #include gettext.h
 #include Lsstream.h
+#include metricsinfo.h
 #include 

Re: LyX and vTeX

2003-05-30 Thread Andre Poenitz
On Wed, May 28, 2003 at 11:19:55AM +0200, Charpentier Philippe wrote:
 I did that for lyx-1.2.3 and lyx-1.3.2. Precisely I wrote
 
 \format pdf4 pdf PDF (vlatex)  (in the FORMATS SECTION)
 
 and
 
 \converter latex pdf4 /usr/local/vtex/bin/vlatex $$i latex (in the 
 CONVERTERS SECTION)

Good.

 With lyx-1.2.3 all is fine. But with lyx-1.3.2, if there is a latex error in the
 document, lyx crashes with the following output:
 
 lyx: /usr/include/g++-3/std/bastring.cc:126: basic_stringcharT, traits, Allocator 
 basic_stringcharT, traits, Allocator::replace (unsigned int, unsigned int, const 
 basic_stringcharT, traits, Allocator , unsigned int, unsigned int) [with charT = 
 char, traits = string_char_traitschar, Allocator = __default_alloc_templatetrue, 
 0]:  l'assertion `!(pos2  len2)' a échoué.
 /home/pcharpen/bin/monlyxqt: line 6:  8816 Abandon
  [...]
 Is this a bug in LyX?

Looks like it.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Andre Poenitz
On Wed, May 28, 2003 at 09:58:46AM +0200, Lars Gullik Bjønnes wrote:
 but it is not iterator - const_iterator that is cumbersom (as you
 have shown), but const_iterator - iterator.

Ah ok. Well for this the reinterpret_cast would work too, but we shouldn't
use it as this would not be eliminated when we switch over to std::list.

This is rather a sign that there is no const correctness in this area.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Andre Poenitz
On Wed, May 28, 2003 at 09:44:29AM +0200, Lars Gullik Bjønnes wrote:
 | It certainly is undefined behaviour. But every std::list::iterator I know
 | of is binary compatible with its corresponding std::list::const_iterator
 | (in contrast to your string/int example) even if that's not required at
 | all. So it works in practice.
 
 Is 'works' in practice good enough?

We are talking about the transition phase to std::list, don't we?

If so, it is certainly 'good enough' as it would be better then most of the
other stuff like undo etc. ;-}

I was just trying to give a hint how that 'cumbersome' conversion can be
done in one line.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Andre Poenitz
On Wed, May 28, 2003 at 09:05:23AM +0200, Lars Gullik Bjønnes wrote:
 | I think std::list::const_iterator  has a corresponding constructor.
 
 Show me.

I don't find it in the Standard right now.

But:

  templatetypename _Tp, typename _Ref, typename _Ptr
struct _List_iterator : public _List_iterator_base
{
  typedef _List_iterator_Tp,_Tp,_Tp* iterator;
  typedef _List_iterator_Tp,const _Tp,const _Tp* const_iterator;
  typedef _List_iterator_Tp,_Ref,_Ptr _Self;

  typedef _Tp value_type;
  typedef _Ptr pointer;
  typedef _Ref reference;
  typedef _List_node_Tp _Node;

  _List_iterator(_Node* __x)
  : _List_iterator_base(__x)
  { }

  _List_iterator()
  { }

  _List_iterator(const iterator __x) // --
  : _List_iterator_base(__x._M_node)
  { }

and

#include list

int main()
{
std::listint l;
std::listint::const_iterator it = l.end();
}

compiles with g++ and Comeau.

 No... That is like converting string to a int with a reinterpret_cast
 and expecting tings to work... different types.

It certainly is undefined behaviour. But every std::list::iterator I know
of is binary compatible with its corresponding std::list::const_iterator
(in contrast to your string/int example) even if that's not required at
all. So it works in practice.

[Note that I am not proposing this as a long term solution but as a
shortcut to get that constructor working]

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Andre Poenitz
On Wed, May 28, 2003 at 08:35:01AM +0200, Lars Gullik Bjønnes wrote:
 Andre Poenitz [EMAIL PROTECTED] writes:
 
 |  to fit.  All problems larger than  has been solved by a
 |  const_cast.
 
 This ^^
  
 | Wouldn't it be better in such cases to change the functions' signature to 
 | 
 |   int getEndLabel(ParagraphList::const_iterator...
 
 Perhaps. But I am not willing to open that issue now... It is some
 easy to come in the situation that you need to convert
 ParagraphList::iterator to ParagraphList::const_iterator and that is
 reall cumbersome.

I think std::list::const_iterator  has a corresponding constructor.

Cumbersome... a reinterpret_cast in that constructor would work ;-)

Ok, I shut up.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: [Devel] [PATCH] fix several button click does nothing

2003-05-30 Thread Andre Poenitz
On Wed, May 28, 2003 at 05:25:49AM +0100, John Levon wrote:
 Seems relatively straight forward. Comments ?

Good!

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: [Devel] possible minipage partial fix

2003-05-30 Thread Andre Poenitz
On Wed, May 28, 2003 at 05:05:23AM +0100, John Levon wrote:
 Andre, I think Dimension::height() is strictly useless. From what I can
 tell inset metrics look like :
 

| Minipage || |
   |---|| |
   |   || \ ascent
   |Text here. ||
   |---|\__ descent
 
 Thus, ascent() + descent() doesn't seem useful.

I think all I did was to replace the 'ascent + descent' mechanically by
'height'...

 It seems this is different to how mathed does it.

The notion 'ascent above baseline' (positive upwards) and 'descent below
baseline' (positive downwards) is not mathed's invention (certainly not
mine).

TeX has that as 'height' and 'depth'. Maybe this height vs ascent issue
causes some confusion somewhere.

 Index: insets/insetminipage.C
 ===
 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.C,v
 retrieving revision 1.73
 diff -u -p -r1.73 insetminipage.C
 --- insets/insetminipage.C27 May 2003 13:54:59 -  1.73
 +++ insets/insetminipage.C28 May 2003 03:27:57 -
 @@ -236,14 +236,14 @@ void InsetMinipage::dimension(BufferView
   dimension_collapsed(dim);
[...]
   case center:
 - dim.asc = d.height() / 2;
 + dim.asc = d.ascent() + d.descent() / 2;

And that works?

cvs diff to two weeks ago yields:

-   i = (InsetCollapsable::ascent(bv, font)
-+ InsetCollapsable::descent(bv, font)) / 2;
+   dim.asc = d.height() / 2;
+   dim.des = dim.asc;

so this should be 

dim.asc = (d.ascent() + d.descent()) / 2 

which _is_ equivalent to

dim.asc = d.height()  / 2 

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: [Devel] possible minipage partial fix

2003-05-30 Thread Andre Poenitz
On Wed, May 28, 2003 at 04:24:44AM +0100, John Levon wrote:
 
 This helps a little bit in that minipage gets the right height now ...
 sometimes...
 
 Andre, please look.
 
 There is still total horkage for minipages alas. It thinks it has a 
 width of 0. Andre, I don't see any handling of -1 widths. Where does the
 correction from -1 - max text width happen ?

I'll have a look.
 
 p.s. I think we've reached the state in current CVS where going back is
 impossible.

I hope so.

 Two of the most complex subsystems (inset metrics and undo)
 will have to be rewritten. I reckon it will take six months or so to
 get things back to a usable state since trying to fix things is so
 incredibly difficult

Your reckoning is flawed ;-)

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


naming

2003-05-30 Thread Andre Poenitz

Can people please make the mind up how the first phase (the metrics
computation) in a two-phase drawing should be named?

Currently we have two precursors of such a first phase: 'metrics()'
in mathed/* and 'dimension' in inset/*.

I'd prefer a reasonably short name, so 'computeMetricsOrDimensions'
is not good.

If no consensus appears I'd stick to 'metrics' as it is used in more
cases than 'dimension'. 

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: [Devel] [patch] Drop ParagraphList::find

2003-05-30 Thread Andre Poenitz
On Tue, May 27, 2003 at 11:27:55PM +0200, Lars Gullik Bjønnes wrote:
+bool operator==(Paragraph const  lhs, Paragraph const  rhs)
+{
+#warning FIXME this implementatoin must be completely wrong...
+   return lhs == rhs;
+}

As the warning says.

Wouldn't it be more prudent to use a special-purpose comparator when
needed instead of giving the 'standard' operator==() wrong semantics?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Andre Poenitz
On Wed, May 28, 2003 at 12:53:39AM +0200, Lars Gullik Bjønnes wrote:
 This patch introduces ParagraphList::const_iterator, and adjust stuff
 to fit.  All problems larger than  has been solved by a
 const_cast.


@@ -243,12 +243,12 @@ int getEndLabel(ParagraphList::iterator
 {
ParagraphList::iterator pit = p;
Paragraph::depth_type par_depth = p-getDepth();
-   while (pit != plist.end()) {
+   while (pit != const_castParagraphList(plist).end()) {
LyXLayout_ptr const  layout = pit-layout();
int const endlabeltype = layout-endlabeltype;

if (endlabeltype != END_LABEL_NO_LABEL) {
-   if (boost::next(p) == plist.end())
+   if (boost::next(p) ==
const_castParagraphList(plist).end())

Wouldn't it be better in such cases to change the functions' signature to 

  int getEndLabel(ParagraphList::const_iterator...

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: Protected Blank

2003-05-30 Thread Lars Gullik Bjønnes
Garst R. Reese [EMAIL PROTECTED] writes:

| Why not just Normal Space ?
| The word Force is redundant. You could even leave out Normal.

But it is not a normal space... as in pressing SPACE. It is an
excplicit inter-word space.

So, Inter-word Space is my suggestion.

-- 
Lgb


Re: [PATCH] remove spurious Buffer usage in InsetRef::clone()

2003-05-30 Thread Andre Poenitz
On Fri, May 30, 2003 at 01:51:02AM +0100, John Levon wrote:
 Please review. This is a necessary starting point to the optional
 brekage

Looks good.

I'd move the clone() 'out-of-line', though and I don't really see a reason
to start removing the empty /// comments. Better to fill in a few words
there?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: InsetInclude::clone()

2003-05-30 Thread Andre Poenitz
On Fri, May 30, 2003 at 02:31:57AM +0100, John Levon wrote:
 
 Lars, this one is tricky for cross-buffer copy.
 
 You need to add some code to iterate across all inset includes
 in the buffer and replace masterFilename I think. Does this sound
 sensible ?
 
 Should InsetInclude store a Buffer * ?
 
 Is Inset::clone() used anywhere else  than undo and copy/paste ?

Paragraph copy c'tor and =?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: test

2003-05-30 Thread Lars Gullik Bjønnes
Andre Poenitz [EMAIL PROTECTED] writes:

| Anybody out there?

We are alll here...

-- 
Lgb


Re: [patch] IU: draw()

2003-05-30 Thread Lars Gullik Bjønnes
Andre Poenitz [EMAIL PROTECTED] writes:

| This is InsetUnificiation for draw()  

I'd like this patch to go in, _BUT_ I'd like more to stabilize and
remove the breakage we have a bit first.

John has been helping me with this, so the greatest help I (we) can
get now is to test and help finalize the patch John just sent.

I know that you patch, Andre, does not really touch the same part of
the code, but having to many huge changes at the same time when there
is breakage cannot be good.

So please hold on to this patch for a short period while we try to fix
things a bit.

-- 
Lgb


Re: [patch] IU: draw()

2003-05-30 Thread Andre Poenitz
On Fri, May 30, 2003 at 08:47:26AM +0200, Lars Gullik Bjønnes wrote:
 Andre Poenitz [EMAIL PROTECTED] writes:
 
 | This is InsetUnificiation for draw()  
 
 I'd like this patch to go in, _BUT_ I'd like more to stabilize and
 remove the breakage we have a bit first.

Sorry, too late.

I really checked all mail before I commited, you just missed it by a few
seconds.

 John has been helping me with this, so the greatest help I (we) can
 get now is to test and help finalize the patch John just sent.
 
 I know that you patch, Andre, does not really touch the same part of
 the code, but having to many huge changes at the same time when there
 is breakage cannot be good.
 
 So please hold on to this patch for a short period while we try to fix
 things a bit.

Sorry.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Re: Mailinglist is on again

2003-05-30 Thread Jose' Matos
On Thursday 29 May 2003 21:18, [EMAIL PROTECTED] wrote:
 As you probably noticed, the lists are up again.  Thx for your patience.

  You are the one who deserves thanks. :-)

 The Summer should be uneventful...

  Sorry but here I can not resist: Famous last words. ;-)

 Mate

-- 
José Abílio



[patch] IU: first phase

2003-05-30 Thread Andre Poenitz

With this, we have IU for drawing related stuff
(i.e. both phases)

To really benefit from the two-stage drawing,
the row painter would need some work.

[After that I'd guess we could even have a shot
at removal of all 'update' stuff (at least
to get a feeling on what would break and
what that update is technically good for
anyway)...]

There is quite a bit of small cleanup left.
Inset-ascent() etc should use the results
of some previous first phase instead of starting
one of their own, and most of the draw() 
routines would get much simpler if we used
the (asc, des, wid) tuples instead of 
(x, y + asc, wid, asc + des). But that's
just cosmetics.

[I'll have a look at the recent crashs, too...]

Andre'


phaseone.diff.gz
Description: application/gunzip


Re: [patch] IU: first phase

2003-05-30 Thread Andre Poenitz
On Fri, May 30, 2003 at 11:07:31AM +0200, Andre' Poenitz wrote:
 To really benefit from the two-stage drawing,

... on top of cleaner code ... 

This removes some _really_ ugly glue between
mathed and the outside work (most notably
the different metrics() hacks and the cached
font_ member) 

 the row painter would need some work.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


[patch 13x] enable LyX to link against xforms 1.0.2

2003-05-30 Thread Angus Leeming
Jean-Marc, this is a backport of the patch already in 1.4.x. Ago to apply?
Angus
Index: config/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/ChangeLog,v
retrieving revision 1.86.2.14
diff -u -p -r1.86.2.14 ChangeLog
--- config/ChangeLog	6 May 2003 14:43:11 -	1.86.2.14
+++ config/ChangeLog	30 May 2003 10:37:41 -
@@ -1,3 +1,10 @@
+2003-05-30  Angus Leeming  [EMAIL PROTECTED]
+
+	* xforms.m4 (LYX_CHECK_XFORMS_IMAGE_LOADER): clean-up instigated by
+	Rob Lahaye to ensure that the configure test succeeds with
+	xforms 1.0.2 and, moreover, that this will not break the final
+	linking step under cygwin.
+
 2003-05-06  Jean-Marc Lasgouttes  [EMAIL PROTECTED]
 
 	* configure.in (VERSION): 
Index: config/xforms.m4
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/xforms.m4,v
retrieving revision 1.15
diff -u -p -r1.15 xforms.m4
--- config/xforms.m4	12 Jan 2003 22:24:46 -	1.15
+++ config/xforms.m4	30 May 2003 10:37:41 -
@@ -68,17 +68,21 @@ AC_LANG_C
 
 dnl The image headers were split out of forms.h in xforms version 1.0.
 AC_CHECK_HEADERS(flimage.h X11/flimage.h, break,,[#include $lyx_cv_forms_h_location])
-AC_SEARCH_LIBS(flimage_dup, flimage,
-  [if test $ac_cv_search_flimage_dup != none required ; then
- XFORMS_IMAGE_LIB=-lflimage
- LIBS=$XFORMS_IMAGE_LIB $LIBS
-  fi])
 
 dnl Only enable native loading of jpeg images if the jpeg library is installed.
+dnl This test comes before that of flimage itself to ensure that the necessary
+dnl libraries are linked into the flimage_dup test program below.
+XFORMS_IMAGE_LIB=
 AC_CHECK_LIB(jpeg, jpeg_read_header,
   [lyx_use_jpeg_image_loader=yes
-   XFORMS_IMAGE_LIB=$XFORMS_IMAGE_LIB -ljpeg
-   LIBS=$LIBS -ljpeg])
+   XFORMS_IMAGE_LIB=-ljpeg
+   LIBS=-ljpeg $LIBS])
+
+AC_SEARCH_LIBS(flimage_dup, flimage,
+  [if test $ac_cv_search_flimage_dup != none required ; then
+ XFORMS_IMAGE_LIB=-lflimage $XFORMS_IMAGE_LIB
+  fi])
+
 AC_SUBST(XFORMS_IMAGE_LIB)
 
 if test $lyx_use_jpeg_image_loader = yes ; then


Re: Protected Blank

2003-05-30 Thread John Levon
On Fri, May 30, 2003 at 08:39:19AM +0200, Lars Gullik Bj?nnes wrote:

 So, Inter-word Space is my suggestion.

That sounds good ... or Hard Space ?

john


Re: [patch] IU: draw()

2003-05-30 Thread John Levon
On Fri, May 30, 2003 at 08:54:20AM +0200, Andre Poenitz wrote:

 I really checked all mail before I commited, you just missed it by a few
 seconds.

Never mind, it seemed OK anyway. Though I agree with Lars we should
lockdown for a bit and concentrate on undo and the broken inset
iterators

regards
john


Re: naming

2003-05-30 Thread John Levon
On Tue, May 27, 2003 at 04:45:56PM +0200, Andre Poenitz wrote:

 Can people please make the mind up how the first phase (the metrics
 computation) in a two-phase drawing should be named?
 
 If no consensus appears I'd stick to 'metrics' as it is used in more
 cases than 'dimension'. 

I'd much prefer metrics. (Didn't /you/ name it dimension ? :)

john


Re: Protected Blank

2003-05-30 Thread Lars Gullik Bjønnes
John Levon [EMAIL PROTECTED] writes:

| On Fri, May 30, 2003 at 08:39:19AM +0200, Lars Gullik Bj?nnes wrote:
| 
|  So, Inter-word Space is my suggestion.
| 
| That sounds good ... or Hard Space ?

No... hard space would imo be more like protected space or visible
space.

-- 
Lgb


Re: naming

2003-05-30 Thread Andre Poenitz
On Fri, May 30, 2003 at 01:27:30PM +0100, John Levon wrote:
 On Tue, May 27, 2003 at 04:45:56PM +0200, Andre Poenitz wrote:
 
  Can people please make the mind up how the first phase (the metrics
  computation) in a two-phase drawing should be named?
  
  If no consensus appears I'd stick to 'metrics' as it is used in more
  cases than 'dimension'. 
 
 I'd much prefer metrics. (Didn't /you/ name it dimension ? :)

That was just a wicked plan to make you accept 'metrics' in the end ;-)

[Seriously, naming them 'metrics' in insets/*.C from the beginning would
have caused some nasty clashes in the mathed/outside world interface.
Which is mostly gone nowadays...]

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


Mailinglist is on again

2003-05-30 Thread lyx
As you probably noticed, the lists are up again.  Thx for your patience.
The Summer should be uneventful...

Mate


Re: LyX and vTeX

2003-05-30 Thread Charpentier Philippe
On Tue, 27 May 2003 11:46:20 +0200
Andre Poenitz <[EMAIL PROTECTED]> wrote:

> On Tue, May 27, 2003 at 11:43:22AM +0200, Charpentier Philippe wrote:
> > sometimes I find usefull to use vlatex instead of pdflatex to
> > produce a PDF file. Is it possible (in any version of LyX and
> > for the user i.e. without modifying the source) to add an NEW entry
> > in the "view" menu (i.e. in ViewFormats) like "PDF (vlatex)" for a
> > complete compilation with vlatex, in such a way that both
> > "PDF (pdflatex)" and "PDF (vlatex)" appear in the view menu?
> 
> Yes.
> 
> You need to define a new format (say "PDFvlatex") and a converter
> LaTeX -> PDFvlatex in the Preferences->Converters menus.
> 
> Andre'
> 

I did that for lyx-1.2.3 and lyx-1.3.2. Precisely I wrote

\format "pdf4" "pdf" "PDF (vlatex)" "" (in the FORMATS SECTION)

and

\converter "latex" "pdf4" "/usr/local/vtex/bin/vlatex $$i" "latex" (in the CONVERTERS 
SECTION)

With lyx-1.2.3 all is fine. But with lyx-1.3.2, if there is a latex error in the
document, lyx crashes with the following output:

lyx: /usr/include/g++-3/std/bastring.cc:126: basic_string 
_string::replace (unsigned int, unsigned int, const 
basic_string &, unsigned int, unsigned int) [with charT = 
char, traits = string_char_traits, Allocator = __default_alloc_template]:  l'assertion `!(pos2 > len2)' a échoué.
/home/pcharpen/bin/monlyxqt: line 6:  8816 Abandon

Why?
Ph. C.

More precisely:

the test was made on a RedHat-7.2. Running lyx-1.3.2 with "-dbg latex" gives (with a 
\usepackage{al} in the preamble):

Log line: ! LaTeX Error: File `al.sty' not found.
lyx: /usr/include/g++-3/std/bastring.cc:126: basic_string 
_string::replace (unsigned int, unsigned int, const 
basic_string &, unsigned int, unsigned int) [with charT = 
char, traits = string_char_traits, Allocator = __default_alloc_template]:  l'assertion `!(pos2 > len2)' a échoué.
Abandon

The same test on a RedHat-8.0 gives, for BOTH lyx-1.2.3 and lyx-1.3.2, a crash of lyx 
with:

Log line: ! LaTeX Error: File `al.sty' not found.
Abandon

Is this a bug in LyX?

Ph. C.


Re: [PATCH] Re: bug: text->footnote

2003-05-30 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote:
> Just that the user does not expect that the clipboard is modified.
> There should not be any clipboard modification without an explicit
> cut/copy.

Well then how about this? (As I said, the current implementation is more 
confusing than helpful).

> The solution would be to modify CutAndPaste to allow an alternative
> temporary clipboard, but this is probably a lot of work.

Certainly no work for me.

Regards,
Jürgen.

P.S.: For the sake of power users, I vote for the possibility to add a "Don't 
ask again" checkbox to the Alert dialogs.
Index: src/text3.C
===
RCS file: /cvs/lyx/lyx-devel/src/text3.C,v
retrieving revision 1.76
diff -u -r1.76 text3.C
--- src/text3.C	2003/05/27 17:29:01	1.76
+++ src/text3.C	2003/05/28 06:58:34
@@ -27,6 +27,7 @@
 #include "box.h"
 #include "language.h"
 #include "support/tostr.h"
+#include "frontends/Alert.h"
 #include "frontends/LyXView.h"
 #include "frontends/screen.h"
 #include "frontends/Dialogs.h"
@@ -365,6 +366,8 @@
 {
 	lt->update();
 	InsetSpecialChar * new_inset = new InsetSpecialChar(kind);
+	if (lt->selection.set())
+		lt->cutSelection(true, false);
 	if (!bv->insertInset(new_inset))
 		delete new_inset;
 	else
@@ -379,18 +382,28 @@
 	BufferView * bv = cmd.view();
 
 	if (inset) {
-		bool gotsel = false;
-		if (lt->selection.set()) {
-			lt->cutSelection(true, false);
-			gotsel = true;
+		bool use_clipboard = false;
+		if (lt->selection.set() && pastesel) {
+			string const inset_name = inset->getInsetName();
+			string text = bformat(_("Do you want to insert the selected text into\n"
+"the %1$s inset (using the clipboard)?"), inset_name);
+			int const ret = Alert::prompt(_("Paste selection to inset?"),
+text, 1, 1, _(""), _("'t insert"));
+			if (ret == 0) {
+use_clipboard = true;
+bv->owner()->dispatch(FuncRequest(LFUN_CUT));
+			} else
+bv->owner()->dispatch(FuncRequest(LFUN_DELETE));
+		} else if (lt->selection.set() && !pastesel) {
+bv->owner()->dispatch(FuncRequest(LFUN_DELETE));
 		}
 		if (bv->insertInset(inset)) {
 			if (edit) {
 FuncRequest cmd(bv, LFUN_INSET_EDIT, "left");
 inset->localDispatch(cmd);
 			}
-			if (gotsel && pastesel)
-bv->owner()->dispatch(FuncRequest(LFUN_PASTESELECTION));
+			if (use_clipboard)
+	bv->owner()->dispatch(FuncRequest(LFUN_PASTE));
 		}
 		else
 			delete inset;
@@ -736,7 +749,7 @@
 			// just comment out the line below...
 		} else {
 			update();
-			cutSelection(bv, true);
+			cutSelection(true, false);
 			update();
 		}
 		moveCursorUpdate(bv, false);


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes:

| On Wed, May 28, 2003 at 09:05:23AM +0200, Lars Gullik Bjønnes wrote:
| > | I think std::list<>::const_iterator  has a corresponding constructor.
| > 
| > Show me.
| 
| I don't find it in the Standard right now.

Right... :-)
 
| But:
| 
|   template
| struct _List_iterator : public _List_iterator_base
| {
|   typedef _List_iterator<_Tp,_Tp&,_Tp*> iterator;
|   typedef _List_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
|   typedef _List_iterator<_Tp,_Ref,_Ptr> _Self;
| 
|   typedef _Tp value_type;
|   typedef _Ptr pointer;
|   typedef _Ref reference;
|   typedef _List_node<_Tp> _Node;
| 
|   _List_iterator(_Node* __x)
|   : _List_iterator_base(__x)
|   { }
| 
|   _List_iterator()
|   { }
| 
|   _List_iterator(const iterator& __x) // <--
|   : _List_iterator_base(__x._M_node)
|   { }
| 
| and
| 
|   #include 
| 
|   int main()
|   {
|   std::list l;
|   std::list::const_iterator it = l.end();
|   }
| 
| compiles with g++ and Comeau.

Note also that we have just as much need for going const_iterator ->
iterator.

| > No... That is like converting string to a int with a reinterpret_cast
| > and expecting tings to work... different types.
| 
| It certainly is undefined behaviour. But every std::list<>::iterator I know
| of is binary compatible with its corresponding std::list<>::const_iterator
| (in contrast to your string/int example) even if that's not required at
| all. So it "works" in practice.

Is "'works' in practice" good enough?

-- 
Lgb


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes:

| On Wed, May 28, 2003 at 09:44:29AM +0200, Lars Gullik Bjønnes wrote:
| > | It certainly is undefined behaviour. But every std::list<>::iterator I know
| > | of is binary compatible with its corresponding std::list<>::const_iterator
| > | (in contrast to your string/int example) even if that's not required at
| > | all. So it "works" in practice.
| > 
| > Is "'works' in practice" good enough?
| 
| We are talking about the transition phase to std::list, don't we?

So so sure...
 
| If so, it is certainly 'good enough' as it would be better then most of the
| other stuff like undo etc. ;-}
| 
| I was just trying to give a hint how that 'cumbersome' conversion can be
| done in one line.

but it is not iterator -> const_iterator that is cumbersom (as you
have shown), but const_iterator -> iterator.
 
-- 
Lgb


Re: [Devel] [meta-PATCH] bibtex inset crashes on reading in (Angus !)

2003-05-30 Thread Lars Gullik Bjønnes
John Levon <[EMAIL PROTECTED]> writes:

|  o make readInset() handle only "bibtex", and do s/BibTeX/bibtex/ in
|lyx2lyx

This one I think, but I have no strong feeling about this.

-- 
Lgb


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes:

| > to fit.  All problems larger than --><-- has been solved by a
| > const_cast.

This ^^
 
| Wouldn't it be better in such cases to change the functions' signature to 
| 
|   int getEndLabel(ParagraphList::const_iterator...

Perhaps. But I am not willing to open that issue now... It is some
easy to come in the situation that you need to convert
ParagraphList::iterator to ParagraphList::const_iterator and that is
reall cumbersome.

-- 
Lgb


Re: [Devel] [patch] Drop ParagraphList::find

2003-05-30 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes:

| On Tue, May 27, 2003 at 11:27:55PM +0200, Lars Gullik Bjønnes wrote:
| +bool operator==(Paragraph const & lhs, Paragraph const & rhs)
| +{
| +#warning FIXME this implementatoin must be completely wrong...
| +   return  == 
| +}
| 
| As the warning says.
| 
| Wouldn't it be more prudent to use a special-purpose comparator when
| needed instead of giving the 'standard' operator==() wrong semantics?

Possibly.

-- 
Lgb


Re: [Devel] [patch] ParagraphList::const_iterator

2003-05-30 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes:

| > Perhaps. But I am not willing to open that issue now... It is some
| > easy to come in the situation that you need to convert
| > ParagraphList::iterator to ParagraphList::const_iterator and that is
| > reall cumbersome.
| 
| I think std::list<>::const_iterator  has a corresponding constructor.

Show me.
 
| Cumbersome... a reinterpret_cast<> in that constructor would work ;-)

No... That is like converting string to a int with a reinterpret_cast
and expecting tings to work... different types.

-- 
Lgb


[patch] Switch to std::list

2003-05-30 Thread Lars Gullik Bjønnes

Mostly just a simple switch-over, but some small other things as well.

Have a look.

? src/less
? src/frontends/xforms/lyx_forms.h
? src/frontends/xforms/lyx_xpm.h
Index: src/CutAndPaste.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/CutAndPaste.h,v
retrieving revision 1.25
diff -u -p -r1.25 CutAndPaste.h
--- src/CutAndPaste.h	20 May 2003 16:51:29 -	1.25
+++ src/CutAndPaste.h	27 May 2003 23:03:28 -
@@ -59,7 +59,7 @@ int nrOfParagraphs();
 */
 int SwitchLayoutsBetweenClasses(lyx::textclass_type c1,
 lyx::textclass_type c2,
-ParagraphList & par, 
+ParagraphList & par,
 ErrorList &);
 ///
 bool checkPastePossible();
Index: src/ParagraphList.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ParagraphList.h,v
retrieving revision 1.18
diff -u -p -r1.18 ParagraphList.h
--- src/ParagraphList.h	27 May 2003 22:41:02 -	1.18
+++ src/ParagraphList.h	27 May 2003 23:03:29 -
@@ -3,7 +3,7 @@
 #ifndef PARAGRAPH_LIST_H
 #define PARAGRAPH_LIST_H
 
-#define NO_STD_LIST 1
+//#define NO_STD_LIST 1
 
 #ifndef NO_STD_LIST
 
@@ -11,7 +11,11 @@
 
 #include 
 
-typedef std::list ParagraphList;
+struct ParagraphList : public std::list
+{
+};
+
+typedef std::pair PitPosPair;
 
 #else
 
Index: src/paragraph.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.h,v
retrieving revision 1.83
diff -u -p -r1.83 paragraph.h
--- src/paragraph.h	27 May 2003 22:41:03 -	1.83
+++ src/paragraph.h	27 May 2003 23:03:30 -
@@ -18,11 +18,11 @@
 #include "support/types.h"
 #include "changes.h"
 
-#include "ParagraphList.h"
 #include "LString.h"
 
 #include 
 
+class Buffer;
 class BufferParams;
 class BufferView;
 class Counters;
@@ -32,11 +32,12 @@ class LaTeXFeatures;
 class LatexRunParams;
 class ParagraphParameters;
 class TexRow;
+class ParagraphList;
 
 // Define this if you want to try out the new storage container for
 // paragraphs. (Lgb)
 // This is non working and far from finished.
-#define NO_STD_LIST 1
+//#define NO_STD_LIST 1
 
 /// A Paragraph holds all text, attributes and insets in a text paragraph
 class Paragraph  {
@@ -337,6 +338,7 @@ inline bool isDeletedText(Paragraph cons
 {
 	return par.lookupChange(pos) == Change::DELETED;
 }
+
 
 bool operator==(Paragraph const & lhs, Paragraph const & rhs);
 
Index: src/paragraph_funcs.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph_funcs.C,v
retrieving revision 1.42
diff -u -p -r1.42 paragraph_funcs.C
--- src/paragraph_funcs.C	27 May 2003 22:41:03 -	1.42
+++ src/paragraph_funcs.C	27 May 2003 23:03:30 -
@@ -379,7 +379,7 @@ TeXEnvironment(Buffer const * buf,
 	do {
 		par = TeXOnePar(buf, paragraphs, par, os, texrow, runparams);
 
-		if (par != const_cast(paragraphs).end()&& par->params().depth() > pit->params().depth()) {
+		if (par != const_cast(paragraphs).end() && par->params().depth() > pit->params().depth()) {
 			if (par->layout()->isParagraph()) {
 
 			// Thinko!
@@ -610,13 +610,17 @@ TeXOnePar(Buffer const * buf,
 			texrow.newline();
 		}
 		break;
-	case LATEX_ENVIRONMENT:
+	case LATEX_ENVIRONMENT: {
 		// if its the last paragraph of the current environment
 		// skip it otherwise fall through
-		if (boost::next(pit) != const_cast(paragraphs).end()
-		&& (boost::next(pit)->layout() != pit->layout()
-			|| boost::next(pit)->params().depth() != pit->params().depth()))
+		ParagraphList::iterator next = boost::next(pit);
+
+		if (next != const_cast(paragraphs).end()
+		&& (next->layout() != pit->layout()
+			|| next->params().depth() != pit->params().depth()))
 			break;
+	}
+
 		// fall through possible
 	default:
 		// we don't need it for the last paragraph!!!
Index: src/insets/inset.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.C,v
retrieving revision 1.94
diff -u -p -r1.94 inset.C
--- src/insets/inset.C	26 May 2003 09:13:53 -	1.94
+++ src/insets/inset.C	27 May 2003 23:03:33 -
@@ -26,8 +26,6 @@
 
 #include "support/lstrings.h"
 
-using std::endl;
-
 
 // Initialization of the counter for the inset id's,
 unsigned int Inset::inset_id = 0;
Index: src/insets/inset.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.h,v
retrieving revision 1.92
diff -u -p -r1.92 inset.h
--- src/insets/inset.h	26 May 2003 09:13:53 -	1.92
+++ src/insets/inset.h	27 May 2003 23:03:33 -
@@ -30,10 +30,10 @@ class LatexRunParams;
 class LyXText;
 class LyXLex;
 class Paragraph;
-class ParagraphList;
 class LyXCursor;
 class FuncRequest;
 class WordLangTuple;
+class ParagraphList;
 
 struct 

[patch] Drop ParagraphList::find

2003-05-30 Thread Lars Gullik Bjønnes

I just realized that there is no such thing as "find" in std::list.

So this patch removes that and replaces it with std::find.

? src/frontends/xforms/lyx_forms.h
? src/frontends/xforms/lyx_xpm.h
Index: src/ParagraphList.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ParagraphList.C,v
retrieving revision 1.24
diff -u -p -r1.24 ParagraphList.C
--- src/ParagraphList.C	27 May 2003 17:28:59 -	1.24
+++ src/ParagraphList.C	27 May 2003 20:54:43 -
@@ -315,17 +315,4 @@ bool ParagraphList::empty() const
 	return parlist == 0;
 }
 
-
-ParagraphList::iterator ParagraphList::find(Paragraph const & p)
-{
-	iterator it = begin();
-	iterator last = end();
-	for (;it != last; ++it) {
-		if (&*it == )
-			break;
-	}
-	return it;
-}
-
-
 #endif
Index: src/ParagraphList.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ParagraphList.h,v
retrieving revision 1.16
diff -u -p -r1.16 ParagraphList.h
--- src/ParagraphList.h	27 May 2003 17:28:59 -	1.16
+++ src/ParagraphList.h	27 May 2003 20:54:43 -
@@ -99,8 +99,6 @@ public:
 	int size() const;
 	///
 	bool empty() const;
-	///
-	iterator find(Paragraph const &);
 private:
 	///
 	Paragraph * parlist;
Index: src/paragraph.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.275
diff -u -p -r1.275 paragraph.C
--- src/paragraph.C	26 May 2003 09:13:51 -	1.275
+++ src/paragraph.C	27 May 2003 20:54:43 -
@@ -1396,3 +1396,10 @@ bool Paragraph::isFreeSpacing() const
 		return (pimpl_->inset_owner->owner()->lyxCode() == Inset::ERT_CODE);
 	return false;
 }
+
+
+bool operator==(Paragraph const & lhs, Paragraph const & rhs)
+{
+#warning FIXME this implementatoin must be completely wrong...
+	return  == 
+}
Index: src/paragraph.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.h,v
retrieving revision 1.81
diff -u -p -r1.81 paragraph.h
--- src/paragraph.h	25 May 2003 08:49:48 -	1.81
+++ src/paragraph.h	27 May 2003 20:54:43 -
@@ -337,4 +337,6 @@ inline bool isDeletedText(Paragraph cons
 	return par.lookupChange(pos) == Change::DELETED;
 }
 
+bool operator==(Paragraph const & lhs, Paragraph const & rhs);
+
 #endif // PARAGRAPH_H
Index: src/text.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.363
diff -u -p -r1.363 text.C
--- src/text.C	27 May 2003 17:28:59 -	1.363
+++ src/text.C	27 May 2003 20:54:44 -
@@ -147,7 +147,9 @@ int LyXText::workWidth() const
 
 int LyXText::workWidth(Inset const * inset) const
 {
-	ParagraphList::iterator par = ownerParagraphs().find(*inset->parOwner());
+	ParagraphList::iterator par = std::find(ownerParagraphs().begin(),
+		ownerParagraphs().end(),
+		*inset->parOwner());
 	//lyx::Assert(par);
 
 	pos_type pos = par->getPositionOfInset(inset);
Index: src/text2.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.363
diff -u -p -r1.363 text2.C
--- src/text2.C	27 May 2003 17:29:00 -	1.363
+++ src/text2.C	27 May 2003 20:54:45 -
@@ -1197,7 +1197,7 @@ void LyXText::setCounter(Buffer const * 
 	isOK = true;
 	break;
 } else {
-	tmppit = ownerParagraphs().find(*in->parOwner());
+	tmppit = std::find(ownerParagraphs().begin(), ownerParagraphs().end(), *in->parOwner());
 }
 			}
 

-- 
Lgb


Re: [Devel] Re: [PATCH] Re: bug: text->footnote

2003-05-30 Thread Juergen Spitzmueller
John Levon wrote:
> Rejected. We don't fix our bugs by trying to fix our users. Or rather,
> we shouldn't.

OK. Then I'm out (no more ideas). But I vote for removing the current 
conversion. If we don't do it right, we should not do it at all.

Jürgen.


Re: More thoughts about external inset

2003-05-30 Thread Helge Hafting
On Mon, May 26, 2003 at 11:15:04AM -0400, Zvezdan Petkovic wrote:
> On Thu, May 22, 2003 at 10:47:29AM +0200, Helge Hafting wrote:
> > Truetype fonts in pdf seems to work only with pdflatex, not
> > dvi->ps->pdf. And the pdflatex way is noticeable faster too.
> 
> People obviously do not bother to learn real LaTeX any more.
I don't claim to be an expert on latex.  Thats why I
say it _seems_ to not work.  The only dvi->ps->pdf
conversion I tried is the one that lyx does, running
this manually isn't something I want to do everytime.
> Try
>   dvips -Ppdf -o file.ps file.dvi
> and you'll get Type1 TeX fonts (it's Type1, not TrueType, for printing).
> 
I have no problem using type1 fonts in latex.  The problem was
to use _TrueType_ fonts because that was what the publisher
sent me, and produce a pdf file, because that is what they want.
And the font must be embedded, bitmaps aren't resolution independent.
The problem was solved by asking for a type1 version of the font,
which they happened to have.

> I agree that pdflatex is the more direct way to pdf.  I just want to
> point out that the first statement is not true.
> 
Fine if you can point out a way to get truetype fonts in latex
into a pdf without pdflatex, but type1 won't do that.

Helge Hafting


Re: [Devel] Re: [PATCH] Re: bug: text->footnote

2003-05-30 Thread Juergen Spitzmueller
John Levon wrote:
> We wouldn't end up doing anything, we do barely anything fully
> correctly.
>
> Why can't we just use your patch, and file a bug on the broken clipboard
> behaviour ? It's a reasonable tradeoff of bugs IMHO.

Note that even if this might sound so, I am not frustrated at all. It's just 
that I proposed several implementations and there have been valid objections 
to any of these (though I have another point of view). I thought about 
another solution, but I cannot think of any that solves all problems (except 
the clipboard enhancements JMarc proposed, but they are off my skills). 

> (Do you want to send me your patch for 1.4 again ?)

Yes, shure.

Regards,
Jürgen
Index: src/text3.C
===
RCS file: /cvs/lyx/lyx-devel/src/text3.C,v
retrieving revision 1.73
diff -u -r1.73 text3.C
--- src/text3.C	2003/05/19 07:12:08	1.73
+++ src/text3.C	2003/05/21 12:05:57
@@ -371,7 +371,6 @@
 		bv->updateInset(new_inset);
 }
 
-
 void doInsertInset(LyXText * lt, FuncRequest const & cmd,
 		   bool edit, bool pastesel)
 {
@@ -381,7 +380,7 @@
 	if (inset) {
 		bool gotsel = false;
 		if (lt->selection.set()) {
-			lt->cutSelection(true, false);
+			bv->owner()->dispatch(FuncRequest(LFUN_CUT));
 			gotsel = true;
 		}
 		if (bv->insertInset(inset)) {
@@ -390,7 +389,7 @@
 inset->localDispatch(cmd);
 			}
 			if (gotsel && pastesel)
-bv->owner()->dispatch(FuncRequest(LFUN_PASTESELECTION));
+bv->owner()->dispatch(FuncRequest(LFUN_PASTE));
 		}
 		else
 			delete inset;


Re: 1.3.2 for Windoze

2003-05-30 Thread Ruurd Reitsma
> Just to mention another option:
>
> I've used 'InnoSetup' at the time I had to create a Windows version of my
> programms. That creates nice installers which can create icons on the
> desktop etc and had the benefit that InnoSetup itself as well as the
> created installers ran fine under Wine.
>

To get back at my original question: Can I put it on the lyx ftp site when
I'm done?

Ruurd





[crashing patch] Real copy constructors

2003-05-30 Thread Lars Gullik Bjønnes

We really need to make Inset::clone take no arguments, this cleans up
stuff and makes other things easier to understand... unfortunately it
is not so easy...

This patch does it, the brute force way, and as a result you get a lot
of nice crashes. Please have a look if you want to exercise your
problem solving abilities.

Compiles, links and runs "kindo"...

? src/less
? src/frontends/xforms/lyx_forms.h
? src/frontends/xforms/lyx_xpm.h
Index: src/paragraph.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.279
diff -u -p -r1.279 paragraph.C
--- src/paragraph.C 29 May 2003 11:19:50 -  1.279
+++ src/paragraph.C 29 May 2003 16:23:07 -
@@ -91,7 +91,7 @@ Paragraph::Paragraph(Paragraph const & l
InsetList::iterator it = insetlist.begin();
InsetList::iterator end = insetlist.end();
for (; it != end; ++it) {
-   it->inset = it->inset->clone(**buffer_);
+   it->inset = it->inset->clone();
// tell the new inset who is the boss now
it->inset->parOwner(this);
}
@@ -224,14 +224,14 @@ void Paragraph::validate(LaTeXFeatures &
 // First few functions needed for cut and paste and paragraph breaking.
 void Paragraph::copyIntoMinibuffer(Buffer const & buffer, pos_type pos) const
 {
-   BufferParams bparams = buffer.params;
+   BufferParams const & bparams = buffer.params;
 
minibuffer_char = getChar(pos);
minibuffer_font = getFontSettings(bparams, pos);
minibuffer_inset = 0;
if (minibuffer_char == Paragraph::META_INSET) {
if (getInset(pos)) {
-   minibuffer_inset = getInset(pos)->clone(buffer);
+   minibuffer_inset = getInset(pos)->clone();
} else {
minibuffer_inset = 0;
minibuffer_char = ' ';
Index: src/insets/inset.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.h,v
retrieving revision 1.94
diff -u -p -r1.94 inset.h
--- src/insets/inset.h  28 May 2003 23:09:14 -  1.94
+++ src/insets/inset.h  29 May 2003 16:23:08 -
@@ -209,7 +209,7 @@ public:
}
 
///
-   virtual Inset * clone(Buffer const &) const = 0;
+   virtual Inset * clone() const = 0;
 
/// returns true to override begin and end inset in file
virtual bool directWrite() const;
Index: src/insets/insetbibitem.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibitem.C,v
retrieving revision 1.14
diff -u -p -r1.14 insetbibitem.C
--- src/insets/insetbibitem.C   28 May 2003 06:47:15 -  1.14
+++ src/insets/insetbibitem.C   29 May 2003 16:23:08 -
@@ -43,20 +43,10 @@ InsetBibitem::~InsetBibitem()
 }
 
 
-Inset * InsetBibitem::clone(Buffer const &) const
+Inset * InsetBibitem::clone() const
 {
-   InsetBibitem * b = new InsetBibitem(params());
-   b->setCounter(counter);
-   return b;
+   return new InsetBibitem(*this);
 }
-
-
-// Inset * InsetBibitem::clone(Buffer const &, bool) const
-// {
-// InsetBibitem * b = new InsetBibitem(params());
-// b->setCounter(counter);
-// return b;
-// }
 
 
 dispatch_result InsetBibitem::localDispatch(FuncRequest const & cmd)
Index: src/insets/insetbibitem.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibitem.h,v
retrieving revision 1.7
diff -u -p -r1.7 insetbibitem.h
--- src/insets/insetbibitem.h   28 May 2003 23:09:14 -  1.7
+++ src/insets/insetbibitem.h   29 May 2003 16:23:08 -
@@ -29,7 +29,7 @@ public:
///
~InsetBibitem();
///
-   Inset * clone(Buffer const &) const;
+   Inset * clone() const;
///
virtual dispatch_result localDispatch(FuncRequest const & cmd);
/** Currently \bibitem is used as a LyX2.x command,
Index: src/insets/insetbibtex.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibtex.h,v
retrieving revision 1.9
diff -u -p -r1.9 insetbibtex.h
--- src/insets/insetbibtex.h28 May 2003 23:09:14 -  1.9
+++ src/insets/insetbibtex.h29 May 2003 16:23:08 -
@@ -27,7 +27,7 @@ public:
///
~InsetBibtex();
///
-   Inset * clone(Buffer const &) const {
+   Inset * clone() const {
return new InsetBibtex(params());
}
/// small wrapper for the time being
Index: src/insets/insetcite.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcite.h,v
retrieving revision 1.33
diff -u -p -r1.33 insetcite.h
--- src/insets/insetcite.h  28 May 2003 23:09:14 

Re: [patch] More wild parlist work.

2003-05-30 Thread Asger Kunuk Alstrup Nielsen
On Tue, 27 May 2003, Andre Poenitz wrote:

> But we would need to be careful nevertheless as in some cases we would
> still have to invalidate iterators (i.e. when the underlying paragraph is
> removed).
>
> So in e.g. undo we'd better not remove the changed par from the list and
> re-insert a copy of an old one as this invalidates all iterators pointing
> to that paragraph and we might be interested in keeping a few of them
> alive...

I see what you mean. When a paragraph is removed, and thus moved to
undo stack, the iterators for error insets, cursors, and bookmarks
in those affected paragraphs surely should invalidate in the document.

But when you then "undo", you want to restore the iterators. For this to
work, you need to move all the "old" iterators into your undo-structure,
and when you undo, restore all of these as well. (Alternatively, you can
choose to accept that iterators might break across the undo barrier,
although that's not too great.) In other words, it's logical to let all
iterators be part of the data structure itself as well.

Regards,
Asger


[PATCH] fix several "button click does nothing"

2003-05-30 Thread John Levon

Seems relatively straight forward. Comments ?

regards
john


Index: insets/insetcite.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcite.C,v
retrieving revision 1.53
diff -u -p -r1.53 insetcite.C
--- insets/insetcite.C  26 May 2003 09:13:53 -  1.53
+++ insets/insetcite.C  28 May 2003 03:53:14 -
@@ -334,7 +334,7 @@ dispatch_result InsetCitation::localDisp
break;
 
default:
-   return UNDISPATCHED;
+   return InsetCommand::localDispatch(cmd);
}
return DISPATCHED;
 }
Index: insets/insetinclude.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.C,v
retrieving revision 1.117
diff -u -p -r1.117 insetinclude.C
--- insets/insetinclude.C   26 May 2003 09:13:53 -  1.117
+++ insets/insetinclude.C   28 May 2003 03:53:16 -
@@ -136,7 +136,7 @@ dispatch_result InsetInclude::localDispa
return DISPATCHED;
 
default:
-   return UNDISPATCHED;
+   return InsetButton::localDispatch(cmd);
}
 }
 
Index: insets/insetindex.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetindex.C,v
retrieving revision 1.40
diff -u -p -r1.40 insetindex.C
--- insets/insetindex.C 26 May 2003 09:13:53 -  1.40
+++ insets/insetindex.C 28 May 2003 03:53:16 -
@@ -52,7 +52,7 @@ dispatch_result InsetIndex::localDispatc
return DISPATCHED;
 
default:
-   return UNDISPATCHED;
+   return InsetCommand::localDispatch(cmd);
}
 }
 
Index: insets/insetparent.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetparent.C,v
retrieving revision 1.50
diff -u -p -r1.50 insetparent.C
--- insets/insetparent.C26 May 2003 09:13:53 -  1.50
+++ insets/insetparent.C28 May 2003 03:53:16 -
@@ -56,7 +56,7 @@ dispatch_result InsetParent::localDispat
cmd.view()->owner()->dispatch(FuncRequest(LFUN_CHILDOPEN, 
getContents()));
return DISPATCHED;
default:
-   return UNDISPATCHED;
+   return InsetCommand::localDispatch(cmd);
}
 }
 
Index: insets/insetref.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetref.C,v
retrieving revision 1.64
diff -u -p -r1.64 insetref.C
--- insets/insetref.C   26 May 2003 09:13:53 -  1.64
+++ insets/insetref.C   28 May 2003 03:53:16 -
@@ -52,7 +52,7 @@ dispatch_result InsetRef::localDispatch(
return DISPATCHED;
 
default:
-   return UNDISPATCHED;
+   return InsetCommand::localDispatch(cmd);
}
 }
 
Index: insets/insettoc.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettoc.C,v
retrieving revision 1.43
diff -u -p -r1.43 insettoc.C
--- insets/insettoc.C   26 May 2003 09:13:54 -  1.43
+++ insets/insettoc.C   28 May 2003 03:53:22 -
@@ -66,7 +66,7 @@ dispatch_result InsetTOC::localDispatch(
InsetCommandMailer("toc", *this).showDialog(cmd.view());
return DISPATCHED;
default:
-   return UNDISPATCHED;
+   return InsetCommand::localDispatch(cmd);
}
 }
 


Stuff became very slow

2003-05-30 Thread John Levon

Load extended.lyx and find the first Itemize list, then increase the
depth of one of the items. Dead slow. Has to be fixed I think

Profiles later

john


Re: [Devel] Re: [PATCH] Re: bug: text->footnote

2003-05-30 Thread John Levon
On Wed, May 28, 2003 at 02:28:13PM +0200, Juergen Spitzmueller wrote:

> OK. Then I'm out (no more ideas). But I vote for removing the current 
> conversion. If we don't do it right, we should not do it at all.

We wouldn't end up doing anything, we do barely anything fully
correctly.

Why can't we just use your patch, and file a bug on the broken clipboard
behaviour ? It's a reasonable tradeoff of bugs IMHO.

(Do you want to send me your patch for 1.4 again ?)

john


[meta-PATCH] bibtex inset crashes on reading in (Angus !)

2003-05-30 Thread John Levon

The bibtex inset now constructs itself using InsetCommandParams
in factory.C with a name of "bibtex". This breaks when you read it in,
since we are expecting "BibTeX" as the command name.

Possible fixes :

 o make createInset() set the command name to BibTeX (I assume this
   won't break the dialogs, which uses "bibtex" ?)

 o make readInset() handle "bibtex" as well

 o make readInset() handle only "bibtex", and do s/BibTeX/bibtex/ in
   lyx2lyx

So ... which one ? or another ?

regards
john


Re: [PATCH] Re: bug: text->footnote

2003-05-30 Thread John Levon
On Tue, May 27, 2003 at 01:49:23PM +0200, Jean-Marc Lasgouttes wrote:

> The solution would be to modify CutAndPaste to allow an alternative
> temporary clipboard, but this is probably a lot of work.

It's probably not that much work once lars is finished actually.

I'm OK with Juergen's patch as is. The delete behaviour has been around
forever hasn't it ?

john


Re: [PATCH] fix exiting of cells with Escape

2003-05-30 Thread John Levon
On Tue, May 27, 2003 at 10:00:26AM +0200, Andre Poenitz wrote:

> But its a worthy goal...

It is. In 1.7 ... (Lars' new nickname for "not gonna happen" :)

john


Re: [PATCH] Re: bug: text->footnote

2003-05-30 Thread Lars Gullik Bjønnes
John Levon <[EMAIL PROTECTED]> writes:

| On Tue, May 27, 2003 at 01:49:23PM +0200, Jean-Marc Lasgouttes wrote:
| 
| > The solution would be to modify CutAndPaste to allow an alternative
| > temporary clipboard, but this is probably a lot of work.
| 
| It's probably not that much work once lars is finished actually.

Finished with what?

I am pretty finished with CutAndPaste.

-- 
Lgb


Re: [Devel] possible minipage partial fix

2003-05-30 Thread John Levon
On Wed, May 28, 2003 at 04:24:44AM +0100, John Levon wrote:

> This helps a little bit in that minipage gets the right height now ...
> sometimes...

Even better, I can't reproduce any problems at all with the below.
Please review and test.

Andre, I think Dimension::height() is strictly useless. From what I can
tell inset metrics look like :

   
   | Minipage || |
  |---|| |
  |   || \ ascent
  |Text here. ||
  |---|\__ descent

Thus, ascent() + descent() doesn't seem useful. It seems this is
different to how mathed does it.

regards
john


Index: insets/insetminipage.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.C,v
retrieving revision 1.73
diff -u -p -r1.73 insetminipage.C
--- insets/insetminipage.C  27 May 2003 13:54:59 -  1.73
+++ insets/insetminipage.C  28 May 2003 03:27:57 -
@@ -236,14 +236,14 @@ void InsetMinipage::dimension(BufferView
dimension_collapsed(dim);
else {
Dimension d;
-   InsetCollapsable::dimension(bv, font, dim);
+   InsetCollapsable::dimension(bv, font, d);
switch (params_.pos) {
case top:
dim.asc = d.asc;
dim.des = d.des;
break;
case center:
-   dim.asc = d.height() / 2;
+   dim.asc = d.ascent() + d.descent() / 2;
dim.des = dim.asc;
break;
case bottom:
@@ -251,6 +251,7 @@ void InsetMinipage::dimension(BufferView
dim.des = d.asc;
break;
}
+   dim.wid = d.wid;
}
 }
 


Re: [crashing patch] Real copy constructors

2003-05-30 Thread John Levon
On Thu, May 29, 2003 at 06:27:47PM +0200, Lars Gullik Bj?nnes wrote:

> This patch does it, the brute force way, and as a result you get a lot
> of nice crashes. Please have a look if you want to exercise your
> problem solving abilities.

Don't we have enough problems to solve already in terms of crashes ?
You didn't say what help this patch will be to solving the crashes ...

Sorry to whine but ...

regards
john


Re: [Devel] Re: [PATCH] Re: bug: text->footnote

2003-05-30 Thread John Levon
On Wed, May 28, 2003 at 09:08:35AM +0200, Juergen Spitzmueller wrote:

> > Just that the user does not expect that the clipboard is modified.
> > There should not be any clipboard modification without an explicit
> > cut/copy.
> 
> Well then how about this? (As I said, the current implementation is more 
> confusing than helpful).

Rejected. We don't fix our bugs by trying to fix our users. Or rather,
we shouldn't.

> P.S.: For the sake of power users, I vote for the possibility to add a "Don't 
> ask again" checkbox to the Alert dialogs.

Adding such means we failed in our error handling.

regards
john


Re: [Devel] possible minipage partial fix

2003-05-30 Thread John Levon
On Wed, May 28, 2003 at 08:37:00AM +0200, Andre Poenitz wrote:

> The notion 'ascent above baseline' (positive upwards) and 'descent below
> baseline' (positive downwards) is not mathed's invention (certainly not
> mine).

Didn't say it was.

> > +   dim.asc = d.ascent() + d.descent() / 2;
> 
> And that works?

Yes, try it. (start from top of row, add half of the row height).

> 
> cvs diff to two weeks ago yields:
> 
> -   i = (InsetCollapsable::ascent(bv, font)
> -+ InsetCollapsable::descent(bv, font)) / 2;
> +   dim.asc = d.height() / 2;
> +   dim.des = dim.asc;
> 
> so this should be 
> 
> dim.asc = (d.ascent() + d.descent()) / 2 
> 
> which _is_ equivalent to
> 
> dim.asc = d.height()  / 2 

*shrug*. Too much has changed for me to play the "why" game.

john


possible minipage partial fix

2003-05-30 Thread John Levon

This helps a little bit in that minipage gets the right height now ...
sometimes...

Andre, please look.

There is still total horkage for minipages alas. It thinks it has a 
width of 0. Andre, I don't see any handling of -1 widths. Where does the
correction from -1 -> max text width happen ?

regards
john

p.s. I think we've reached the state in current CVS where going back is
impossible. Two of the most complex subsystems (inset metrics and undo)
will have to be rewritten. I reckon it will take six months or so to
get things back to a usable state since trying to fix things is so
incredibly difficult


Index: insets/insetminipage.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.C,v
retrieving revision 1.73
diff -u -p -r1.73 insetminipage.C
--- insets/insetminipage.C  27 May 2003 13:54:59 -  1.73
+++ insets/insetminipage.C  28 May 2003 02:44:57 -
@@ -236,7 +236,7 @@ void InsetMinipage::dimension(BufferView
dimension_collapsed(dim);
else {
Dimension d;
-   InsetCollapsable::dimension(bv, font, dim);
+   InsetCollapsable::dimension(bv, font, d);
switch (params_.pos) {
case top:
dim.asc = d.asc;


  1   2   >