Re: rhetorical question of the day

2007-10-30 Thread Abdelrazak Younes

Andre Poenitz wrote:

What's the reason of defining and throwing, but never catching
some exception?


IIRC, I've put some code in the Qt event loop to catch everything that 
was not caught before.




Andre'

PS: Hint: It's 60k extra compilation...


What? The inheritance of std::bad_cast? Would it help if we just inherit 
std::exception?


Also, I guess this class can be made private.

Abdel.



Re: current_font bug; char panel dead

2007-10-30 Thread Abdelrazak Younes

Andre Poenitz wrote:

On Mon, Oct 29, 2007 at 06:20:40PM +0100, Abdelrazak Younes wrote:

BTW has anyone else noticed that the character panel (text Style -
Customized) doesn't do anything anymore? Setting emph by ctrl-e
works fine, but from the panel it does nothing.

I guess nobody touched it after Andre' big GUII overhaul...


Looks like the panel is ok. But the a certain 'you...' broke with
21240 the stringification of font settings ;-)


Oups, sorry... CutPaste bug...



[Otoh just a sign that passing everything by string is fragile...]


Right.

Thanks,
Abdel.



Re: Integration of my dynmacro patch

2007-10-30 Thread Abdelrazak Younes

Stefan Schimanski wrote:

Hi!

As a long weekend is approaching here I think it would be a good time to 
start the integration of my dynamic macros into trunk. I think my patch 
is in a reasonable state right now that it makes sense to commit it.


Yes, much better except for MathData::attachMacroParameters() which is 
way too big IMHO (but this shouldn't stop you to commit if you promise 
to cut it down afterwards).


One bit:

+   for (; dit; dit.forwardPos()) {
...
+   Inset * inset = dit.nextInset();
+   if (inset) {
+   InsetMath * insetMath = inset-asInsetMath();
+   if (insetMath) {

This is the same as:

+   for (; dit; dit.forwardPos()) {
...
+   Inset * inset = dit.nextInset();
+   if (!inset)
+   continue;   
+   InsetMath * insetMath = inset-asInsetMath();
+   if (insetMath) {



Re: Integration of my dynmacro patch

2007-10-30 Thread Abdelrazak Younes

Stefan Schimanski wrote:

Hi!

As a long weekend is approaching here I think it would be a good time to 
start the integration of my dynamic macros into trunk. I think my patch 
is in a reasonable state right now that it makes sense to commit it.


I was testing the dynamic macros for two weeks in real life to prepare 
exercise sheets and solutions for a lecture, with heavy use of macros to 
build proof trees. Everything was stable and usable. So I have 
confidence that it will be fine when committed now.


I would like to start with the integration on Thursday morning and would 
be available the whole day to fix issues (if anything comes up).


Looks like a good plan :-)

Abdel.



Re: Integration of my dynmacro patch

2007-10-30 Thread Stefan Schimanski


Am 30.10.2007 um 08:45 schrieb Abdelrazak Younes:


Stefan Schimanski wrote:

Hi!
As a long weekend is approaching here I think it would be a good  
time to start the integration of my dynamic macros into trunk. I  
think my patch is in a reasonable state right now that it makes  
sense to commit it.


Yes, much better except for MathData::attachMacroParameters() which  
is way too big IMHO (but this shouldn't stop you to commit if you  
promise to cut it down afterwards).


Will take another look. Was already happy to be able to split it like  
that. Had expected that the code parts are more interrelated in fact.


Stefan


PGP.sig
Description: Signierter Teil der Nachricht


Re: Integration of my dynmacro patch

2007-10-30 Thread Stefan Schimanski


Am 30.10.2007 um 00:44 schrieb Uwe Stöhr:


Stefan Schimanski schrieb:


@Uwe: Will you take care of the format changes?
 I guess the lyx2lyx extension should come before the commit of my  
patch?


I'm currently limited in my spare time, so I cannot promise to take  
care a certain day. For me it would be the best when you commit  
your stuff, including a fileformat change with empty lyx2lyx  
routines. I can then add the lyx2lyx routines the next days when I  
find time.


Ok, will add them. Thanks for your help!




Did you see my documentation I posted some time ago?


No, but what you linked with your mail is excellent. Could you send  
me the LyX-file too?


Sure: http://1stein.org/download/dynmacro.lyx




Is it enough?


I think so. Are there macro definition example in the LyX-file of  
your docu?
I'll include your macro description to the math manual I'm  
currently writing.


I have many test cases here: http://1stein.org/download/testcases.lyx

Regards
  Stefan

PGP.sig
Description: Signierter Teil der Nachricht


Re: Patch: use ForceLtR etc, simplify code

2007-10-30 Thread Martin Vermeer
On Mon, 29 Oct 2007 18:42:45 +0200
Martin Vermeer [EMAIL PROTECTED] wrote:

 
 Partly building on Abdel's work with fonts and language. This should
 help get Dov what he needs.
 
 Tested it cursorily, should be OK. And found some bugs along the way ;-)
 
 - Martin


Here is an improved version. The code base has been substantially cleaned
up. And now InsetListings is Collapsable-based!

If I don't hear objections, this goes in soon.

- Martin
Index: src/insets/InsetFlex.cpp
===
--- src/insets/InsetFlex.cpp	(revision 21258)
+++ src/insets/InsetFlex.cpp	(working copy)
@@ -95,56 +95,6 @@
 }
 
 
-void InsetFlex::metrics(MetricsInfo  mi, Dimension  dim) const
-{
-	FontInfo tmpfont = mi.base.font;
-	getDrawFont(mi.base.font);
-	mi.base.font.reduce(sane_font);
-	mi.base.font.realize(tmpfont);
-	InsetCollapsable::metrics(mi, dim);
-	mi.base.font = tmpfont;
-}
-
-
-void InsetFlex::draw(PainterInfo  pi, int x, int y) const
-{
-	FontInfo tmpfont = pi.base.font;
-	getDrawFont(pi.base.font);
-	// I don't understand why the above .reduce and .realize aren't
-	//needed, or even wanted, here. It just works. -- MV 10.04.2005
-	InsetCollapsable::draw(pi, x, y);
-	pi.base.font = tmpfont;
-}
-
-
-void InsetFlex::getDrawFont(FontInfo  font) const
-{
-	font = layout_.font;
-}
-
-
-void InsetFlex::doDispatch(Cursor  cur, FuncRequest  cmd)
-{
-	InsetCollapsable::doDispatch(cur, cmd);
-}
-
-
-bool InsetFlex::getStatus(Cursor  cur, FuncRequest const  cmd,
-	FuncStatus  status) const
-{
-	switch (cmd.action) {
-		// paragraph breaks not allowed in flex insets
-		case LFUN_BREAK_PARAGRAPH:
-		case LFUN_BREAK_PARAGRAPH_SKIP:
-			status.enabled(layout_.multipar);
-			return true;
-
-		default:
-			return InsetCollapsable::getStatus(cur, cmd, status);
-		}
-}
-
-
 int InsetFlex::plaintext(Buffer const  buf, odocstream  os,
 			  OutputParams const  runparams) const
 {
Index: src/insets/InsetERT.h
===
--- src/insets/InsetERT.h	(revision 21258)
+++ src/insets/InsetERT.h	(working copy)
@@ -48,8 +48,6 @@
 	///
 	void write(Buffer const  buf, std::ostream  os) const;
 	///
-	void read(Buffer const  buf, Lexer  lex);
-	///
 	virtual docstring const editMessage() const;
 	///
 	bool insetAllowed(InsetCode code) const;
@@ -71,8 +69,6 @@
 	///
 	bool showInsetDialog(BufferView *) const;
 	///
-	void getDrawFont(FontInfo ) const;
-	///
 	bool forceDefaultParagraphs(idx_type) const { return true; }
 	/// should paragraph indendation be ommitted in any case?
 	bool neverIndent(Buffer const ) const { return true; }
@@ -84,6 +80,8 @@
 	bool getStatus(Cursor  cur, FuncRequest const  cmd, FuncStatus ) const;
 	///
 	void resetParagraphsFont();
+	///
+	void getDrawFont(FontInfo ) const;
 
 private:
 	virtual Inset * clone() const;
Index: src/insets/InsetERT.cpp
===
--- src/insets/InsetERT.cpp	(revision 21258)
+++ src/insets/InsetERT.cpp	(working copy)
@@ -121,21 +121,6 @@
 }
 
 
-void InsetERT::read(Buffer const  buf, Lexer  lex)
-{
-	InsetCollapsable::read(buf, lex);
-
-	// Force default font
-	// This avoids paragraphs in buffer language that would have a
-	// foreign language after a document langauge change, and it ensures
-	// that all new text in ERT gets the latex language, since new text
-	// inherits the language from the last position of the existing text.
-	// As a side effect this makes us also robust against bugs in LyX
-	// that might lead to font changes in ERT in .lyx files.
-	resetParagraphsFont();
-}
-
-
 docstring const InsetERT::editMessage() const
 {
 	return _(Opened ERT Inset);
@@ -208,19 +193,6 @@
 		setStatus(cur, st);
 		break;
 	}
-	case LFUN_PASTE:
-	case LFUN_CLIPBOARD_PASTE:
-	case LFUN_PRIMARY_SELECTION_PASTE: {
-		InsetCollapsable::doDispatch(cur, cmd);
-
-		// Since we can only store plain text, we must reset all
-		// attributes.
-		// FIXME: Change only the pasted paragraphs
-
-		// ERT contents has always latex_language
-		resetParagraphsFont();
-		break;
-	}
 	default:
 		// Force any new text to latex_language
 		// FIXME: This should only be necessary in init(), but
@@ -230,8 +202,6 @@
 		// approach.
 		cur.current_font.fontInfo() = layout-font;
 		cur.real_current_font.fontInfo() = layout-font;
-		cur.current_font.setLanguage(latex_language);
-		cur.real_current_font.setLanguage(latex_language);
 		InsetCollapsable::doDispatch(cur, cmd);
 		break;
 	}
Index: src/insets/InsetListings.h
===
--- src/insets/InsetListings.h	(revision 21258)
+++ src/insets/InsetListings.h	(working copy)
@@ -24,7 +24,7 @@
  */
 
 
-class InsetListings : public InsetERT {
+class InsetListings : public InsetCollapsable {
 public:
 	///
 	InsetListings(BufferParams const , InsetListingsParams const  par = InsetListingsParams());
@@ -49,14 +49,8 @@
 	///
 	void validate(LaTeXFeatures 

[patch] bug 3999: Find dialog text is not selected

2007-10-30 Thread Jürgen Spitzmüller
http://bugzilla.lyx.org/show_bug.cgi?id=3999

The attached patch (against branch) finally fixes this issue. I don't see an 
alternative to implementing update_contents().

Objections?

Jürgen
Index: src/frontends/qt4/QSearch.h
===
--- src/frontends/qt4/QSearch.h	(Revision 21284)
+++ src/frontends/qt4/QSearch.h	(Arbeitskopie)
@@ -30,7 +30,6 @@
 public:
 	QSearchDialog(QSearch * form);
 
-	virtual void show();
 protected Q_SLOTS:
 	void findChanged();
 	void findClicked();
@@ -59,7 +58,7 @@
 	/// Apply changes
 	virtual void apply() {}
 	/// update
-	virtual void update_contents() {}
+	virtual void update_contents();
 	/// build the dialog
 	virtual void build_dialog();
 
Index: src/frontends/qt4/QSearch.cpp
===
--- src/frontends/qt4/QSearch.cpp	(Revision 21284)
+++ src/frontends/qt4/QSearch.cpp	(Arbeitskopie)
@@ -50,23 +50,16 @@
 	setupUi(this);
 
 	connect(closePB, SIGNAL(clicked()), form_, SLOT(slotClose()));
-  connect(findPB, SIGNAL(clicked()), this, SLOT(findClicked()));
-  connect(replacePB, SIGNAL(clicked()), this, SLOT(replaceClicked()));
-  connect(replaceallPB, SIGNAL(clicked()), this, SLOT(replaceallClicked()));
-  connect(findCO, SIGNAL(editTextChanged(const QString )),
+	connect(findPB, SIGNAL(clicked()), this, SLOT(findClicked()));
+	connect(replacePB, SIGNAL(clicked()), this, SLOT(replaceClicked()));
+	connect(replaceallPB, SIGNAL(clicked()), this, SLOT(replaceallClicked()));
+	connect(findCO, SIGNAL(editTextChanged(const QString )),
 		this, SLOT(findChanged()));
 
 	setFocusProxy(findCO);
 }
 
 
-void QSearchDialog::show()
-{
-	QDialog::show();
-	findCO-lineEdit()-setSelection(0, findCO-lineEdit()-text().length());
-}
-
-
 void QSearchDialog::closeEvent(QCloseEvent * e)
 {
 	form_-slotWMHide();
@@ -96,7 +89,6 @@
 		wordsCB-isChecked(),
 		backwardsCB-isChecked());
 	uniqueInsert(findCO, findCO-currentText());
-	findCO-lineEdit()-setSelection(0, findCO-lineEdit()-text().length());
 }
 
 
@@ -155,6 +147,12 @@
 }
 
 
+void QSearch::update_contents()
+{
+	dialog_-findCO-lineEdit()-selectAll();
+}
+
+
 void QSearch::find(docstring const  str, bool casesens,
 		   bool words, bool backwards)
 {


1.6svn pasting text from other apps have been broken for a while

2007-10-30 Thread Helge Hafting

The common way of copy+paste in linux is
to mark some text, and then middle-click where it
should go.

This has been broken in 1.6svn for some time.
The problem exists in a LyX compiled 17.october,
as well as today's LyX.

Such pasting will occationally work, but almost never.

Pasting within LyX is ok, but this means it is almost
impossible to bring in text from other editors or webpages.
The edit-paste menus fail the same way - nothing happens.

Also, 1.6svn seems useless in that latex now chokes on
simple things like URLs. Probably an effect of
ongoing development.  :-)

Helge Hafting


Re: 1.6svn pasting text from other apps have been broken for a while

2007-10-30 Thread Bo Peng
 This has been broken in 1.6svn for some time.
 The problem exists in a LyX compiled 17.october,
 as well as today's LyX.

I noticed this a while ago, and nobody claimed responsibility for breaking it.

Bo


Re: r21291 - in /lyx-devel/trunk/src/frontends/qt4: GuiKeySym...

2007-10-30 Thread Bo Peng
On 10/30/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Author: bpeng
 Date: Tue Oct 30 17:04:48 2007
 New Revision: 21291

 URL: http://www.lyx.org/trac/changeset/21291
 Log:
 Fix the shortcut input dialog bug (can not input Ctrl-blah)

Problem: setKeySymbol sets QKeyEvent::text() as KeySymbol::text_. This
is wrong because C-A, C-B etc produce all sorts  of strange symbols.
(Run lyx -dbg key to see what I mean). When getSymbolName is called,
such strange symbols are picked up because Key_A etc are not handled
by qkey_to_string.

Solution: Add Qt::Key_A etc to qkey_to_string so that they can be
handled properly.

Remaining problems of the shortcut dialog:

1. JMarc does not like the GUI but his proposal is too complicated for
me to implement, and I do not see a clear advantage of his proposal.
As a compromise, I have stopped displaying the confusing 'unmatched
removed shortcut'.

2. Apply will actually Save the shortcuts. This is difficult to solve
because there is no way to apply (keep the state), and allow later
save. Because I strongly prefer the removal of the Apply button, I
will NOT fix this problem. If you think this is unacceptable, you can
stop applying new shortcuts and require a restart to make use of them,
as 1.5.x does.

Please test and report bugs.

Cheers,
Bo


Re: 1.6svn pasting text from other apps have been broken for a while

2007-10-30 Thread Martin Vermeer
On Tue, 30 Oct 2007 14:53:39 +0100
Helge Hafting [EMAIL PROTECTED] wrote:

...
 
 Also, 1.6svn seems useless in that latex now chokes on
 simple things like URLs. Probably an effect of
 ongoing development.  :-)
 
 Helge Hafting

The attached should solve part of the problem. Going in.

- MartinIndex: output_latex.cpp
===
--- output_latex.cpp	(revision 21285)
+++ output_latex.cpp	(working copy)
@@ -254,15 +254,18 @@
 	LayoutPtr style;
 
 	if (runparams_in.verbatim) {
-		Font const outerfont =
-			outerFont(std::distance(paragraphs.begin(), pit),
-  paragraphs);
+		int dist = std::distance(paragraphs.begin(), pit);
+		Font const outerfont = outerFont(dist, paragraphs);
 
+		// No newline if only one paragraph in this lyxtext
+		if (dist  0) {
+			os  '\n';
+			texrow.newline();
+		}
+
 		/*bool need_par = */ pit-latex(buf, bparams, outerfont,
 			os, texrow, runparams_in);
 
-		os  '\n';
-		texrow.newline();
 		return ++pit;
 	}
 


Re: Lyx 1.5.2-1 (Windows) crashes on creatin new file, worked in Lyx 1.4.4

2007-10-30 Thread Jürgen Spitzmüller
Ekkehart Schlicht wrote:
 It crashed again. I ran it with -dbg any and tried to pipe the output to
 a text file. This did not work. I cannot copy and paste the output from
 the debug window either. If you could make a suggestion how to capture
 the output without retyping it (it is quite large) I would be grateful.

If everything else fails, post a screenshot.

Jürgen


Re: Lyx 1.5.2-1 (Windows) crashes on creatin new file, worked in Lyx 1.4.4

2007-10-30 Thread Ekkehart Schlicht



It crashed again. I ran it with -dbg any and tried to pipe the output to 
a text file. This did not work. I cannot copy and paste the output from 
the debug window either. If you could make a suggestion how to capture 
the output without retyping it (it is quite large) I would be grateful.


Ekkehart


Jürgen Spitzmüller
Sat, 13 Oct 2007 06:39:50 -0700

Ekkehart Schlicht wrote:
 When issuing a New File command (from the Menu) or a New File from
 Template, lyx crashes.

Can you post the output of lyx -dbg any?

Jürgen


[patch] bug 4147: Multiple cells paste as one in tables

2007-10-30 Thread Jürgen Spitzmüller
http://bugzilla.lyx.org/show_bug.cgi?id=4147

The bug is the result of an encoding failure (use of char instead of 
char_type) that results in an unwanted conversion of a tabulator ('\t') to 
the digit '9'.

I'll commit to branch and trunk on Friday if I get no objections.

Jürgen
Index: src/insets/InsetTabular.h
===
--- src/insets/InsetTabular.h	(Revision 21284)
+++ src/insets/InsetTabular.h	(Arbeitskopie)
@@ -357,7 +357,7 @@
 	///
 	void plaintext(Buffer const , odocstream ,
 		   OutputParams const  runparams, int const depth,
-		   bool onlydata, unsigned char delim) const;
+		   bool onlydata, char_type delim) const;
 	///
 	bool isMultiColumn(idx_type cell) const;
 	///
Index: src/insets/InsetTabular.cpp
===
--- src/insets/InsetTabular.cpp	(Revision 21284)
+++ src/insets/InsetTabular.cpp	(Arbeitskopie)
@@ -2750,7 +2750,7 @@
 
 void Tabular::plaintext(Buffer const  buf, odocstream  os,
 			   OutputParams const  runparams, int const depth,
-			   bool onlydata, unsigned char delim) const
+			   bool onlydata, char_type delim) const
 {
 	// first calculate the width of the single columns
 	vectorunsigned int clen(columns_);


[patch] Bug 3586: Spell check doesn't update the screen display on the last of several mis-spelt words

2007-10-30 Thread Jürgen Spitzmüller
http://bugzilla.lyx.org/show_bug.cgi?id=3586

Missing update. Patch against branch attached (I haven't checked trunk yet, 
but it shouldn't differ).

I'll commit to branch and trunk on Friday if I get no objections.

Jürgen
Index: src/frontends/controllers/ControlSpellchecker.cpp
===
--- src/frontends/controllers/ControlSpellchecker.cpp	(Revision 21284)
+++ src/frontends/controllers/ControlSpellchecker.cpp	(Arbeitskopie)
@@ -219,6 +219,11 @@
 
 		// end of document
 		if (getWord().empty()) {
+			// FIXME: if we used a lfun like in find/replace, dispatch
+			// would do that for us
+			kernel().bufferview()-update();
+			// FIXME: this Controller is very badly designed...
+			kernel().lyxview().currentWorkArea()-redraw();
 			showSummary();
 			exitEarly_ = true;
 			return;


[patch] Bug 4090: Latex errors dialog closes upon double mouse-click

2007-10-30 Thread Jürgen Spitzmüller
http://bugzilla.lyx.org/show_bug.cgi?id=4090

I agree with the reporter that this behaviour is irritating, especially since 
the error dialog can not be easily reopened.

I'll commit the attached to branch and trunk on Friday if I get no objections.

Jürgen
Index: src/frontends/qt4/QErrorList.cpp
===
--- src/frontends/qt4/QErrorList.cpp	(Revision 21284)
+++ src/frontends/qt4/QErrorList.cpp	(Arbeitskopie)
@@ -36,8 +36,6 @@
 	setupUi(this);
 	connect(closePB, SIGNAL(clicked()),
 		form, SLOT(slotClose()));
-	connect(errorsLW, SIGNAL( itemActivated(QListWidgetItem *)),
-		form, SLOT(slotClose()));
 	connect( errorsLW, SIGNAL( itemClicked(QListWidgetItem *)),
 		this, SLOT(select_adaptor(QListWidgetItem *)));
 }


Re: Lyx 1.5.2-1 (Windows) crashes on creatin new file, worked in Lyx 1.4.4

2007-10-30 Thread Enrico Forestieri
On Tue, Oct 30, 2007 at 05:59:24PM +0100, Jürgen Spitzmüller wrote:
 Ekkehart Schlicht wrote:
  It crashed again. I ran it with -dbg any and tried to pipe the output to
  a text file. This did not work. I cannot copy and paste the output from
  the debug window either. If you could make a suggestion how to capture
  the output without retyping it (it is quite large) I would be grateful.
 
 If everything else fails, post a screenshot.

I think the problem is that he has to redirect stderr. Ekkehart, have
you tried using the following command line?

lyxc.exe -dbg any 2 dbg.log

-- 
Enrico


Re: [patch] Bug 3586: Spell check doesn't update the screen display on the last of several mis-spelt words

2007-10-30 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
 (I haven't checked trunk yet,
 but it shouldn't differ).

Excpet from the fact that the spellchecker is completely broken in trunk :-(

Jürgen


Re: Patch: use ForceLtR etc, simplify code

2007-10-30 Thread Abdelrazak Younes

Martin Vermeer wrote:

On Mon, 29 Oct 2007 18:42:45 +0200
Martin Vermeer [EMAIL PROTECTED] wrote:


Partly building on Abdel's work with fonts and language. This should
help get Dov what he needs.

Tested it cursorily, should be OK. And found some bugs along the way ;-)

- Martin



Here is an improved version. The code base has been substantially cleaned
up. And now InsetListings is Collapsable-based!


Impressive code reduction!

Abdel.



Re: Lyx 1.5.2-1 (Windows) crashes on creatin new file, worked in Lyx 1.4.4

2007-10-30 Thread Martin Vermeer
On Tue, Oct 30, 2007 at 05:53:33PM +0100, Ekkehart Schlicht wrote:
 
 
 It crashed again. I ran it with -dbg any and tried to pipe the output to 
 a text file. This did not work. I cannot copy and paste the output from 
 the debug window either. If you could make a suggestion how to capture 
 the output without retyping it (it is quite large) I would be grateful.
 
 Ekkehart
 
Depending on the shell, 2 file.txt might do it.

- Martin
 


Re: Smooth scrolling

2007-10-30 Thread Tommaso Cucinotta

Abdelrazak Younes ha scritto:

I've played with it a bit together with Tommaso (off-list).

Confirmed. I made an attempt of refactory of the overall logics,
completely getting rid of the par height estimates, replaced by
appropriate loops summing up heights. This of course
ended up in a perfectly smooth scrolling, also in cases of large
tables and pictures, but completely crazy cursor movements
that crashed LyX. I was keeping in memory the entire document
metrics, but Abdel warned me about memory usage, so I decided
to use a vector of heights, plus the current cache.
Unfortunately, I had to work in the last few weeks, so I couldn't
finish the job.
I think most other applications do some layouting in the background 
to get those height values. Has anybody tried to do the same with LyX?

In my idea, this would be the most usable thing: right after opening
a document, the scrollbar keeps adjusting for a few seconds. After
that moment, everything scrolls fine. If you resize horizontally, then
the process is repeated.
One could fill up the height cache in idle times for example after 
the document is loaded, maybe with some regulation to not stress the 
machine too much.
You don't really need a map. A vector of height for the outermost 
paragraphs should be enough. Initially the vector would be filled with 
nominal values. Each time a paragraph metrics is calculated, the 
nominal value will be replaced by the real height. We have to be 
careful to maintain the vector in line with the main paragraph list.

Infact.

   T.


Re: A wishlist for LyX

2007-10-30 Thread Tommaso Cucinotta

Richard Heck ha scritto:
do something like hold down control+shift and click on a label 
to insert a reference to that label at the current cursor position.

I'd like to suggest an alternative usage paradigm for this, conditioned to
the implementation of context-sensitive menus. The idea is:

1. right-click on a label, numbered equation or section/paragraph
2. select a menu entry copy reference
3. then simply paste wherever you want in the document, and you get
   a reference to the label.

So many times I have the label just a few lines above (because I just 
inserted
a table, picture, or formula), and I need to refer to it, but the 
process for doing
it is really boring (I wish I could even drag the label into a text 
position).


   T.


Re: [patch] Bug 3586: Spell check doesn't update the screen display on the last of several mis-spelt words

2007-10-30 Thread Uwe Stöhr

 Excpet from the fact that the spellchecker is completely broken in trunk :-(

This is btw. reported here:
http://wiki.lyx.org/Devel/RegressionListSVN

Uwe



SCons problem when compiling with version suffix

2007-10-30 Thread Uwe Stöhr

When I start compiling LyX with the version suffix 16 using this command:

call scons install prefix=..\..\build-msvc use_vc=yes frontend=qt4 mode=release version_suffix=16 
gettext=system nls=yes extra_inc_path=..\..\lyx-windows-deps-msvc-qt4\include 
extra_lib_path=..\..\lyx-windows-deps-msvc-qt4\lib 
extra_bin_path=..\..\lyx-windows-deps-msvc-qt4\bin qt_dir=..\..\lyx-windows-deps-msvc-qt4\qt-4

cd ..\Win32\packaging

SCons still gives me this

-c install prefix=..\..\build-msvc use_vc=yes frontend=qt4 mode=release version_suffix=15 
gettext=system nls=yes


in scons_lyx.log Also when I start from scratch and delete the SCons cache, etc.

I'm not able to find where this wrong version sufix is set. What do I do wrong?

thanks and regards
Uwe


Repeatable crash with lyx 1.5.2.

2007-10-30 Thread Bo Peng
1. Create a new file, enter two lines of text and change the style of
the first line to section. ( a sample is attached).

2. select both lines, with mouse ending at the first line.

3. type something, the section title is changed

4. click on the second line, lyx crashes, with

Assertion triggered in const lyx::Font
lyx::Paragraph::getFontSettings(const lyx::BufferParams,
lyx::pos_type) const by failing check pos = size() in file
src/Paragraph.cpp:1317

(gdb) backtrace
#0  0x0037b322e25d in raise () from /lib64/tls/libc.so.6
#1  0x0037b322fa5e in abort () from /lib64/tls/libc.so.6
#2  0x00a8bc5d in lyx::support::abort () at src/support/abort.cpp:25
#3  0x00527f2c in boost::assertion_failed (
expr=0xb243d3 pos = size(),
function=0xb23f80 const lyx::Font
lyx::Paragraph::getFontSettings(const lyx::BufferParams,
lyx::pos_type) const, file=0xb24397 src/Paragraph.cpp,
line=1317) at src/boost.cpp:56
#4  0x004aa1ad in lyx::Paragraph::getFontSettings (this=0x13d4e40,
[EMAIL PROTECTED], pos=1) at src/Paragraph.h:170
#5  0x00556211 in lyx::Bidi::computeTables (this=0x7fbfffdf00,
[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]) at src/Bidi.cpp:111
#6  0x0066c8d2 in lyx::TextMetrics::getColumnNearX (this=0x1400c28,
pit=Variable pit is not available.
) at src/TextMetrics.cpp:820
#7  0x006679a1 in lyx::Text::editXY (this=0x1404198,
[EMAIL PROTECTED], x=41, y=108) at src/Text2.cpp:908
#8  0x005aae6b in lyx::BufferView::workAreaDispatch (this=0x10d6a00,
cmd0=Variable cmd0 is not available.
) at src/BufferView.cpp:1229


temp.lyx
Description: application/lyx


Re: SCons problem when compiling with version suffix

2007-10-30 Thread Bo Peng
On 10/30/07, Uwe Stöhr [EMAIL PROTECTED] wrote:
 When I start compiling LyX with the version suffix 16 using this command:

 call scons install prefix=..\..\build-msvc use_vc=yes frontend=qt4 
 mode=release version_suffix=16
 gettext=system nls=yes extra_inc_path=..\..\lyx-windows-deps-msvc-qt4\include
 extra_lib_path=..\..\lyx-windows-deps-msvc-qt4\lib
 extra_bin_path=..\..\lyx-windows-deps-msvc-qt4\bin 
 qt_dir=..\..\lyx-windows-deps-msvc-qt4\qt-4
 cd ..\Win32\packaging

Is this in a batch file?

 SCons still gives me this

 -c install prefix=..\..\build-msvc use_vc=yes frontend=qt4 mode=release 
 version_suffix=15
 gettext=system nls=yes

 in scons_lyx.log Also when I start from scratch and delete the SCons cache, 
 etc.

opt.cache will cache a few options, and when you override with
version_suffix=16, value 15 will not be used. I can not imagine where
this version_suffix=15 sneaks in. Maybe you can search the directory
for string 15?

Bo


Re: SCons problem when compiling with version suffix

2007-10-30 Thread Uwe Stöhr

Bo Peng schrieb:


Is this in a batch file?


Yes.


SCons still gives me this

-c install prefix=..\..\build-msvc use_vc=yes frontend=qt4 mode=release 
version_suffix=15
gettext=system nls=yes

in scons_lyx.log Also when I start from scratch and delete the SCons cache, etc.


opt.cache will cache a few options, and when you override with
version_suffix=16, value 15 will not be used. I can not imagine where
this version_suffix=15 sneaks in. Maybe you can search the directory
for string 15?


I searched for this but can't find it.

I deleted the folders

.sconf_temp and release

and the files
config.log, config_lyx.log, opt.cache, and .sconsign.dblite
to assure that I start from scratch.

When I now execute the command from the batch file, SCons uses 15 as version suffix and 
not 16.

regards Uwe


Re: SCons problem when compiling with version suffix

2007-10-30 Thread Bo Peng
 When I now execute the command from the batch file, SCons uses 15 as 
 version suffix and not 16.

The third line of scons_lyx.log lists the command used, which is
simply what it gets from command line. If you get 15 over there, I
have no clue what is goine on.

Bo


Re: SCons problem when compiling with version suffix

2007-10-30 Thread Uwe Stöhr

Bo Peng schrieb:


The third line of scons_lyx.log lists the command used, which is
simply what it gets from command line. If you get 15 over there, I
have no clue what is goine on.


I found now the reason: My script started unwanted the script that is in
\development\Win32\packaging
and used the suffix 15. I fixed this now in SVN.

thanks for your help and regards
Uwe


fix LFUN_LANGUAGE bug, due to Font/Language separation

2007-10-30 Thread Dov Feldstern

Hi!

I committed a fix to a bug due to the Font/Language separation, which 
was causing LFUN_LANGUAGE to not work 
(http://www.lyx.org/trac/changeset/21305).


This solution may be a bit of a hack --- I'm not familiar enough with 
the bigger picture. Perhaps a better solution would be to further 
separate between Font and Language, by changing toggleFree to deal with 
them in a totally separate manner, or even to have separate functions 
for the language and font. If anyone feels like looking into this, feel 
free.


Dov


[patch] Putting ForceLTR to use

2007-10-30 Thread Dov Feldstern

Hi!

Martin --- thanks for all your work towards the ForceLTR option!

The attached patch uses this option in order to make sure that insets 
which define this option are put in an LTR environment if they are in 
RTL surroundings (which is why I originally asked for this option).


To this end, I also define two new functions:

1) An accessor method InsetCollapsable::ForceLTR
2) The virtual Inset::asCollapsableInset for identifying insets which 
are (or inherit from) Collapsable. (Similar to asTextInset, asMathInset).


Please look this over, I will commit in the next few days if there are 
no objections.


Dov
diff -r 14ceb06dbd35 src/Paragraph.cpp
--- a/src/Paragraph.cpp Wed Oct 31 00:15:34 2007 +0200
+++ b/src/Paragraph.cpp Wed Oct 31 00:40:23 2007 +0200
@@ -718,7 +718,11 @@ void Paragraph::Private::latexInset(Buff
 
if ((inset-lyxCode() == GRAPHICS_CODE
 || inset-lyxCode() == MATH_CODE
-|| inset-lyxCode() == HYPERLINK_CODE)
+|| inset-lyxCode() == HYPERLINK_CODE
+|| (inset-asCollapsableInset()
+ inset-asCollapsableInset()-forceLTR()
+// ERT is an exception, since it doesn't go to output
+ inset-lyxCode() != ERT_CODE))
 running_font.isRightToLeft()) {
if (running_font.language()-lang() == farsi)
os  \\beginL{};
diff -r 14ceb06dbd35 src/insets/Inset.h
--- a/src/insets/Inset.hWed Oct 31 00:15:34 2007 +0200
+++ b/src/insets/Inset.hWed Oct 31 00:40:23 2007 +0200
@@ -36,6 +36,7 @@ class CursorSlice;
 class CursorSlice;
 class FuncRequest;
 class FuncStatus;
+class InsetCollapsable;
 class InsetIterator;
 class InsetLayout;
 class InsetList;
@@ -90,7 +91,11 @@ public:
virtual InsetText * asTextInset() { return 0; }
/// is this inset based on the TextInset class?
virtual InsetText const * asTextInset() const { return 0; }
-   
+   /// is this inset based on the CollapsableInset class?
+   virtual InsetCollapsable * asCollapsableInset() { return 0; }
+   /// is this inset based on the CollapsableInset class?
+   virtual InsetCollapsable const * asCollapsableInset() const { return 0; 
}
+
/// the real dispatcher
void dispatch(Cursor  cur, FuncRequest  cmd);
/**
diff -r 14ceb06dbd35 src/insets/InsetCollapsable.h
--- a/src/insets/InsetCollapsable.h Wed Oct 31 00:15:34 2007 +0200
+++ b/src/insets/InsetCollapsable.h Wed Oct 31 00:40:23 2007 +0200
@@ -132,6 +132,11 @@ public:
///
virtual ColorCode backgroundColor() const {return layout_.bgcolor; }
 
+   ///
+   InsetCollapsable * asCollapsableInset() { return this; }
+   ///
+   InsetCollapsable const * asCollapsableInset() const { return this; }
+
int latex(Buffer const , odocstream ,
  OutputParams const ) const;
///
@@ -143,6 +148,8 @@ public:
virtual bool isFreeSpacing() const { return layout_.freespacing; }
/// Don't eliminate empty paragraphs
virtual bool allowEmpty() const { return layout_.keepempty; }
+   /// Force inset into LTR environment if surroundings are RTL
+   virtual bool forceLTR() const { return layout_.forceltr; }
 
 protected:
///


ignore_language

2007-10-30 Thread Dov Feldstern

Hi!

A few days ago we were wondering about what exactly ignore_language 
is, and I just ran into a use of it in the code so that I now think I 
know what it is: it's used to represent a neutral language, i.e., when 
providing a font-change mask, ignore_language is used to signify that 
the language should not be changed. (The truth is, I'm not sure why we 
need it, because it seems like 0 (null) is also used for this purpose, 
and that's probably good enough.)


If this sounds right, we should probably add a comment explaining this 
where ignore_language is defined in the sources.


Dov


warnings in Paragraph.cpp

2007-10-30 Thread Dov Feldstern

Hi!

There are a few warnings in Paragraph.cpp, if anyone cares to take a look:

Paragraph.cpp: In member function 'void 
lyx::Paragraph::Private::insertChar(lyx::pos_type, lyx::char_type, const 
lyx::Change)':
Paragraph.cpp:415: warning: comparison between signed and unsigned 
integer expressions

Paragraph.cpp: At global scope:
Paragraph.cpp:577: warning: unused parameter 'c'
Paragraph.cpp: In member function 'void 
lyx::Paragraph::appendString(const lyx::docstring, const lyx::Font, 
const lyx::Change)':
Paragraph.cpp:1232: warning: comparison between signed and unsigned 
integer expressions


Thanks!
Dov


Re: [patch] bug 4147: Multiple cells paste as one in tables

2007-10-30 Thread Enrico Forestieri
On Tue, Oct 30, 2007 at 06:26:45PM +0100, Jürgen Spitzmüller wrote:
 http://bugzilla.lyx.org/show_bug.cgi?id=4147
 
 The bug is the result of an encoding failure (use of char instead of 
 char_type) that results in an unwanted conversion of a tabulator ('\t') to 
 the digit '9'.
 
 I'll commit to branch and trunk on Friday if I get no objections.

This is not going to work on systems where sizeof(wchar_t) == 2.
I have attached a better fix to bug 4147 on bugzilla.

-- 
Enrico


about the Qt 4.3 designer format problem

2007-10-30 Thread Uwe Stöhr
Since a while now I use Qt 4.3 to compile LyX with success. But when I check in modifiactions to 
.ui-files, they cannot be compiled by those who use Qt 4.2.


I looked at the announcement files of Qt 4.3 but couldn't find a hint that Qt 4.3's ui format is 
different, so what can be the problem?


I'm not able to use Qt 4.2's designer when the rest is Qt 4.3, because designer checks for the 
system-wide Qt setting. As this is Qt 4.3 Qt 4.2's designer complained about this and don't start. 
When I change Qt system config to Qt 4.2 designer starts, but I can then not compile LyX using Qt 4.3.


Any ideas, or have you perhaps read something about .ui-file format changes in Qt 4.2? In case there 
was something changed in the format, I wonder that Qt 4.3's designer don't have an export function 
to produce Qt 4.2's .ui format.


regards Uwe


Re: about the Qt 4.3 designer format problem

2007-10-30 Thread Andre Poenitz
On Wed, Oct 31, 2007 at 12:34:45AM +0100, Uwe Stöhr wrote:
 Since a while now I use Qt 4.3 to compile LyX with success. But when I 
 check in modifiactions to .ui-files, they cannot be compiled by those who 
 use Qt 4.2.

 I looked at the announcement files of Qt 4.3 but couldn't find a hint that 
 Qt 4.3's ui format is different, so what can be the problem?

It is different.

Unfortunately if I might add.

 I'm not able to use Qt 4.2's designer when the rest is Qt 4.3, because 
 designer checks for the system-wide Qt setting. As this is Qt 4.3 Qt 
 4.2's designer complained about this and don't start. When I change Qt 
 system config to Qt 4.2 designer starts, but I can then not compile LyX 
 using Qt 4.3.

Hm?

There is usually no problem to use designer/moc/whatever from different
Qt versions. Just run the binary, no need to change system
configurations.

 Any ideas, or have you perhaps read something about .ui-file format changes 
 in Qt 4.2? In case there was something changed in the format, I wonder that 
 Qt 4.3's designer don't have an export function to produce Qt 4.2's .ui 
 format.

I can even tell you the reason: Lack of manpower and the assumption that
it won't be much of a problem. People are now aware that it _is_ a
problem, though.

Andre'


poking around

2007-10-30 Thread Andre Poenitz

I wonder how much resistance the (re- ;-)) introduction of a
'real' lyx string class would meet.

Could be as simple as a struct wrapping a std::stringwhatever
and delegating all of the work to std::string.

The main advantages would be 'declarability' (i.e.  class DocString;
would suffice in lots of places where we have #include docstring.h
(and consequently string) nowadays), and the possibility of having
convenience functions (i.e. stuff from lstring, but also things like
'ends_with()' or such in the class.

There should be no performance penalty as all the delegation would
quite probably be inlined, i.e. the ninary might be even identical.

The main problem I see is that some people will not be happy for
political rather than technical reasons.

Andre'


Re: about the Qt 4.3 designer format problem

2007-10-30 Thread Uwe Stöhr

Andre Poenitz schrieb:


It is different.


Why was this not announced, then?


There is usually no problem to use designer/moc/whatever from different
Qt versions. Just run the binary, no need to change system
configurations.


When I ty to run the binary I get an error message that the Qt configuration is 
incorrect.
Could you send me a Qt 4.2 designer.exe for Windows to test? The Qt 4.2 I have 
was build
by Bo or Joost using MinGW (I think). I compiled Qt 4.3 by myself using MSVC.

regards Uwe


Re: [patch] Putting ForceLTR to use

2007-10-30 Thread Richard Heck

Some silly comments.

+   /// is this inset based on the CollapsableInset class?
+   virtual InsetCollapsable * asCollapsableInset() { return 0; }
+   /// is this inset based on the CollapsableInset class?
+   virtual InsetCollapsable const * asCollapsableInset() const { return 0; 
}
  

Probably should be asInsetCollapsable().

+   ///
+   InsetCollapsable * asCollapsableInset() { return this; }
+   ///
+   InsetCollapsable const * asCollapsableInset() const { return this; }
  

and similarly.

rh


Re: [patch] Putting ForceLTR to use

2007-10-30 Thread Martin Vermeer
On Wed, Oct 31, 2007 at 01:03:16AM +0200, Dov Feldstern wrote:
 Hi!
 
 Martin --- thanks for all your work towards the ForceLTR option!
 
 The attached patch uses this option in order to make sure that insets 
 which define this option are put in an LTR environment if they are in 
 RTL surroundings (which is why I originally asked for this option).
 
 To this end, I also define two new functions:
 
 1) An accessor method InsetCollapsable::ForceLTR
 2) The virtual Inset::asCollapsableInset for identifying insets which 
 are (or inherit from) Collapsable. (Similar to asTextInset, asMathInset).
 
 Please look this over, I will commit in the next few days if there are 
 no objections.
 
 Dov

 diff -r 14ceb06dbd35 src/Paragraph.cpp
 --- a/src/Paragraph.cpp   Wed Oct 31 00:15:34 2007 +0200
 +++ b/src/Paragraph.cpp   Wed Oct 31 00:40:23 2007 +0200
 @@ -718,7 +718,11 @@ void Paragraph::Private::latexInset(Buff
  
   if ((inset-lyxCode() == GRAPHICS_CODE
|| inset-lyxCode() == MATH_CODE
 -  || inset-lyxCode() == HYPERLINK_CODE)
 +  || inset-lyxCode() == HYPERLINK_CODE
 +  || (inset-asCollapsableInset()
 +   inset-asCollapsableInset()-forceLTR()

Hmmm, I see the ERT calls its own version of resetParagraphsFont().  I
believe it can be removed so it uses the InsetCollapsable one. Saves a
few lines. (I think I planned on doing this, but forgot.)

 +  // ERT is an exception, since it doesn't go to output
 +   inset-lyxCode() != ERT_CODE))
running_font.isRightToLeft()) {
   if (running_font.language()-lang() == farsi)
   os  \\beginL{};

- Martin


Re: rhetorical question of the day

2007-10-30 Thread Abdelrazak Younes

Andre Poenitz wrote:

What's the reason of defining and throwing, but never catching
some exception?


IIRC, I've put some code in the Qt event loop to catch everything that 
was not caught before.




Andre'

PS: Hint: It's 60k extra compilation...


What? The inheritance of std::bad_cast? Would it help if we just inherit 
std::exception?


Also, I guess this class can be made private.

Abdel.



Re: current_font bug; char panel dead

2007-10-30 Thread Abdelrazak Younes

Andre Poenitz wrote:

On Mon, Oct 29, 2007 at 06:20:40PM +0100, Abdelrazak Younes wrote:

BTW has anyone else noticed that the character panel (text Style ->
Customized) doesn't do anything anymore? Setting emph by ctrl-e
works fine, but from the panel it does nothing.

I guess nobody touched it after Andre' big GUII overhaul...


Looks like the panel is ok. But the a certain 'you...' broke with
21240 the stringification of font settings ;-)


Oups, sorry... Cut bug...



[Otoh just a sign that passing everything by string is fragile...]


Right.

Thanks,
Abdel.



Re: Integration of my dynmacro patch

2007-10-30 Thread Abdelrazak Younes

Stefan Schimanski wrote:

Hi!

As a long weekend is approaching here I think it would be a good time to 
start the integration of my dynamic macros into trunk. I think my patch 
is in a reasonable state right now that it makes sense to commit it.


Yes, much better except for MathData::attachMacroParameters() which is 
way too big IMHO (but this shouldn't stop you to commit if you promise 
to cut it down afterwards).


One bit:

+   for (; dit; dit.forwardPos()) {
...
+   Inset * inset = dit.nextInset();
+   if (inset) {
+   InsetMath * insetMath = inset->asInsetMath();
+   if (insetMath) {

This is the same as:

+   for (; dit; dit.forwardPos()) {
...
+   Inset * inset = dit.nextInset();
+   if (!inset)
+   continue;   
+   InsetMath * insetMath = inset->asInsetMath();
+   if (insetMath) {



Re: Integration of my dynmacro patch

2007-10-30 Thread Abdelrazak Younes

Stefan Schimanski wrote:

Hi!

As a long weekend is approaching here I think it would be a good time to 
start the integration of my dynamic macros into trunk. I think my patch 
is in a reasonable state right now that it makes sense to commit it.


I was testing the dynamic macros for two weeks in real life to prepare 
exercise sheets and solutions for a lecture, with heavy use of macros to 
build proof trees. Everything was stable and usable. So I have 
confidence that it will be fine when committed now.


I would like to start with the integration on Thursday morning and would 
be available the whole day to fix issues (if anything comes up).


Looks like a good plan :-)

Abdel.



Re: Integration of my dynmacro patch

2007-10-30 Thread Stefan Schimanski


Am 30.10.2007 um 08:45 schrieb Abdelrazak Younes:


Stefan Schimanski wrote:

Hi!
As a long weekend is approaching here I think it would be a good  
time to start the integration of my dynamic macros into trunk. I  
think my patch is in a reasonable state right now that it makes  
sense to commit it.


Yes, much better except for MathData::attachMacroParameters() which  
is way too big IMHO (but this shouldn't stop you to commit if you  
promise to cut it down afterwards).


Will take another look. Was already happy to be able to split it like  
that. Had expected that the code parts are more interrelated in fact.


Stefan


PGP.sig
Description: Signierter Teil der Nachricht


Re: Integration of my dynmacro patch

2007-10-30 Thread Stefan Schimanski


Am 30.10.2007 um 00:44 schrieb Uwe Stöhr:


Stefan Schimanski schrieb:


@Uwe: Will you take care of the format changes?
> I guess the lyx2lyx extension should come before the commit of my  
patch?


I'm currently limited in my spare time, so I cannot promise to take  
care a certain day. For me it would be the best when you commit  
your stuff, including a fileformat change with empty lyx2lyx  
routines. I can then add the lyx2lyx routines the next days when I  
find time.


Ok, will add them. Thanks for your help!




Did you see my documentation I posted some time ago?


No, but what you linked with your mail is excellent. Could you send  
me the LyX-file too?


Sure: http://1stein.org/download/dynmacro.lyx




Is it enough?


I think so. Are there macro definition example in the LyX-file of  
your docu?
I'll include your macro description to the math manual I'm  
currently writing.


I have many test cases here: http://1stein.org/download/testcases.lyx

Regards
  Stefan

PGP.sig
Description: Signierter Teil der Nachricht


Re: Patch: use ForceLtR etc, simplify code

2007-10-30 Thread Martin Vermeer
On Mon, 29 Oct 2007 18:42:45 +0200
Martin Vermeer <[EMAIL PROTECTED]> wrote:

> 
> Partly building on Abdel's work with fonts and language. This should
> help get Dov what he needs.
> 
> Tested it cursorily, should be OK. And found some bugs along the way ;-)
> 
> - Martin


Here is an improved version. The code base has been substantially cleaned
up. And now InsetListings is Collapsable-based!

If I don't hear objections, this goes in soon.

- Martin
Index: src/insets/InsetFlex.cpp
===
--- src/insets/InsetFlex.cpp	(revision 21258)
+++ src/insets/InsetFlex.cpp	(working copy)
@@ -95,56 +95,6 @@
 }
 
 
-void InsetFlex::metrics(MetricsInfo & mi, Dimension & dim) const
-{
-	FontInfo tmpfont = mi.base.font;
-	getDrawFont(mi.base.font);
-	mi.base.font.reduce(sane_font);
-	mi.base.font.realize(tmpfont);
-	InsetCollapsable::metrics(mi, dim);
-	mi.base.font = tmpfont;
-}
-
-
-void InsetFlex::draw(PainterInfo & pi, int x, int y) const
-{
-	FontInfo tmpfont = pi.base.font;
-	getDrawFont(pi.base.font);
-	// I don't understand why the above .reduce and .realize aren't
-	//needed, or even wanted, here. It just works. -- MV 10.04.2005
-	InsetCollapsable::draw(pi, x, y);
-	pi.base.font = tmpfont;
-}
-
-
-void InsetFlex::getDrawFont(FontInfo & font) const
-{
-	font = layout_.font;
-}
-
-
-void InsetFlex::doDispatch(Cursor & cur, FuncRequest & cmd)
-{
-	InsetCollapsable::doDispatch(cur, cmd);
-}
-
-
-bool InsetFlex::getStatus(Cursor & cur, FuncRequest const & cmd,
-	FuncStatus & status) const
-{
-	switch (cmd.action) {
-		// paragraph breaks not allowed in flex insets
-		case LFUN_BREAK_PARAGRAPH:
-		case LFUN_BREAK_PARAGRAPH_SKIP:
-			status.enabled(layout_.multipar);
-			return true;
-
-		default:
-			return InsetCollapsable::getStatus(cur, cmd, status);
-		}
-}
-
-
 int InsetFlex::plaintext(Buffer const & buf, odocstream & os,
 			  OutputParams const & runparams) const
 {
Index: src/insets/InsetERT.h
===
--- src/insets/InsetERT.h	(revision 21258)
+++ src/insets/InsetERT.h	(working copy)
@@ -48,8 +48,6 @@
 	///
 	void write(Buffer const & buf, std::ostream & os) const;
 	///
-	void read(Buffer const & buf, Lexer & lex);
-	///
 	virtual docstring const editMessage() const;
 	///
 	bool insetAllowed(InsetCode code) const;
@@ -71,8 +69,6 @@
 	///
 	bool showInsetDialog(BufferView *) const;
 	///
-	void getDrawFont(FontInfo &) const;
-	///
 	bool forceDefaultParagraphs(idx_type) const { return true; }
 	/// should paragraph indendation be ommitted in any case?
 	bool neverIndent(Buffer const &) const { return true; }
@@ -84,6 +80,8 @@
 	bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
 	///
 	void resetParagraphsFont();
+	///
+	void getDrawFont(FontInfo &) const;
 
 private:
 	virtual Inset * clone() const;
Index: src/insets/InsetERT.cpp
===
--- src/insets/InsetERT.cpp	(revision 21258)
+++ src/insets/InsetERT.cpp	(working copy)
@@ -121,21 +121,6 @@
 }
 
 
-void InsetERT::read(Buffer const & buf, Lexer & lex)
-{
-	InsetCollapsable::read(buf, lex);
-
-	// Force default font
-	// This avoids paragraphs in buffer language that would have a
-	// foreign language after a document langauge change, and it ensures
-	// that all new text in ERT gets the "latex" language, since new text
-	// inherits the language from the last position of the existing text.
-	// As a side effect this makes us also robust against bugs in LyX
-	// that might lead to font changes in ERT in .lyx files.
-	resetParagraphsFont();
-}
-
-
 docstring const InsetERT::editMessage() const
 {
 	return _("Opened ERT Inset");
@@ -208,19 +193,6 @@
 		setStatus(cur, st);
 		break;
 	}
-	case LFUN_PASTE:
-	case LFUN_CLIPBOARD_PASTE:
-	case LFUN_PRIMARY_SELECTION_PASTE: {
-		InsetCollapsable::doDispatch(cur, cmd);
-
-		// Since we can only store plain text, we must reset all
-		// attributes.
-		// FIXME: Change only the pasted paragraphs
-
-		// ERT contents has always latex_language
-		resetParagraphsFont();
-		break;
-	}
 	default:
 		// Force any new text to latex_language
 		// FIXME: This should only be necessary in init(), but
@@ -230,8 +202,6 @@
 		// approach.
 		cur.current_font.fontInfo() = layout->font;
 		cur.real_current_font.fontInfo() = layout->font;
-		cur.current_font.setLanguage(latex_language);
-		cur.real_current_font.setLanguage(latex_language);
 		InsetCollapsable::doDispatch(cur, cmd);
 		break;
 	}
Index: src/insets/InsetListings.h
===
--- src/insets/InsetListings.h	(revision 21258)
+++ src/insets/InsetListings.h	(working copy)
@@ -24,7 +24,7 @@
  */
 
 
-class InsetListings : public InsetERT {
+class InsetListings : public InsetCollapsable {
 public:
 	///
 	InsetListings(BufferParams const &, InsetListingsParams const & par = InsetListingsParams());
@@ -49,14 

[patch] bug 3999: Find dialog text is not selected

2007-10-30 Thread Jürgen Spitzmüller
http://bugzilla.lyx.org/show_bug.cgi?id=3999

The attached patch (against branch) finally fixes this issue. I don't see an 
alternative to implementing update_contents().

Objections?

Jürgen
Index: src/frontends/qt4/QSearch.h
===
--- src/frontends/qt4/QSearch.h	(Revision 21284)
+++ src/frontends/qt4/QSearch.h	(Arbeitskopie)
@@ -30,7 +30,6 @@
 public:
 	QSearchDialog(QSearch * form);
 
-	virtual void show();
 protected Q_SLOTS:
 	void findChanged();
 	void findClicked();
@@ -59,7 +58,7 @@
 	/// Apply changes
 	virtual void apply() {}
 	/// update
-	virtual void update_contents() {}
+	virtual void update_contents();
 	/// build the dialog
 	virtual void build_dialog();
 
Index: src/frontends/qt4/QSearch.cpp
===
--- src/frontends/qt4/QSearch.cpp	(Revision 21284)
+++ src/frontends/qt4/QSearch.cpp	(Arbeitskopie)
@@ -50,23 +50,16 @@
 	setupUi(this);
 
 	connect(closePB, SIGNAL(clicked()), form_, SLOT(slotClose()));
-  connect(findPB, SIGNAL(clicked()), this, SLOT(findClicked()));
-  connect(replacePB, SIGNAL(clicked()), this, SLOT(replaceClicked()));
-  connect(replaceallPB, SIGNAL(clicked()), this, SLOT(replaceallClicked()));
-  connect(findCO, SIGNAL(editTextChanged(const QString &)),
+	connect(findPB, SIGNAL(clicked()), this, SLOT(findClicked()));
+	connect(replacePB, SIGNAL(clicked()), this, SLOT(replaceClicked()));
+	connect(replaceallPB, SIGNAL(clicked()), this, SLOT(replaceallClicked()));
+	connect(findCO, SIGNAL(editTextChanged(const QString &)),
 		this, SLOT(findChanged()));
 
 	setFocusProxy(findCO);
 }
 
 
-void QSearchDialog::show()
-{
-	QDialog::show();
-	findCO->lineEdit()->setSelection(0, findCO->lineEdit()->text().length());
-}
-
-
 void QSearchDialog::closeEvent(QCloseEvent * e)
 {
 	form_->slotWMHide();
@@ -96,7 +89,6 @@
 		wordsCB->isChecked(),
 		backwardsCB->isChecked());
 	uniqueInsert(findCO, findCO->currentText());
-	findCO->lineEdit()->setSelection(0, findCO->lineEdit()->text().length());
 }
 
 
@@ -155,6 +147,12 @@
 }
 
 
+void QSearch::update_contents()
+{
+	dialog_->findCO->lineEdit()->selectAll();
+}
+
+
 void QSearch::find(docstring const & str, bool casesens,
 		   bool words, bool backwards)
 {


1.6svn pasting text from other apps have been broken for a while

2007-10-30 Thread Helge Hafting

The common way of copy+paste in linux is
to mark some text, and then middle-click where it
should go.

This has been broken in 1.6svn for some time.
The problem exists in a LyX compiled 17.october,
as well as today's LyX.

Such pasting will occationally work, but almost never.

Pasting within LyX is ok, but this means it is almost
impossible to bring in text from other editors or webpages.
The edit->paste menus fail the same way - nothing happens.

Also, 1.6svn seems useless in that latex now chokes on
simple things like URLs. Probably an effect of
ongoing development.  :-)

Helge Hafting


Re: 1.6svn pasting text from other apps have been broken for a while

2007-10-30 Thread Bo Peng
> This has been broken in 1.6svn for some time.
> The problem exists in a LyX compiled 17.october,
> as well as today's LyX.

I noticed this a while ago, and nobody claimed responsibility for breaking it.

Bo


Re: r21291 - in /lyx-devel/trunk/src/frontends/qt4: GuiKeySym...

2007-10-30 Thread Bo Peng
On 10/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Author: bpeng
> Date: Tue Oct 30 17:04:48 2007
> New Revision: 21291
>
> URL: http://www.lyx.org/trac/changeset/21291
> Log:
> Fix the shortcut input dialog bug (can not input Ctrl-blah)

Problem: setKeySymbol sets QKeyEvent::text() as KeySymbol::text_. This
is wrong because C-A, C-B etc produce all sorts  of strange symbols.
(Run lyx -dbg key to see what I mean). When getSymbolName is called,
such strange symbols are picked up because Key_A etc are not handled
by qkey_to_string.

Solution: Add Qt::Key_A etc to qkey_to_string so that they can be
handled properly.

Remaining problems of the shortcut dialog:

1. JMarc does not like the GUI but his proposal is too complicated for
me to implement, and I do not see a clear advantage of his proposal.
As a compromise, I have stopped displaying the confusing 'unmatched
removed shortcut'.

2. Apply will actually Save the shortcuts. This is difficult to solve
because there is no way to apply (keep the state), and allow later
save. Because I strongly prefer the removal of the Apply button, I
will NOT fix this problem. If you think this is unacceptable, you can
stop applying new shortcuts and require a restart to make use of them,
as 1.5.x does.

Please test and report bugs.

Cheers,
Bo


Re: 1.6svn pasting text from other apps have been broken for a while

2007-10-30 Thread Martin Vermeer
On Tue, 30 Oct 2007 14:53:39 +0100
Helge Hafting <[EMAIL PROTECTED]> wrote:

...
 
> Also, 1.6svn seems useless in that latex now chokes on
> simple things like URLs. Probably an effect of
> ongoing development.  :-)
> 
> Helge Hafting

The attached should solve part of the problem. Going in.

- MartinIndex: output_latex.cpp
===
--- output_latex.cpp	(revision 21285)
+++ output_latex.cpp	(working copy)
@@ -254,15 +254,18 @@
 	LayoutPtr style;
 
 	if (runparams_in.verbatim) {
-		Font const outerfont =
-			outerFont(std::distance(paragraphs.begin(), pit),
-  paragraphs);
+		int dist = std::distance(paragraphs.begin(), pit);
+		Font const outerfont = outerFont(dist, paragraphs);
 
+		// No newline if only one paragraph in this lyxtext
+		if (dist > 0) {
+			os << '\n';
+			texrow.newline();
+		}
+
 		/*bool need_par = */ pit->latex(buf, bparams, outerfont,
 			os, texrow, runparams_in);
 
-		os << '\n';
-		texrow.newline();
 		return ++pit;
 	}
 


Re: Lyx 1.5.2-1 (Windows) crashes on creatin new file, worked in Lyx 1.4.4

2007-10-30 Thread Jürgen Spitzmüller
Ekkehart Schlicht wrote:
> It crashed again. I ran it with -dbg any and tried to pipe the output to
> a text file. This did not work. I cannot copy and paste the output from
> the debug window either. If you could make a suggestion how to capture
> the output without retyping it (it is quite large) I would be grateful.

If everything else fails, post a screenshot.

Jürgen


Re: Lyx 1.5.2-1 (Windows) crashes on creatin new file, worked in Lyx 1.4.4

2007-10-30 Thread Ekkehart Schlicht



It crashed again. I ran it with -dbg any and tried to pipe the output to 
a text file. This did not work. I cannot copy and paste the output from 
the debug window either. If you could make a suggestion how to capture 
the output without retyping it (it is quite large) I would be grateful.


Ekkehart


Jürgen Spitzmüller
Sat, 13 Oct 2007 06:39:50 -0700

Ekkehart Schlicht wrote:
> When issuing a "New File" command (from the Menu) or a "New File from
> Template", lyx crashes.

Can you post the output of "lyx -dbg any"?

Jürgen


[patch] bug 4147: Multiple cells paste as one in tables

2007-10-30 Thread Jürgen Spitzmüller
http://bugzilla.lyx.org/show_bug.cgi?id=4147

The bug is the result of an encoding failure (use of char instead of 
char_type) that results in an unwanted conversion of a tabulator ('\t') to 
the digit '9'.

I'll commit to branch and trunk on Friday if I get no objections.

Jürgen
Index: src/insets/InsetTabular.h
===
--- src/insets/InsetTabular.h	(Revision 21284)
+++ src/insets/InsetTabular.h	(Arbeitskopie)
@@ -357,7 +357,7 @@
 	///
 	void plaintext(Buffer const &, odocstream &,
 		   OutputParams const & runparams, int const depth,
-		   bool onlydata, unsigned char delim) const;
+		   bool onlydata, char_type delim) const;
 	///
 	bool isMultiColumn(idx_type cell) const;
 	///
Index: src/insets/InsetTabular.cpp
===
--- src/insets/InsetTabular.cpp	(Revision 21284)
+++ src/insets/InsetTabular.cpp	(Arbeitskopie)
@@ -2750,7 +2750,7 @@
 
 void Tabular::plaintext(Buffer const & buf, odocstream & os,
 			   OutputParams const & runparams, int const depth,
-			   bool onlydata, unsigned char delim) const
+			   bool onlydata, char_type delim) const
 {
 	// first calculate the width of the single columns
 	vector clen(columns_);


[patch] Bug 3586: Spell check doesn't update the screen display on the last of several mis-spelt words

2007-10-30 Thread Jürgen Spitzmüller
http://bugzilla.lyx.org/show_bug.cgi?id=3586

Missing update. Patch against branch attached (I haven't checked trunk yet, 
but it shouldn't differ).

I'll commit to branch and trunk on Friday if I get no objections.

Jürgen
Index: src/frontends/controllers/ControlSpellchecker.cpp
===
--- src/frontends/controllers/ControlSpellchecker.cpp	(Revision 21284)
+++ src/frontends/controllers/ControlSpellchecker.cpp	(Arbeitskopie)
@@ -219,6 +219,11 @@
 
 		// end of document
 		if (getWord().empty()) {
+			// FIXME: if we used a lfun like in find/replace, dispatch
+			// would do that for us
+			kernel().bufferview()->update();
+			// FIXME: this Controller is very badly designed...
+			kernel().lyxview().currentWorkArea()->redraw();
 			showSummary();
 			exitEarly_ = true;
 			return;


[patch] Bug 4090: Latex errors dialog closes upon double mouse-click

2007-10-30 Thread Jürgen Spitzmüller
http://bugzilla.lyx.org/show_bug.cgi?id=4090

I agree with the reporter that this behaviour is irritating, especially since 
the error dialog can not be easily reopened.

I'll commit the attached to branch and trunk on Friday if I get no objections.

Jürgen
Index: src/frontends/qt4/QErrorList.cpp
===
--- src/frontends/qt4/QErrorList.cpp	(Revision 21284)
+++ src/frontends/qt4/QErrorList.cpp	(Arbeitskopie)
@@ -36,8 +36,6 @@
 	setupUi(this);
 	connect(closePB, SIGNAL(clicked()),
 		form, SLOT(slotClose()));
-	connect(errorsLW, SIGNAL( itemActivated(QListWidgetItem *)),
-		form, SLOT(slotClose()));
 	connect( errorsLW, SIGNAL( itemClicked(QListWidgetItem *)),
 		this, SLOT(select_adaptor(QListWidgetItem *)));
 }


Re: Lyx 1.5.2-1 (Windows) crashes on creatin new file, worked in Lyx 1.4.4

2007-10-30 Thread Enrico Forestieri
On Tue, Oct 30, 2007 at 05:59:24PM +0100, Jürgen Spitzmüller wrote:
> Ekkehart Schlicht wrote:
> > It crashed again. I ran it with -dbg any and tried to pipe the output to
> > a text file. This did not work. I cannot copy and paste the output from
> > the debug window either. If you could make a suggestion how to capture
> > the output without retyping it (it is quite large) I would be grateful.
> 
> If everything else fails, post a screenshot.

I think the problem is that he has to redirect stderr. Ekkehart, have
you tried using the following command line?

lyxc.exe -dbg any 2> dbg.log

-- 
Enrico


Re: [patch] Bug 3586: Spell check doesn't update the screen display on the last of several mis-spelt words

2007-10-30 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
> (I haven't checked trunk yet,
> but it shouldn't differ).

Excpet from the fact that the spellchecker is completely broken in trunk :-(

Jürgen


Re: Patch: use ForceLtR etc, simplify code

2007-10-30 Thread Abdelrazak Younes

Martin Vermeer wrote:

On Mon, 29 Oct 2007 18:42:45 +0200
Martin Vermeer <[EMAIL PROTECTED]> wrote:


Partly building on Abdel's work with fonts and language. This should
help get Dov what he needs.

Tested it cursorily, should be OK. And found some bugs along the way ;-)

- Martin



Here is an improved version. The code base has been substantially cleaned
up. And now InsetListings is Collapsable-based!


Impressive code reduction!

Abdel.



Re: Lyx 1.5.2-1 (Windows) crashes on creatin new file, worked in Lyx 1.4.4

2007-10-30 Thread Martin Vermeer
On Tue, Oct 30, 2007 at 05:53:33PM +0100, Ekkehart Schlicht wrote:
> 
> 
> It crashed again. I ran it with -dbg any and tried to pipe the output to 
> a text file. This did not work. I cannot copy and paste the output from 
> the debug window either. If you could make a suggestion how to capture 
> the output without retyping it (it is quite large) I would be grateful.
> 
> Ekkehart
 
Depending on the shell, 2> file.txt might do it.

- Martin
 


Re: Smooth scrolling

2007-10-30 Thread Tommaso Cucinotta

Abdelrazak Younes ha scritto:

I've played with it a bit together with Tommaso (off-list).

Confirmed. I made an attempt of refactory of the overall logics,
completely getting rid of the par height estimates, replaced by
appropriate loops summing up heights. This of course
ended up in a perfectly smooth scrolling, also in cases of large
tables and pictures, but completely crazy cursor movements
that crashed LyX. I was keeping in memory the entire document
metrics, but Abdel warned me about memory usage, so I decided
to use a vector of heights, plus the current cache.
Unfortunately, I had to work in the last few weeks, so I couldn't
finish the job.
I think most other applications do some layouting in the background 
to get those height values. Has anybody tried to do the same with LyX?

In my idea, this would be the most usable thing: right after opening
a document, the scrollbar keeps adjusting for a few seconds. After
that moment, everything scrolls fine. If you resize horizontally, then
the process is repeated.
One could fill up the height cache in idle times for example after 
the document is loaded, maybe with some regulation to not stress the 
machine too much.
You don't really need a map. A vector of height for the outermost 
paragraphs should be enough. Initially the vector would be filled with 
nominal values. Each time a paragraph metrics is calculated, the 
nominal value will be replaced by the real height. We have to be 
careful to maintain the vector in line with the main paragraph list.

Infact.

   T.


Re: A wishlist for LyX

2007-10-30 Thread Tommaso Cucinotta

Richard Heck ha scritto:
do something like hold down control+shift and click on a label 
to insert a reference to that label at the current cursor position.

I'd like to suggest an alternative usage paradigm for this, conditioned to
the implementation of context-sensitive menus. The idea is:

1. right-click on a label, numbered equation or section/paragraph
2. select a menu entry "copy reference"
3. then simply paste wherever you want in the document, and you get
   a reference to the label.

So many times I have the label just a few lines above (because I just 
inserted
a table, picture, or formula), and I need to refer to it, but the 
process for doing
it is really boring (I wish I could even "drag" the label into a text 
position).


   T.


Re: [patch] Bug 3586: Spell check doesn't update the screen display on the last of several mis-spelt words

2007-10-30 Thread Uwe Stöhr

> Excpet from the fact that the spellchecker is completely broken in trunk :-(

This is btw. reported here:
http://wiki.lyx.org/Devel/RegressionListSVN

Uwe



SCons problem when compiling with version suffix

2007-10-30 Thread Uwe Stöhr

When I start compiling LyX with the version suffix "16" using this command:

call scons install prefix=..\..\build-msvc use_vc=yes frontend=qt4 mode=release version_suffix=16 
gettext=system nls=yes extra_inc_path=..\..\lyx-windows-deps-msvc-qt4\include 
extra_lib_path=..\..\lyx-windows-deps-msvc-qt4\lib 
extra_bin_path=..\..\lyx-windows-deps-msvc-qt4\bin qt_dir=..\..\lyx-windows-deps-msvc-qt4\qt-4

cd ..\Win32\packaging

SCons still gives me this

-c install prefix=..\..\build-msvc use_vc=yes frontend=qt4 mode=release version_suffix=15 
gettext=system nls=yes


in scons_lyx.log Also when I start from scratch and delete the SCons cache, etc.

I'm not able to find where this wrong version sufix is set. What do I do wrong?

thanks and regards
Uwe


Repeatable crash with lyx 1.5.2.

2007-10-30 Thread Bo Peng
1. Create a new file, enter two lines of text and change the style of
the first line to section. ( a sample is attached).

2. select both lines, with mouse ending at the first line.

3. type something, the section title is changed

4. click on the second line, lyx crashes, with

Assertion triggered in const lyx::Font
lyx::Paragraph::getFontSettings(const lyx::BufferParams&,
lyx::pos_type) const by failing check "pos <= size()" in file
src/Paragraph.cpp:1317

(gdb) backtrace
#0  0x0037b322e25d in raise () from /lib64/tls/libc.so.6
#1  0x0037b322fa5e in abort () from /lib64/tls/libc.so.6
#2  0x00a8bc5d in lyx::support::abort () at src/support/abort.cpp:25
#3  0x00527f2c in boost::assertion_failed (
expr=0xb243d3 "pos <= size()",
function=0xb23f80 "const lyx::Font
lyx::Paragraph::getFontSettings(const lyx::BufferParams&,
lyx::pos_type) const", file=0xb24397 "src/Paragraph.cpp",
line=1317) at src/boost.cpp:56
#4  0x004aa1ad in lyx::Paragraph::getFontSettings (this=0x13d4e40,
[EMAIL PROTECTED], pos=1) at src/Paragraph.h:170
#5  0x00556211 in lyx::Bidi::computeTables (this=0x7fbfffdf00,
[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]) at src/Bidi.cpp:111
#6  0x0066c8d2 in lyx::TextMetrics::getColumnNearX (this=0x1400c28,
pit=Variable "pit" is not available.
) at src/TextMetrics.cpp:820
#7  0x006679a1 in lyx::Text::editXY (this=0x1404198,
[EMAIL PROTECTED], x=41, y=108) at src/Text2.cpp:908
#8  0x005aae6b in lyx::BufferView::workAreaDispatch (this=0x10d6a00,
cmd0=Variable "cmd0" is not available.
) at src/BufferView.cpp:1229


temp.lyx
Description: application/lyx


Re: SCons problem when compiling with version suffix

2007-10-30 Thread Bo Peng
On 10/30/07, Uwe Stöhr <[EMAIL PROTECTED]> wrote:
> When I start compiling LyX with the version suffix "16" using this command:
>
> call scons install prefix=..\..\build-msvc use_vc=yes frontend=qt4 
> mode=release version_suffix=16
> gettext=system nls=yes extra_inc_path=..\..\lyx-windows-deps-msvc-qt4\include
> extra_lib_path=..\..\lyx-windows-deps-msvc-qt4\lib
> extra_bin_path=..\..\lyx-windows-deps-msvc-qt4\bin 
> qt_dir=..\..\lyx-windows-deps-msvc-qt4\qt-4
> cd ..\Win32\packaging

Is this in a batch file?

> SCons still gives me this
>
> -c install prefix=..\..\build-msvc use_vc=yes frontend=qt4 mode=release 
> version_suffix=15
> gettext=system nls=yes
>
> in scons_lyx.log Also when I start from scratch and delete the SCons cache, 
> etc.

opt.cache will cache a few options, and when you override with
version_suffix=16, value 15 will not be used. I can not imagine where
this version_suffix=15 sneaks in. Maybe you can search the directory
for string 15?

Bo


Re: SCons problem when compiling with version suffix

2007-10-30 Thread Uwe Stöhr

Bo Peng schrieb:


Is this in a batch file?


Yes.


SCons still gives me this

-c install prefix=..\..\build-msvc use_vc=yes frontend=qt4 mode=release 
version_suffix=15
gettext=system nls=yes

in scons_lyx.log Also when I start from scratch and delete the SCons cache, etc.


opt.cache will cache a few options, and when you override with
version_suffix=16, value 15 will not be used. I can not imagine where
this version_suffix=15 sneaks in. Maybe you can search the directory
for string 15?


I searched for this but can't find it.

I deleted the folders

".sconf_temp" and "release"

and the files
config.log, config_lyx.log, opt.cache, and .sconsign.dblite
to assure that I start from scratch.

When I now execute the command from the batch file, SCons uses "15" as version suffix and 
not "16".

regards Uwe


Re: SCons problem when compiling with version suffix

2007-10-30 Thread Bo Peng
> When I now execute the command from the batch file, SCons uses "15" as 
> version suffix and not "16".

The third line of scons_lyx.log lists the command used, which is
simply what it gets from command line. If you get 15 over there, I
have no clue what is goine on.

Bo


Re: SCons problem when compiling with version suffix

2007-10-30 Thread Uwe Stöhr

Bo Peng schrieb:


The third line of scons_lyx.log lists the command used, which is
simply what it gets from command line. If you get 15 over there, I
have no clue what is goine on.


I found now the reason: My script started unwanted the script that is in
\development\Win32\packaging
and used the suffix 15. I fixed this now in SVN.

thanks for your help and regards
Uwe


fix LFUN_LANGUAGE bug, due to Font/Language separation

2007-10-30 Thread Dov Feldstern

Hi!

I committed a fix to a bug due to the Font/Language separation, which 
was causing LFUN_LANGUAGE to not work 
(http://www.lyx.org/trac/changeset/21305).


This solution may be a bit of a hack --- I'm not familiar enough with 
the bigger picture. Perhaps a better solution would be to further 
separate between Font and Language, by changing toggleFree to deal with 
them in a totally separate manner, or even to have separate functions 
for the language and font. If anyone feels like looking into this, feel 
free.


Dov


[patch] Putting ForceLTR to use

2007-10-30 Thread Dov Feldstern

Hi!

Martin --- thanks for all your work towards the ForceLTR option!

The attached patch uses this option in order to make sure that insets 
which define this option are put in an LTR environment if they are in 
RTL surroundings (which is why I originally asked for this option).


To this end, I also define two new functions:

1) An accessor method InsetCollapsable::ForceLTR
2) The virtual Inset::asCollapsableInset for identifying insets which 
are (or inherit from) Collapsable. (Similar to asTextInset, asMathInset).


Please look this over, I will commit in the next few days if there are 
no objections.


Dov
diff -r 14ceb06dbd35 src/Paragraph.cpp
--- a/src/Paragraph.cpp Wed Oct 31 00:15:34 2007 +0200
+++ b/src/Paragraph.cpp Wed Oct 31 00:40:23 2007 +0200
@@ -718,7 +718,11 @@ void Paragraph::Private::latexInset(Buff
 
if ((inset->lyxCode() == GRAPHICS_CODE
 || inset->lyxCode() == MATH_CODE
-|| inset->lyxCode() == HYPERLINK_CODE)
+|| inset->lyxCode() == HYPERLINK_CODE
+|| (inset->asCollapsableInset()
+&& inset->asCollapsableInset()->forceLTR()
+// ERT is an exception, since it doesn't go to output
+&& inset->lyxCode() != ERT_CODE))
&& running_font.isRightToLeft()) {
if (running_font.language()->lang() == "farsi")
os << "\\beginL{}";
diff -r 14ceb06dbd35 src/insets/Inset.h
--- a/src/insets/Inset.hWed Oct 31 00:15:34 2007 +0200
+++ b/src/insets/Inset.hWed Oct 31 00:40:23 2007 +0200
@@ -36,6 +36,7 @@ class CursorSlice;
 class CursorSlice;
 class FuncRequest;
 class FuncStatus;
+class InsetCollapsable;
 class InsetIterator;
 class InsetLayout;
 class InsetList;
@@ -90,7 +91,11 @@ public:
virtual InsetText * asTextInset() { return 0; }
/// is this inset based on the TextInset class?
virtual InsetText const * asTextInset() const { return 0; }
-   
+   /// is this inset based on the CollapsableInset class?
+   virtual InsetCollapsable * asCollapsableInset() { return 0; }
+   /// is this inset based on the CollapsableInset class?
+   virtual InsetCollapsable const * asCollapsableInset() const { return 0; 
}
+
/// the real dispatcher
void dispatch(Cursor & cur, FuncRequest & cmd);
/**
diff -r 14ceb06dbd35 src/insets/InsetCollapsable.h
--- a/src/insets/InsetCollapsable.h Wed Oct 31 00:15:34 2007 +0200
+++ b/src/insets/InsetCollapsable.h Wed Oct 31 00:40:23 2007 +0200
@@ -132,6 +132,11 @@ public:
///
virtual ColorCode backgroundColor() const {return layout_.bgcolor; }
 
+   ///
+   InsetCollapsable * asCollapsableInset() { return this; }
+   ///
+   InsetCollapsable const * asCollapsableInset() const { return this; }
+
int latex(Buffer const &, odocstream &,
  OutputParams const &) const;
///
@@ -143,6 +148,8 @@ public:
virtual bool isFreeSpacing() const { return layout_.freespacing; }
/// Don't eliminate empty paragraphs
virtual bool allowEmpty() const { return layout_.keepempty; }
+   /// Force inset into LTR environment if surroundings are RTL
+   virtual bool forceLTR() const { return layout_.forceltr; }
 
 protected:
///


ignore_language

2007-10-30 Thread Dov Feldstern

Hi!

A few days ago we were wondering about what exactly "ignore_language" 
is, and I just ran into a use of it in the code so that I now think I 
know what it is: it's used to represent a "neutral" language, i.e., when 
providing a font-change mask, ignore_language is used to signify that 
the language should not be changed. (The truth is, I'm not sure why we 
need it, because it seems like 0 (null) is also used for this purpose, 
and that's probably good enough.)


If this sounds right, we should probably add a comment explaining this 
where ignore_language is defined in the sources.


Dov


warnings in Paragraph.cpp

2007-10-30 Thread Dov Feldstern

Hi!

There are a few warnings in Paragraph.cpp, if anyone cares to take a look:

Paragraph.cpp: In member function 'void 
lyx::Paragraph::Private::insertChar(lyx::pos_type, lyx::char_type, const 
lyx::Change&)':
Paragraph.cpp:415: warning: comparison between signed and unsigned 
integer expressions

Paragraph.cpp: At global scope:
Paragraph.cpp:577: warning: unused parameter 'c'
Paragraph.cpp: In member function 'void 
lyx::Paragraph::appendString(const lyx::docstring&, const lyx::Font&, 
const lyx::Change&)':
Paragraph.cpp:1232: warning: comparison between signed and unsigned 
integer expressions


Thanks!
Dov


Re: [patch] bug 4147: Multiple cells paste as one in tables

2007-10-30 Thread Enrico Forestieri
On Tue, Oct 30, 2007 at 06:26:45PM +0100, Jürgen Spitzmüller wrote:
> http://bugzilla.lyx.org/show_bug.cgi?id=4147
> 
> The bug is the result of an encoding failure (use of char instead of 
> char_type) that results in an unwanted conversion of a tabulator ('\t') to 
> the digit '9'.
> 
> I'll commit to branch and trunk on Friday if I get no objections.

This is not going to work on systems where sizeof(wchar_t) == 2.
I have attached a better fix to bug 4147 on bugzilla.

-- 
Enrico


about the Qt 4.3 designer format problem

2007-10-30 Thread Uwe Stöhr
Since a while now I use Qt 4.3 to compile LyX with success. But when I check in modifiactions to 
.ui-files, they cannot be compiled by those who use Qt 4.2.


I looked at the announcement files of Qt 4.3 but couldn't find a hint that Qt 4.3's ui format is 
different, so what can be the problem?


I'm not able to use Qt 4.2's designer when the rest is Qt 4.3, because designer checks for the 
system-wide Qt setting. As this is "Qt 4.3" Qt 4.2's designer complained about this and don't start. 
When I change Qt system config to "Qt 4.2" designer starts, but I can then not compile LyX using Qt 4.3.


Any ideas, or have you perhaps read something about .ui-file format changes in Qt 4.2? In case there 
was something changed in the format, I wonder that Qt 4.3's designer don't have an export function 
to produce Qt 4.2's .ui format.


regards Uwe


Re: about the Qt 4.3 designer format problem

2007-10-30 Thread Andre Poenitz
On Wed, Oct 31, 2007 at 12:34:45AM +0100, Uwe Stöhr wrote:
> Since a while now I use Qt 4.3 to compile LyX with success. But when I 
> check in modifiactions to .ui-files, they cannot be compiled by those who 
> use Qt 4.2.
>
> I looked at the announcement files of Qt 4.3 but couldn't find a hint that 
> Qt 4.3's ui format is different, so what can be the problem?

It is different.

Unfortunately if I might add.

> I'm not able to use Qt 4.2's designer when the rest is Qt 4.3, because 
> designer checks for the system-wide Qt setting. As this is "Qt 4.3" Qt 
> 4.2's designer complained about this and don't start. When I change Qt 
> system config to "Qt 4.2" designer starts, but I can then not compile LyX 
> using Qt 4.3.

Hm?

There is usually no problem to use designer/moc/whatever from different
Qt versions. Just run the binary, no need to change "system
configurations".

> Any ideas, or have you perhaps read something about .ui-file format changes 
> in Qt 4.2? In case there was something changed in the format, I wonder that 
> Qt 4.3's designer don't have an export function to produce Qt 4.2's .ui 
> format.

I can even tell you the reason: Lack of manpower and the assumption that
it won't be much of a problem. People are now aware that it _is_ a
problem, though.

Andre'


poking around

2007-10-30 Thread Andre Poenitz

I wonder how much resistance the (re- ;-)) introduction of a
'real' lyx string class would meet.

Could be as simple as a struct wrapping a std::string
and delegating all of the work to std::string.

The main advantages would be 'declarability' (i.e.  class DocString;
would suffice in lots of places where we have #include "docstring.h"
(and consequently ) nowadays), and the possibility of having
convenience functions (i.e. stuff from lstring, but also things like
'ends_with()' or such in the class.

There should be no performance penalty as all the delegation would
quite probably be inlined, i.e. the ninary might be even identical.

The main problem I see is that some people will not be happy for
political rather than technical reasons.

Andre'


Re: about the Qt 4.3 designer format problem

2007-10-30 Thread Uwe Stöhr

Andre Poenitz schrieb:


It is different.


Why was this not announced, then?


There is usually no problem to use designer/moc/whatever from different
Qt versions. Just run the binary, no need to change "system
configurations".


When I ty to run the binary I get an error message that the Qt configuration is 
incorrect.
Could you send me a Qt 4.2 designer.exe for Windows to test? The Qt 4.2 I have 
was build
by Bo or Joost using MinGW (I think). I compiled Qt 4.3 by myself using MSVC.

regards Uwe


Re: [patch] Putting ForceLTR to use

2007-10-30 Thread Richard Heck

Some silly comments.

+   /// is this inset based on the CollapsableInset class?
+   virtual InsetCollapsable * asCollapsableInset() { return 0; }
+   /// is this inset based on the CollapsableInset class?
+   virtual InsetCollapsable const * asCollapsableInset() const { return 0; 
}
  

Probably should be asInsetCollapsable().

+   ///
+   InsetCollapsable * asCollapsableInset() { return this; }
+   ///
+   InsetCollapsable const * asCollapsableInset() const { return this; }
  

and similarly.

rh


Re: [patch] Putting ForceLTR to use

2007-10-30 Thread Martin Vermeer
On Wed, Oct 31, 2007 at 01:03:16AM +0200, Dov Feldstern wrote:
> Hi!
> 
> Martin --- thanks for all your work towards the ForceLTR option!
> 
> The attached patch uses this option in order to make sure that insets 
> which define this option are put in an LTR environment if they are in 
> RTL surroundings (which is why I originally asked for this option).
> 
> To this end, I also define two new functions:
> 
> 1) An accessor method InsetCollapsable::ForceLTR
> 2) The virtual Inset::asCollapsableInset for identifying insets which 
> are (or inherit from) Collapsable. (Similar to asTextInset, asMathInset).
> 
> Please look this over, I will commit in the next few days if there are 
> no objections.
> 
> Dov

> diff -r 14ceb06dbd35 src/Paragraph.cpp
> --- a/src/Paragraph.cpp   Wed Oct 31 00:15:34 2007 +0200
> +++ b/src/Paragraph.cpp   Wed Oct 31 00:40:23 2007 +0200
> @@ -718,7 +718,11 @@ void Paragraph::Private::latexInset(Buff
>  
>   if ((inset->lyxCode() == GRAPHICS_CODE
>|| inset->lyxCode() == MATH_CODE
> -  || inset->lyxCode() == HYPERLINK_CODE)
> +  || inset->lyxCode() == HYPERLINK_CODE
> +  || (inset->asCollapsableInset()
> +  && inset->asCollapsableInset()->forceLTR()

Hmmm, I see the ERT calls its own version of resetParagraphsFont().  I
believe it can be removed so it uses the InsetCollapsable one. Saves a
few lines. (I think I planned on doing this, but forgot.)

> +  // ERT is an exception, since it doesn't go to output
> +  && inset->lyxCode() != ERT_CODE))
>   && running_font.isRightToLeft()) {
>   if (running_font.language()->lang() == "farsi")
>   os << "\\beginL{}";

- Martin