Re: Font spacing issue again

2011-01-17 Thread Bernhard Roider
just an idea: the method QTextCharFormat::setFontKerning can enable/disable
kerning. Could that help?
bernhard


Re: Font spacing issue again

2011-01-17 Thread Bernhard Roider
just an idea: the method QTextCharFormat::setFontKerning can enable/disable
kerning. Could that help?
bernhard


Re: Question about hexToInt()

2010-12-22 Thread Bernhard Roider
But if you want to avoid the warning you can use an unsigned for scanf and
do a type cast to int


Re: Question about hexToInt()

2010-12-22 Thread Bernhard Roider
But if you want to avoid the warning you can use an unsigned for scanf and
do a type cast to int


Re: Question about hexToInt()

2010-12-21 Thread Bernhard Roider
Just a guess: Does unsignd int work with scanf?


Re: Question about hexToInt()

2010-12-21 Thread Bernhard Roider
Just a guess: Does unsignd int work with scanf?


Re: std::distance and RandomAccessList

2010-12-18 Thread Bernhard Roider
2010/12/18 Abdelrazak Younes you...@lyx.org

 On 18/12/2010 19:33, Jean-Marc Lasgouttes wrote:

 Le 18 déc. 2010 à 19:08, Abdelrazak Younes a écrit :

  On 18/12/2010 18:57, Jean-Marc Lasgouttes wrote:

 Le 18 déc. 2010 à 17:41, Abdelrazak Younes a écrit :

 What part of that could possibly go to branch?

 I guess introducing RandomListAccess::position() and using it will be
 enough.

 Why does this remove the quadratic behaviour?

 distance(it1, it2) = paragraphs.position(it2) - paragraphs.position(it1);

 But position() is linear, like std::distance().


 std::distance() advances the std::list iterator while
 RandomAccessList::position() look for the std::list iterator copies. The
 copies are in a vector so I assume this is faster.



  But as I said before, maybe the fix is as simple as this:
 -if (distance(lastpar, par)= distance(lastpar, endpar))
 +
 +if (par == endpar)
 break;

 I thought this broke source view.


 endpar is either paragraphs.end() or is given by the source view so it
 should work.

 Abdel.


Hello Abdel,

i didn't look into the code but following your arguments in this thread
there seems to be a problem:
- TeXOnePar may jump by more than one par
- endpar is either paragraphs.end() or is given by the source view

if this is true then the condition  par == endpar is wrong because your
earlier argument ... it can't go above paragraphs.end(), there's nothing
above doesn't hold because there can be something above endpar.

bernhard


Re: std::distance and RandomAccessList

2010-12-18 Thread Bernhard Roider
2010/12/18 Abdelrazak Younes 

> On 18/12/2010 19:33, Jean-Marc Lasgouttes wrote:
>
>> Le 18 déc. 2010 à 19:08, Abdelrazak Younes a écrit :
>>
>>  On 18/12/2010 18:57, Jean-Marc Lasgouttes wrote:
>>>
 Le 18 déc. 2010 à 17:41, Abdelrazak Younes a écrit :

> What part of that could possibly go to branch?
>>
> I guess introducing RandomListAccess::position() and using it will be
> enough.
>
 Why does this remove the quadratic behaviour?

>>> distance(it1, it2) = paragraphs.position(it2) - paragraphs.position(it1);
>>>
>> But position() is linear, like std::distance().
>>
>
> std::distance() advances the std::list iterator while
> RandomAccessList::position() look for the std::list iterator copies. The
> copies are in a vector so I assume this is faster.
>
>
>
>  But as I said before, maybe the fix is as simple as this:
>>> -if (distance(lastpar, par)>= distance(lastpar, endpar))
>>> +
>>> +if (par == endpar)
>>> break;
>>>
>> I thought this broke source view.
>>
>
> endpar is either paragraphs.end() or is given by the source view so it
> should work.
>
> Abdel.
>
>
Hello Abdel,

i didn't look into the code but following your arguments in this thread
there seems to be a problem:
- TeXOnePar may jump by more than one par
- endpar is either paragraphs.end() or is given by the source view

if this is true then the condition  par == endpar is wrong because your
earlier argument "... it can't go above paragraphs.end(), there's nothing
above" doesn't hold because there can be something above endpar.

bernhard


Re: Howto create a counter in LyX? Do we need an InsetCounter? Or an InsetTask?

2009-06-29 Thread Bernhard Roider

Pavel Sanda schrieb:

Bernhard Roider wrote:

Hello Abdel,

About a year ago i made a latex style + lyx layout file that do exactly 
what you want to create a change log table. I extracted the relevant parts 
and attached them together with a screen shot of lyx and the resulting pdf 
file.


bernhard


would you mind put it into wiki pages?
pavel



i will do, but i think i should comment it a little bit before ;-). 
Furthermore the layout should be better a module, but i didn'd use 
modules until now and must have a look at it.


bernhard



Re: Howto create a counter in LyX? Do we need an InsetCounter? Or an InsetTask?

2009-06-29 Thread Bernhard Roider

Pavel Sanda schrieb:

Bernhard Roider wrote:

Hello Abdel,

About a year ago i made a latex style + lyx layout file that do exactly 
what you want to create a change log table. I extracted the relevant parts 
and attached them together with a screen shot of lyx and the resulting pdf 
file.


bernhard


would you mind put it into wiki pages?
pavel



i will do, but i think i should comment it a little bit before ;-). 
Furthermore the layout should be better a module, but i didn'd use 
modules until now and must have a look at it.


bernhard



Re: Howto create a counter in LyX? Do we need an InsetCounter? Or an InsetTask?

2009-06-29 Thread Bernhard Roider

Pavel Sanda schrieb:

Bernhard Roider wrote:

Hello Abdel,

About a year ago i made a latex style + lyx layout file that do exactly 
what you want to create a change log table. I extracted the relevant parts 
and attached them together with a screen shot of lyx and the resulting pdf 
file.


bernhard


would you mind put it into wiki pages?
pavel



i will do, but i think i should comment it a little bit before ;-). 
Furthermore the layout should be better a module, but i didn'd use 
modules until now and must have a look at it.


bernhard



Re: Howto create a counter in LyX? Do we need an InsetCounter? Or an InsetTask?

2009-06-29 Thread Bernhard Roider

Pavel Sanda schrieb:

Bernhard Roider wrote:

Hello Abdel,

About a year ago i made a latex style + lyx layout file that do exactly 
what you want to create a change log table. I extracted the relevant parts 
and attached them together with a screen shot of lyx and the resulting pdf 
file.


bernhard


would you mind put it into wiki pages?
pavel



i will do, but i think i should comment it a little bit before ;-). 
Furthermore the layout should be better a module, but i didn'd use 
modules until now and must have a look at it.


bernhard



Re: r29342 - lyx-devel/trunk/src

2009-04-21 Thread Bernhard Roider

Jean-Marc Lasgouttes schrieb:

Yes, but what if I keep a reference to the temporary variable that gets 
returned? Does my reference point to neverland?


Yes it does. Or more precisely it points to somewhere on the stack because local variables in 
functions are allocated on the stack. When the function returns a reference (or a pointer) to such a 
variable then calling another function most likely overwrites the content of that variable.


e.g. try this one

#include iostream

struct T {
   int x;
};

struct U {
   char c1;
   char c2;
   char c3;
   char c4;
};

T Foo() {
   T t;
   t.x = 1;
   return t;
}

void Bar() {
   U u;
   u.c1 = 0x12;
   u.c2 = 0x34;
   u.c3 = 0x56;
   u.c4 = 0x78;
}

int main() {
   T const t = Foo();
   std::cout  std::hex  t.x  std::endl;
   Bar();
   std::cout  std::hex  t.x  std::endl;
   return 0;
}

Output is:
1
78563412


bernhard



Re: r29342 - lyx-devel/trunk/src

2009-04-21 Thread Bernhard Roider

Jean-Marc Lasgouttes schrieb:

Yes, but what if I keep a reference to the temporary variable that gets 
returned? Does my reference point to neverland?


Yes it does. Or more precisely it points to somewhere on the stack because local variables in 
functions are allocated on the stack. When the function returns a reference (or a pointer) to such a 
variable then calling another function most likely overwrites the content of that variable.


e.g. try this one

#include 

struct T {
   int x;
};

struct U {
   char c1;
   char c2;
   char c3;
   char c4;
};

T () {
   T t;
   t.x = 1;
   return t;
}

void Bar() {
   U u;
   u.c1 = 0x12;
   u.c2 = 0x34;
   u.c3 = 0x56;
   u.c4 = 0x78;
}

int main() {
   T const& t = Foo();
   std::cout << std::hex << t.x << std::endl;
   Bar();
   std::cout << std::hex << t.x << std::endl;
   return 0;
}

Output is:
1
78563412


bernhard



Re: r29342 - lyx-devel/trunk/src

2009-04-20 Thread Bernhard Roider

Abdelrazak Younes schrieb:

Jean-Marc Lasgouttes a écrit :

Le 20 avr. 09 à 00:25, Jean-Marc Lasgouttes a écrit :

Le 19 avr. 09 à 23:13, Abdelrazak Younes a écrit :
+docstring const fls = flattenLabelString(it-first, false, 
callers);

docstring const  ?


Indeed, thanks.


Now that I think of it, how come that we have lots of
  string const foo = bar();
expressions in the code? Adding a  seems to save a copy, but what 
does the compiler do

behind the scenes?


AFAIK the copying strings normally does not copy the data until the source or the destination string 
is changed. Thus copying strings is not that expensive an many cases.


This essentially depends on bar(). If bar() generates a new string, it 
should of course return a copy and you should not use a const ref. If 
bar() returns a reference or a const reference to an internal string, 
then you can save a copy by using a const ref too.


The compiler (at least some compilers) issue a warning for these cases. E.g.

struct T {
   int x;
};

const T Foo() {
   T t;
   t.x = 1;
   return t;
}
...

 g++ test.cc -o test
test.cc: In function »const T Foo()«:
test.cc:6: Warnung: Referenz auf lokale Variable »t« zurückgegeben

bernhard



Re: r29342 - lyx-devel/trunk/src

2009-04-20 Thread Bernhard Roider

Bernhard Roider schrieb:

Abdelrazak Younes schrieb:

Jean-Marc Lasgouttes a écrit :

Le 20 avr. 09 à 00:25, Jean-Marc Lasgouttes a écrit :

Le 19 avr. 09 à 23:13, Abdelrazak Younes a écrit :
+docstring const fls = flattenLabelString(it-first, 
false, callers);

docstring const  ?


Indeed, thanks.


Now that I think of it, how come that we have lots of
  string const foo = bar();
expressions in the code? Adding a  seems to save a copy, but what 
does the compiler do

behind the scenes?


AFAIK the copying strings normally does not copy the data until the 
source or the destination string is changed. Thus copying strings is not 
that expensive an many cases.


This essentially depends on bar(). If bar() generates a new string, it 
should of course return a copy and you should not use a const ref. If 
bar() returns a reference or a const reference to an internal string, 
then you can save a copy by using a const ref too.


The compiler (at least some compilers) issue a warning for these cases. 
E.g.


struct T {
   int x;
};

const T Foo() {
   T t;
   t.x = 1;
   return t;
}
...

  g++ test.cc -o test
test.cc: In function »const T Foo()«:
test.cc:6: Warnung: Referenz auf lokale Variable »t« zurückgegeben


Now that i think about your arguments again: that was not the problem here, but it is the answer for 
JMarc's question:


 OK, so all the changes were wrong. Now, how can I change my function
 signature to indicate that the return value is a temporary and that an
 address should not be kept? The compiler has this information, doesn't
 it?

A function may not return a reference to a local variable. You should at least 
get a warning.


bernhard






Re: r29342 - lyx-devel/trunk/src

2009-04-20 Thread Bernhard Roider

Abdelrazak Younes schrieb:

Jean-Marc Lasgouttes a écrit :

Le 20 avr. 09 à 00:25, Jean-Marc Lasgouttes a écrit :

Le 19 avr. 09 à 23:13, Abdelrazak Younes a écrit :
+docstring const fls = flattenLabelString(it->first, false, 
callers);

docstring const & ?


Indeed, thanks.


Now that I think of it, how come that we have lots of
  string const foo = bar();
expressions in the code? Adding a "&" seems to save a copy, but what 
does the compiler do

behind the scenes?


AFAIK the copying strings normally does not copy the data until the source or the destination string 
is changed. Thus copying strings is not that expensive an many cases.


This essentially depends on bar(). If bar() generates a new string, it 
should of course return a copy and you should not use a const ref. If 
bar() returns a reference or a const reference to an internal string, 
then you can save a copy by using a const ref too.


The compiler (at least some compilers) issue a warning for these cases. E.g.

struct T {
   int x;
};

const T () {
   T t;
   t.x = 1;
   return t;
}
...

> g++ test.cc -o test
test.cc: In function »const T& Foo()«:
test.cc:6: Warnung: Referenz auf lokale Variable »t« zurückgegeben

bernhard



Re: r29342 - lyx-devel/trunk/src

2009-04-20 Thread Bernhard Roider

Bernhard Roider schrieb:

Abdelrazak Younes schrieb:

Jean-Marc Lasgouttes a écrit :

Le 20 avr. 09 à 00:25, Jean-Marc Lasgouttes a écrit :

Le 19 avr. 09 à 23:13, Abdelrazak Younes a écrit :
+docstring const fls = flattenLabelString(it->first, 
false, callers);

docstring const & ?


Indeed, thanks.


Now that I think of it, how come that we have lots of
  string const foo = bar();
expressions in the code? Adding a "&" seems to save a copy, but what 
does the compiler do

behind the scenes?


AFAIK the copying strings normally does not copy the data until the 
source or the destination string is changed. Thus copying strings is not 
that expensive an many cases.


This essentially depends on bar(). If bar() generates a new string, it 
should of course return a copy and you should not use a const ref. If 
bar() returns a reference or a const reference to an internal string, 
then you can save a copy by using a const ref too.


The compiler (at least some compilers) issue a warning for these cases. 
E.g.


struct T {
   int x;
};

const T () {
   T t;
   t.x = 1;
   return t;
}
...

 > g++ test.cc -o test
test.cc: In function »const T& Foo()«:
test.cc:6: Warnung: Referenz auf lokale Variable »t« zurückgegeben


Now that i think about your arguments again: that was not the problem here, but it is the answer for 
JMarc's question:


> OK, so all the changes were wrong. Now, how can I change my function
> signature to indicate that the return value is a temporary and that an
> address should not be kept? The compiler has this information, doesn't
> it?

A function may not return a reference to a local variable. You should at least 
get a warning.


bernhard






Re: New bugs 5820 and 5821, Recursive Repaint

2009-02-28 Thread Bernhard Roider

Hi all,

it seems to me that this is a qt bug, the same as 
http://bugs.kde.org/show_bug.cgi?id=174065

bernhard



Vincent van Ravesteijn schrieb:

Hi All,

I would like you to point to these two critical bugs:
http://bugzilla.lyx.org/show_bug.cgi?id=5820
http://bugzilla.lyx.org/show_bug.cgi?id=5821

Vincent





Re: New bugs 5820 and 5821, Recursive Repaint

2009-02-28 Thread Bernhard Roider

Hi all,

it seems to me that this is a qt bug, the same as 
http://bugs.kde.org/show_bug.cgi?id=174065

bernhard



Vincent van Ravesteijn schrieb:

Hi All,

I would like you to point to these two critical bugs:
http://bugzilla.lyx.org/show_bug.cgi?id=5820
http://bugzilla.lyx.org/show_bug.cgi?id=5821

Vincent





Re: [Cvslog] r25118 - in /lyx-devel/trunk/src: frontends/qt4/GuiComple...

2008-06-04 Thread Bernhard Roider

[EMAIL PROTECTED] schrieb:

Author: dov
Date: Wed Jun  4 21:45:26 2008
New Revision: 25118

URL: http://www.lyx.org/trac/changeset/25118
Log:
fix completion painting for RTL (inline completion and completion list)

see http://permalink.gmane.org/gmane.editors.lyx.devel/107923 for an 
explanation, though note that this patch is more extensive than the one

attached there

  

Hello,

After this patch the following method can be removed:

void drawDisplay(QPainter * painter,
QStyleOptionViewItem const  option,
QRect const  rect, QString const  text) const
{
-   if (!enabled_) {
-   QItemDelegate::drawDisplay(painter, option, rect, text);
-   return;
-   }
-
-   // FIXME: do this more elegantly
-   docstring stltext = qstring_to_ucs4(text);
-   reverse(stltext.begin(), stltext.end());
-   QItemDelegate::drawDisplay(painter, option, rect, 
toqstr(stltext));
+   QItemDelegate::drawDisplay(painter, option, rect, text);
}
 

bernhard


Re: [Cvslog] r25118 - in /lyx-devel/trunk/src: frontends/qt4/GuiComple...

2008-06-04 Thread Bernhard Roider

[EMAIL PROTECTED] schrieb:

Author: dov
Date: Wed Jun  4 21:45:26 2008
New Revision: 25118

URL: http://www.lyx.org/trac/changeset/25118
Log:
fix completion painting for RTL (inline completion and completion list)

see http://permalink.gmane.org/gmane.editors.lyx.devel/107923 for an 
explanation, though note that this patch is more extensive than the one

attached there

  

Hello,

After this patch the following method can be removed:

void drawDisplay(QPainter * painter,
QStyleOptionViewItem const & option,
QRect const & rect, QString const & text) const
{
-   if (!enabled_) {
-   QItemDelegate::drawDisplay(painter, option, rect, text);
-   return;
-   }
-
-   // FIXME: do this more elegantly
-   docstring stltext = qstring_to_ucs4(text);
-   reverse(stltext.begin(), stltext.end());
-   QItemDelegate::drawDisplay(painter, option, rect, 
toqstr(stltext));
+   QItemDelegate::drawDisplay(painter, option, rect, text);
}
 

bernhard


Re: [Cvslog] r25108 - in /lyx-devel/trunk/src/frontends/qt4: GuiComple...

2008-06-03 Thread Bernhard Roider

[EMAIL PROTECTED] schrieb:

Author: broider
Date: Wed Jun  4 00:00:47 2008
New Revision: 25108

URL: http://www.lyx.org/trac/changeset/25108
Log:
Fix item delegate for qt 4.2:
In the completion-listbox rtl-Text does not work like it does for newer qt and 
icons are not displayed for math symbols.
The rtl handling is incorrect atm but now it works the same way for all 
versions of qt.
  

Dov, will you correct the rtl issue in the list box?

Thinking of it there is another issue/feature: ATM the completion list 
contains all words from the whole document. If the document is composed 
of different languages, then the words are mixed up in the list. Maybe 
it would be nice to associate the language to the word and
- Display only the words from the current language and, after a shortcut 
display all words OR

- Indicate the language for each entry OR
- group the entries by language in the list box
- When inserting a word from the completion list then change the 
language for the new inserted word to the associated one.


opinions?

bernhard



Re: [Cvslog] r25108 - in /lyx-devel/trunk/src/frontends/qt4: GuiComple...

2008-06-03 Thread Bernhard Roider

[EMAIL PROTECTED] schrieb:

Author: broider
Date: Wed Jun  4 00:00:47 2008
New Revision: 25108

URL: http://www.lyx.org/trac/changeset/25108
Log:
Fix item delegate for qt 4.2:
In the completion-listbox rtl-Text does not work like it does for newer qt and 
icons are not displayed for math symbols.
The rtl handling is incorrect atm but now it works the same way for all 
versions of qt.
  

Dov, will you correct the rtl issue in the list box?

Thinking of it there is another issue/feature: ATM the completion list 
contains all words from the whole document. If the document is composed 
of different languages, then the words are mixed up in the list. Maybe 
it would be nice to associate the language to the word and
- Display only the words from the current language and, after a shortcut 
display all words OR

- Indicate the language for each entry OR
- group the entries by language in the list box
- When inserting a word from the completion list then change the 
language for the new inserted word to the associated one.


opinions?

bernhard



Re: [PATCH] GuiCompeter problems with qt 4.2.x

2008-06-01 Thread Bernhard Roider

Dov Feldstern schrieb:

Bernhard Roider wrote:

Hello Stefan,

today i finally found some time to investigate the problem we 
discussed at the beginning of march concerning the completion list: 
rtl text does not work and icons are not displayed for math symbols.


Here is a patch that solves that issue for me using qt 4.2.3. There 
are two things that caused the problem:
1. QCompleter::setModel() changed the item delegates internally, so 
the specialized ones vanished

2. item delegates for columns are not used -- qt bug?

The attached patch solves both issues so that it works with my qt 
version. It should be tested for newer versions of qt.



...


bernhard



Hi!

What exactly is the problem with RTL completion that this patch is 
trying to solve? Can you separate out the part dealing with RTL from the 
rest of the patch?


Without your patch, I'm seeing (Linux, Qt 4.2.1) RTL completion behave 
correctly, except for the fact that the inline completion (the grayed 
out part) is reversed; the list of completions, though, behaves correctly.


With your patch applied, also the strings in the completions list are 
reversed.


Applying the attached (very complicated ;) ) patch *instead* of yours 
fixes the problem of the inlined strings, without adversely affecting 
the completions list.


I believe that what's happening is this: the completions list is 
presumably getting the strings in logical order (the way they're held 
in memory). When the strings are painted (both in the list and inlined), 
since they are being painted as an entire string at once (and not one 
character at a time, as we normally do with RTL text) Qt is applying its 
own bidi algorithm, and thus the strings are painted correctly, 
*provided* that the strings are really composed of true RTL characters 
(Qt does not know about our marking text as RTL, it only knows if text 
is RTL or not based on the unicode values). You guys were probably 
testing the RTL capabilities with Latin characters, so Qt was *not* 
reversing the strings, and thus the strings appeared to you to be 
painted backwards, which is why you were applying an extra reversal.


Your guess is correct. With my patch the completion list works for qt 4.2 as it does for higher 
versions, that is

1. display the icons for math symbols
2. reverse the strings in the list if they are rtl.


I'm not sure whether locale settings affect this or not, but I think 
that they don't, as long as there is a *legal* locale setting.


In summary, I think that the reversals should be removed, as in the 
attached patch. If most of Bernhard's patch is still relevant for 
non-RTL issues, then the RTL-specific issues should be removed from it, 
as well.


Stefan, will you take a look at this?

Bernhard


To be sure, this solution isn't perfect, because we're being 
inconsistent by letting Qt do some of the bidi work, and doing some of 
it ourselves; and this becomes visible precisely in the pathological 
cases where there's a difference between us and Qt, such as Latin text 
which we mark as RTL; but for normal RTL usage, I believe the reversals 
should *not* be done.


Dov





Re: [PATCH] GuiCompeter problems with qt 4.2.x

2008-06-01 Thread Bernhard Roider

Dov Feldstern schrieb:

Bernhard Roider wrote:

Hello Stefan,

today i finally found some time to investigate the problem we 
discussed at the beginning of march concerning the completion list: 
rtl text does not work and icons are not displayed for math symbols.


Here is a patch that solves that issue for me using qt 4.2.3. There 
are two things that caused the problem:
1. QCompleter::setModel() changed the item delegates internally, so 
the specialized ones vanished

2. item delegates for columns are not used --> qt bug?

The attached patch solves both issues so that it works with my qt 
version. It should be tested for newer versions of qt.



...


bernhard



Hi!

What exactly is the problem with RTL completion that this patch is 
trying to solve? Can you separate out the part dealing with RTL from the 
rest of the patch?


Without your patch, I'm seeing (Linux, Qt 4.2.1) RTL completion behave 
correctly, except for the fact that the inline completion (the grayed 
out part) is reversed; the list of completions, though, behaves correctly.


With your patch applied, also the strings in the completions list are 
reversed.


Applying the attached (very complicated ;) ) patch *instead* of yours 
fixes the problem of the inlined strings, without adversely affecting 
the completions list.


I believe that what's happening is this: the completions list is 
presumably getting the strings in "logical" order (the way they're held 
in memory). When the strings are painted (both in the list and inlined), 
since they are being painted as an entire string at once (and not one 
character at a time, as we normally do with RTL text) Qt is applying its 
own bidi algorithm, and thus the strings are painted correctly, 
*provided* that the strings are really composed of true RTL characters 
(Qt does not know about our marking text as RTL, it only knows if text 
is RTL or not based on the unicode values). You guys were probably 
testing the RTL capabilities with Latin characters, so Qt was *not* 
reversing the strings, and thus the strings appeared to you to be 
painted backwards, which is why you were applying an extra reversal.


Your guess is correct. With my patch the completion list works for qt 4.2 as it does for higher 
versions, that is

1. display the icons for math symbols
2. reverse the strings in the list if they are rtl.


I'm not sure whether locale settings affect this or not, but I think 
that they don't, as long as there is a *legal* locale setting.


In summary, I think that the reversals should be removed, as in the 
attached patch. If most of Bernhard's patch is still relevant for 
non-RTL issues, then the RTL-specific issues should be removed from it, 
as well.


Stefan, will you take a look at this?

Bernhard


To be sure, this solution isn't perfect, because we're being 
inconsistent by letting Qt do some of the bidi work, and doing some of 
it ourselves; and this becomes visible precisely in the pathological 
cases where there's a difference between us and Qt, such as Latin text 
which we mark as RTL; but for normal RTL usage, I believe the reversals 
should *not* be done.


Dov





Re: [PATCH] GuiCompeter problems with qt 4.2.x

2008-05-29 Thread Bernhard Roider
Hm. I am not aware of how to change the way attachment are sent. I use thunderbird and when add an 
attachment is not displayed inline. So i just try it again like i did before.


berhard

PS: As far as i remember this problem was discussed in the list some month ago, but i can't remember 
the solution nor can i find the thread.


Stefan Schimanski schrieb:

Hi!

Sorry for being unresponsive at the moment. Could you send the patch as 
a file attachment? Something between your and my mail program likes to 
corrupt the patch if it is sent as plain text in the mail.


Stefan

Am 28.05.2008 um 21:08 schrieb Bernhard Roider:


Hello all,

as Stefan seems to be not available since a few weeks: could somebody 
test this patch with newer qt versions (4.3, 4.4)? I have no 
capacities to upgrade my version atm.


thanks
Bernhard


Bernhard Roider schrieb:

Hello Stefan,
today i finally found some time to investigate the problem we 
discussed at the beginning of march concerning the completion list: 
rtl text does not work and icons are not displayed for math symbols.
Here is a patch that solves that issue for me using qt 4.2.3. There 
are two things that caused the problem:
1. QCompleter::setModel() changed the item delegates internally, so 
the specialized ones vanished

2. item delegates for columns are not used -- qt bug?
The attached patch solves both issues so that it works with my qt 
version. It should be tested for newer versions of qt.
Another issue: Here the destructor ~CompleterItemDelegate is never 
called. Do we have to delete it manually?

bernhard







Index: src/frontends/qt4/GuiCompleter.cpp
===
--- src/frontends/qt4/GuiCompleter.cpp  (revision 24807)
+++ src/frontends/qt4/GuiCompleter.cpp  (working copy)
@@ -43,13 +43,16 @@
 namespace lyx {
 namespace frontend {
 
-class RtlItemDelegate : public QItemDelegate
+class CompleterItemDelegate : public QItemDelegate
 {
 public:
-   explicit RtlItemDelegate(QObject * parent)
+   explicit CompleterItemDelegate(QObject * parent)
: QItemDelegate(parent), enabled_(false)
{}
 
+   ~CompleterItemDelegate()
+   {}
+
void setEnabled(bool enabled = true)
{
enabled_ = enabled;
@@ -70,23 +73,14 @@
reverse(stltext.begin(), stltext.end());
QItemDelegate::drawDisplay(painter, option, rect, 
toqstr(stltext));
}
-   
-private:
-   bool enabled_;
-};
 
-
-class PixmapItemDelegate : public QItemDelegate
-{
-public:
-   explicit PixmapItemDelegate(QObject * parent)
-   : QItemDelegate(parent)
-   {}
-
-protected:
void paint(QPainter *painter, const QStyleOptionViewItem option,
   const QModelIndex index) const
{
+   if (index.column() == 0) {
+   QItemDelegate::paint(painter, option, index);
+   return;
+   }
QStyleOptionViewItem opt = setOptions(index, option);
QVariant value = index.data(Qt::DisplayRole);
QPixmap pixmap = qvariant_castQPixmap(value);
@@ -103,9 +97,11 @@
drawFocus(painter, opt, option.rect);
painter-restore();
}
+
+private:
+   bool enabled_;
 };
 
-
 class GuiCompletionModel : public QAbstractListModel
 {
 public:
@@ -116,6 +112,12 @@
///
~GuiCompletionModel() { delete list_; }
///
+   void setList(CompletionList const * l) {
+   delete list_;
+   list_ = l;
+   reset();
+   }
+   ///
bool sorted() const
{
if (list_)
@@ -183,7 +185,8 @@
  modelActive_(false)
 {
// Setup the completion popup
-   setModel(new GuiCompletionModel(this, 0));
+   model_ = new GuiCompletionModel(this, 0);
+   setModel(model_);
setCompletionMode(QCompleter::PopupCompletion);
setWidget(gui_);

@@ -198,9 +201,8 @@
listView-setUniformRowHeights(true);
setPopup(listView);

-   rtlItemDelegate_ = new RtlItemDelegate(this);
-   popup()-setItemDelegateForColumn(0, rtlItemDelegate_);
-   popup()-setItemDelegateForColumn(1, new PixmapItemDelegate(this));
+   itemDelegate_ = new CompleterItemDelegate(this);
+   popup()-setItemDelegate(itemDelegate_);

// create timeout timers
popup_timer_.setSingleShot(true);
@@ -484,11 +486,11 @@
 
// turn the direction of the strings in the popup.
// Qt does not do that itself.
-   rtlItemDelegate_-setEnabled(rtl);
+   itemDelegate_-setEnabled(rtl);
 
// set new model
CompletionList const * list = cur.inset().createCompletionList(cur);
-   setModel(new GuiCompletionModel(this, list));
+   model_-setList(list);
modelActive_ = true;
if (list-sorted())
setModelSorting

Re: [PATCH] GuiCompeter problems with qt 4.2.x

2008-05-29 Thread Bernhard Roider
Hm. I am not aware of how to change the way attachment are sent. I use thunderbird and when add an 
attachment is not displayed inline. So i just try it again like i did before.


berhard

PS: As far as i remember this problem was discussed in the list some month ago, but i can't remember 
the solution nor can i find the thread.


Stefan Schimanski schrieb:

Hi!

Sorry for being unresponsive at the moment. Could you send the patch as 
a file attachment? Something between your and my mail program likes to 
corrupt the patch if it is sent as plain text in the mail.


Stefan

Am 28.05.2008 um 21:08 schrieb Bernhard Roider:


Hello all,

as Stefan seems to be not available since a few weeks: could somebody 
test this patch with newer qt versions (4.3, 4.4)? I have no 
capacities to upgrade my version atm.


thanks
Bernhard


Bernhard Roider schrieb:

Hello Stefan,
today i finally found some time to investigate the problem we 
discussed at the beginning of march concerning the completion list: 
rtl text does not work and icons are not displayed for math symbols.
Here is a patch that solves that issue for me using qt 4.2.3. There 
are two things that caused the problem:
1. QCompleter::setModel() changed the item delegates internally, so 
the specialized ones vanished

2. item delegates for columns are not used --> qt bug?
The attached patch solves both issues so that it works with my qt 
version. It should be tested for newer versions of qt.
Another issue: Here the destructor ~CompleterItemDelegate is never 
called. Do we have to delete it manually?

bernhard







Index: src/frontends/qt4/GuiCompleter.cpp
===
--- src/frontends/qt4/GuiCompleter.cpp  (revision 24807)
+++ src/frontends/qt4/GuiCompleter.cpp  (working copy)
@@ -43,13 +43,16 @@
 namespace lyx {
 namespace frontend {
 
-class RtlItemDelegate : public QItemDelegate
+class CompleterItemDelegate : public QItemDelegate
 {
 public:
-   explicit RtlItemDelegate(QObject * parent)
+   explicit CompleterItemDelegate(QObject * parent)
: QItemDelegate(parent), enabled_(false)
{}
 
+   ~CompleterItemDelegate()
+   {}
+
void setEnabled(bool enabled = true)
{
enabled_ = enabled;
@@ -70,23 +73,14 @@
reverse(stltext.begin(), stltext.end());
QItemDelegate::drawDisplay(painter, option, rect, 
toqstr(stltext));
}
-   
-private:
-   bool enabled_;
-};
 
-
-class PixmapItemDelegate : public QItemDelegate
-{
-public:
-   explicit PixmapItemDelegate(QObject * parent)
-   : QItemDelegate(parent)
-   {}
-
-protected:
void paint(QPainter *painter, const QStyleOptionViewItem ,
   const QModelIndex ) const
{
+   if (index.column() == 0) {
+   QItemDelegate::paint(painter, option, index);
+   return;
+   }
QStyleOptionViewItem opt = setOptions(index, option);
QVariant value = index.data(Qt::DisplayRole);
QPixmap pixmap = qvariant_cast(value);
@@ -103,9 +97,11 @@
drawFocus(painter, opt, option.rect);
painter->restore();
}
+
+private:
+   bool enabled_;
 };
 
-
 class GuiCompletionModel : public QAbstractListModel
 {
 public:
@@ -116,6 +112,12 @@
///
~GuiCompletionModel() { delete list_; }
///
+   void setList(CompletionList const * l) {
+   delete list_;
+   list_ = l;
+   reset();
+   }
+   ///
bool sorted() const
{
if (list_)
@@ -183,7 +185,8 @@
  modelActive_(false)
 {
// Setup the completion popup
-   setModel(new GuiCompletionModel(this, 0));
+   model_ = new GuiCompletionModel(this, 0);
+   setModel(model_);
setCompletionMode(QCompleter::PopupCompletion);
setWidget(gui_);

@@ -198,9 +201,8 @@
listView->setUniformRowHeights(true);
setPopup(listView);

-   rtlItemDelegate_ = new RtlItemDelegate(this);
-   popup()->setItemDelegateForColumn(0, rtlItemDelegate_);
-   popup()->setItemDelegateForColumn(1, new PixmapItemDelegate(this));
+   itemDelegate_ = new CompleterItemDelegate(this);
+   popup()->setItemDelegate(itemDelegate_);

// create timeout timers
popup_timer_.setSingleShot(true);
@@ -484,11 +486,11 @@
 
// turn the direction of the strings in the popup.
// Qt does not do that itself.
-   rtlItemDelegate_->setEnabled(rtl);
+   itemDelegate_->setEnabled(rtl);
 
// set new model
CompletionList const * list = cur.inset().createCompletionList(cur);
-   setModel(new GuiCompletionModel(this, list));
+   model_->setList(list);
modelActive_ = true;
if (list->sorted())

Re: [PATCH] GuiCompeter problems with qt 4.2.x

2008-05-28 Thread Bernhard Roider

Hello all,

as Stefan seems to be not available since a few weeks: could somebody test this patch with newer qt 
versions (4.3, 4.4)? I have no capacities to upgrade my version atm.


thanks
Bernhard


Bernhard Roider schrieb:

Hello Stefan,

today i finally found some time to investigate the problem we discussed 
at the beginning of march concerning the completion list: rtl text does 
not work and icons are not displayed for math symbols.


Here is a patch that solves that issue for me using qt 4.2.3. There are 
two things that caused the problem:
1. QCompleter::setModel() changed the item delegates internally, so the 
specialized ones vanished

2. item delegates for columns are not used -- qt bug?

The attached patch solves both issues so that it works with my qt 
version. It should be tested for newer versions of qt.


Another issue: Here the destructor ~CompleterItemDelegate is never 
called. Do we have to delete it manually?


bernhard





Re: [PATCH] GuiCompeter problems with qt 4.2.x

2008-05-28 Thread Bernhard Roider

Hello all,

as Stefan seems to be not available since a few weeks: could somebody test this patch with newer qt 
versions (4.3, 4.4)? I have no capacities to upgrade my version atm.


thanks
Bernhard


Bernhard Roider schrieb:

Hello Stefan,

today i finally found some time to investigate the problem we discussed 
at the beginning of march concerning the completion list: rtl text does 
not work and icons are not displayed for math symbols.


Here is a patch that solves that issue for me using qt 4.2.3. There are 
two things that caused the problem:
1. QCompleter::setModel() changed the item delegates internally, so the 
specialized ones vanished

2. item delegates for columns are not used --> qt bug?

The attached patch solves both issues so that it works with my qt 
version. It should be tested for newer versions of qt.


Another issue: Here the destructor ~CompleterItemDelegate is never 
called. Do we have to delete it manually?


bernhard





[PATCH] GuiCompeter problems with qt 4.2.x

2008-05-16 Thread Bernhard Roider

Hello Stefan,

today i finally found some time to investigate the problem we discussed at the beginning of march 
concerning the completion list: rtl text does not work and icons are not displayed for math symbols.


Here is a patch that solves that issue for me using qt 4.2.3. There are two things that caused the 
problem:

1. QCompleter::setModel() changed the item delegates internally, so the 
specialized ones vanished
2. item delegates for columns are not used -- qt bug?

The attached patch solves both issues so that it works with my qt version. It should be tested for 
newer versions of qt.


Another issue: Here the destructor ~CompleterItemDelegate is never called. Do we have to delete it 
manually?


bernhard

Index: src/frontends/qt4/GuiCompleter.cpp
===
--- src/frontends/qt4/GuiCompleter.cpp  (revision 24807)
+++ src/frontends/qt4/GuiCompleter.cpp  (working copy)
@@ -43,13 +43,16 @@
 namespace lyx {
 namespace frontend {
 
-class RtlItemDelegate : public QItemDelegate
+class CompleterItemDelegate : public QItemDelegate
 {
 public:
-   explicit RtlItemDelegate(QObject * parent)
+   explicit CompleterItemDelegate(QObject * parent)
: QItemDelegate(parent), enabled_(false)
{}
 
+   ~CompleterItemDelegate()
+   {}
+
void setEnabled(bool enabled = true)
{
enabled_ = enabled;
@@ -70,23 +73,14 @@
reverse(stltext.begin(), stltext.end());
QItemDelegate::drawDisplay(painter, option, rect, 
toqstr(stltext));
}
-   
-private:
-   bool enabled_;
-};
 
-
-class PixmapItemDelegate : public QItemDelegate
-{
-public:
-   explicit PixmapItemDelegate(QObject * parent)
-   : QItemDelegate(parent)
-   {}
-
-protected:
void paint(QPainter *painter, const QStyleOptionViewItem option,
   const QModelIndex index) const
{
+   if (index.column() == 0) {
+   QItemDelegate::paint(painter, option, index);
+   return;
+   }
QStyleOptionViewItem opt = setOptions(index, option);
QVariant value = index.data(Qt::DisplayRole);
QPixmap pixmap = qvariant_castQPixmap(value);
@@ -103,9 +97,11 @@
drawFocus(painter, opt, option.rect);
painter-restore();
}
+
+private:
+   bool enabled_;
 };
 
-
 class GuiCompletionModel : public QAbstractListModel
 {
 public:
@@ -116,6 +112,12 @@
///
~GuiCompletionModel() { delete list_; }
///
+   void setList(CompletionList const * l) {
+   delete list_;
+   list_ = l;
+   reset();
+   }
+   ///
bool sorted() const
{
if (list_)
@@ -183,7 +185,8 @@
  modelActive_(false)
 {
// Setup the completion popup
-   setModel(new GuiCompletionModel(this, 0));
+   model_ = new GuiCompletionModel(this, 0);
+   setModel(model_);
setCompletionMode(QCompleter::PopupCompletion);
setWidget(gui_);

@@ -198,9 +201,8 @@
listView-setUniformRowHeights(true);
setPopup(listView);

-   rtlItemDelegate_ = new RtlItemDelegate(this);
-   popup()-setItemDelegateForColumn(0, rtlItemDelegate_);
-   popup()-setItemDelegateForColumn(1, new PixmapItemDelegate(this));
+   itemDelegate_ = new CompleterItemDelegate(this);
+   popup()-setItemDelegate(itemDelegate_);

// create timeout timers
popup_timer_.setSingleShot(true);
@@ -484,11 +486,11 @@
 
// turn the direction of the strings in the popup.
// Qt does not do that itself.
-   rtlItemDelegate_-setEnabled(rtl);
+   itemDelegate_-setEnabled(rtl);
 
// set new model
CompletionList const * list = cur.inset().createCompletionList(cur);
-   setModel(new GuiCompletionModel(this, list));
+   model_-setList(list);
modelActive_ = true;
if (list-sorted())
setModelSorting(QCompleter::CaseSensitivelySortedModel);
@@ -556,7 +558,7 @@
 {
popup()-hide();
if (!inlineVisible())
-   setModel(new GuiCompletionModel(this, 0));
+   model_-setList(0);
 }
 
 
@@ -591,7 +593,7 @@
 void GuiCompleter::asyncHideInline()
 {
if (!popupVisible())
-   setModel(new GuiCompletionModel(this, 0));
+   model_-setList(0);
 }
 
 
Index: src/frontends/qt4/GuiCompleter.h
===
--- src/frontends/qt4/GuiCompleter.h(revision 24807)
+++ src/frontends/qt4/GuiCompleter.h(working copy)
@@ -31,7 +31,8 @@
 namespace frontend {
 
 class GuiWorkArea;
-class RtlItemDelegate;
+class CompleterItemDelegate;
+class GuiCompletionModel;
 
 class GuiCompleter : private QCompleter
 {
@@ -139,7 +140,9 @@
/// a coming 

[PATCH] GuiCompeter problems with qt 4.2.x

2008-05-16 Thread Bernhard Roider

Hello Stefan,

today i finally found some time to investigate the problem we discussed at the beginning of march 
concerning the completion list: rtl text does not work and icons are not displayed for math symbols.


Here is a patch that solves that issue for me using qt 4.2.3. There are two things that caused the 
problem:

1. QCompleter::setModel() changed the item delegates internally, so the 
specialized ones vanished
2. item delegates for columns are not used --> qt bug?

The attached patch solves both issues so that it works with my qt version. It should be tested for 
newer versions of qt.


Another issue: Here the destructor ~CompleterItemDelegate is never called. Do we have to delete it 
manually?


bernhard

Index: src/frontends/qt4/GuiCompleter.cpp
===
--- src/frontends/qt4/GuiCompleter.cpp  (revision 24807)
+++ src/frontends/qt4/GuiCompleter.cpp  (working copy)
@@ -43,13 +43,16 @@
 namespace lyx {
 namespace frontend {
 
-class RtlItemDelegate : public QItemDelegate
+class CompleterItemDelegate : public QItemDelegate
 {
 public:
-   explicit RtlItemDelegate(QObject * parent)
+   explicit CompleterItemDelegate(QObject * parent)
: QItemDelegate(parent), enabled_(false)
{}
 
+   ~CompleterItemDelegate()
+   {}
+
void setEnabled(bool enabled = true)
{
enabled_ = enabled;
@@ -70,23 +73,14 @@
reverse(stltext.begin(), stltext.end());
QItemDelegate::drawDisplay(painter, option, rect, 
toqstr(stltext));
}
-   
-private:
-   bool enabled_;
-};
 
-
-class PixmapItemDelegate : public QItemDelegate
-{
-public:
-   explicit PixmapItemDelegate(QObject * parent)
-   : QItemDelegate(parent)
-   {}
-
-protected:
void paint(QPainter *painter, const QStyleOptionViewItem ,
   const QModelIndex ) const
{
+   if (index.column() == 0) {
+   QItemDelegate::paint(painter, option, index);
+   return;
+   }
QStyleOptionViewItem opt = setOptions(index, option);
QVariant value = index.data(Qt::DisplayRole);
QPixmap pixmap = qvariant_cast(value);
@@ -103,9 +97,11 @@
drawFocus(painter, opt, option.rect);
painter->restore();
}
+
+private:
+   bool enabled_;
 };
 
-
 class GuiCompletionModel : public QAbstractListModel
 {
 public:
@@ -116,6 +112,12 @@
///
~GuiCompletionModel() { delete list_; }
///
+   void setList(CompletionList const * l) {
+   delete list_;
+   list_ = l;
+   reset();
+   }
+   ///
bool sorted() const
{
if (list_)
@@ -183,7 +185,8 @@
  modelActive_(false)
 {
// Setup the completion popup
-   setModel(new GuiCompletionModel(this, 0));
+   model_ = new GuiCompletionModel(this, 0);
+   setModel(model_);
setCompletionMode(QCompleter::PopupCompletion);
setWidget(gui_);

@@ -198,9 +201,8 @@
listView->setUniformRowHeights(true);
setPopup(listView);

-   rtlItemDelegate_ = new RtlItemDelegate(this);
-   popup()->setItemDelegateForColumn(0, rtlItemDelegate_);
-   popup()->setItemDelegateForColumn(1, new PixmapItemDelegate(this));
+   itemDelegate_ = new CompleterItemDelegate(this);
+   popup()->setItemDelegate(itemDelegate_);

// create timeout timers
popup_timer_.setSingleShot(true);
@@ -484,11 +486,11 @@
 
// turn the direction of the strings in the popup.
// Qt does not do that itself.
-   rtlItemDelegate_->setEnabled(rtl);
+   itemDelegate_->setEnabled(rtl);
 
// set new model
CompletionList const * list = cur.inset().createCompletionList(cur);
-   setModel(new GuiCompletionModel(this, list));
+   model_->setList(list);
modelActive_ = true;
if (list->sorted())
setModelSorting(QCompleter::CaseSensitivelySortedModel);
@@ -556,7 +558,7 @@
 {
popup()->hide();
if (!inlineVisible())
-   setModel(new GuiCompletionModel(this, 0));
+   model_->setList(0);
 }
 
 
@@ -591,7 +593,7 @@
 void GuiCompleter::asyncHideInline()
 {
if (!popupVisible())
-   setModel(new GuiCompletionModel(this, 0));
+   model_->setList(0);
 }
 
 
Index: src/frontends/qt4/GuiCompleter.h
===
--- src/frontends/qt4/GuiCompleter.h(revision 24807)
+++ src/frontends/qt4/GuiCompleter.h(working copy)
@@ -31,7 +31,8 @@
 namespace frontend {
 
 class GuiWorkArea;
-class RtlItemDelegate;
+class CompleterItemDelegate;
+class GuiCompletionModel;
 
 class GuiCompleter : private QCompleter
 {
@@ -139,7 +140,9 @@
/// a coming reset 

Reconfigure menu entry

2008-05-08 Thread Bernhard Roider

Hello,

sometimes when i want to open the lyx preferences i accidentally press reconfigure because those 
menu items are close to each other. Now i wonder why reconfigure is in the menu at all, because most 
people won't need it very often. Wouldn't it be better to put it as button somewhere in the 
preferences dialog? Opinions?


bernhard



Reconfigure menu entry

2008-05-08 Thread Bernhard Roider

Hello,

sometimes when i want to open the lyx preferences i accidentally press reconfigure because those 
menu items are close to each other. Now i wonder why reconfigure is in the menu at all, because most 
people won't need it very often. Wouldn't it be better to put it as button somewhere in the 
preferences dialog? Opinions?


bernhard



Re: [Cvslog] r24562 - /lyx-devel/trunk/src/insets/InsetBibtex.cpp

2008-04-30 Thread Bernhard Roider

Hello Richard,

i think this patch changed the error detection a bit, see below

bernhard


[EMAIL PROTECTED] schrieb:
 
-			if (!readTypeOrKey(entryType, ifs, from_ascii({(), 
-			   docstring(), makeLowerCase) || !ifs)

+   if (!ifs) {
+   lyxerr  InsetBibtex::fillWithBibKeys: Unexpected end of 
file.  std::endl;
continue;
+   }
+
+   if (!readTypeOrKey(entryType, ifs, from_ascii({(), 
docstring(), makeLowerCase)) {
+   lyxerr  InsetBibtex::fillWithBibKeys: Error reading 
entry type.  std::endl;
+   continue;
+   }
 
  

In the above code the order of  !readTypeOrKey(...) and !ifs is
exchanged which is not correct imho because readTypeOrKey reads from ifs.
-if (!readTypeOrKey(name, ifs, from_ascii(=), 
-   from_ascii(#{}(),), makeLowerCase) || !ifs)

+   if (!ifs) {
+   lyxerr  InsetBibtex::fillWithBibKeys: 
Unexpected end of file.  std::endl;
continue;
+   }
+
+   if (!readTypeOrKey(name, ifs, from_ascii(=), 
from_ascii(#{}(),), makeLowerCase)) {
+   lyxerr  InsetBibtex::fillWithBibKeys: Error 
reading string name.  std::endl;
+   continue;
+   }
  

the same here...
-if (!readTypeOrKey(key, ifs, from_ascii(,), 
-   from_ascii(}), keepCase) || !ifs)

+   if (!ifs) {
+   lyxerr  InsetBibtex::fillWithBibKeys: 
Unexpected end of file.  std::endl;
continue;
+   }
+
+   if (!readTypeOrKey(key, ifs, from_ascii(,), 
from_ascii(}), keepCase)) {
+	lyxerr  InsetBibtex::fillWithBibKeys: Unable to read key for entry type:  
+			entryType  .  std::endl;

+   continue;
+   }
  

and here



Re: [Cvslog] r24562 - /lyx-devel/trunk/src/insets/InsetBibtex.cpp

2008-04-30 Thread Bernhard Roider

Hello Richard,

i think this patch changed the error detection a bit, see below

bernhard


[EMAIL PROTECTED] schrieb:
 
-			if (!readTypeOrKey(entryType, ifs, from_ascii("{("), 
-			   docstring(), makeLowerCase) || !ifs)

+   if (!ifs) {
+   lyxerr << "InsetBibtex::fillWithBibKeys: Unexpected end of 
file." << std::endl;
continue;
+   }
+
+   if (!readTypeOrKey(entryType, ifs, from_ascii("{("), 
docstring(), makeLowerCase)) {
+   lyxerr << "InsetBibtex::fillWithBibKeys: Error reading 
entry type." << std::endl;
+   continue;
+   }
 
  

In the above code the order of  !readTypeOrKey(...) and !ifs is
exchanged which is not correct imho because readTypeOrKey reads from ifs.
-if (!readTypeOrKey(name, ifs, from_ascii("="), 
-   from_ascii("#{}(),"), makeLowerCase) || !ifs)

+   if (!ifs) {
+   lyxerr << "InsetBibtex::fillWithBibKeys: 
Unexpected end of file." << std::endl;
continue;
+   }
+
+   if (!readTypeOrKey(name, ifs, from_ascii("="), 
from_ascii("#{}(),"), makeLowerCase)) {
+   lyxerr << "InsetBibtex::fillWithBibKeys: Error 
reading string name." << std::endl;
+   continue;
+   }
  

the same here...
-if (!readTypeOrKey(key, ifs, from_ascii(","), 
-   from_ascii("}"), keepCase) || !ifs)

+   if (!ifs) {
+   lyxerr << "InsetBibtex::fillWithBibKeys: 
Unexpected end of file." << std::endl;
continue;
+   }
+
+   if (!readTypeOrKey(key, ifs, from_ascii(","), 
from_ascii("}"), keepCase)) {
+	lyxerr << "InsetBibtex::fillWithBibKeys: Unable to read key for entry type:" << 
+			entryType << "." << std::endl;

+   continue;
+   }
  

and here



Re: InsetText Crash

2008-03-08 Thread Bernhard Roider

Andre Poenitz schrieb:

On Fri, Mar 07, 2008 at 07:16:50PM -0500, rgheck wrote:
I've fixed the crash reported by Bernhard at r23549. But I'm still puzzled 
about something. The crash is probably a consequence of my attempt to work 
on Paragraph.cpp, but I'm not sure exactly what's happened. The backtrace 
gives me a crash in the Layout constructor, and from there in basic_string. 
So it looks as if there's an uninitialized string in the Layout object, but 
I don't see how that could be. I think the the paragraph in question is 
using emptyParagraphLayout, which is simply a static and otherwise 
undefined Layout object:

   namespace {
   Layout const emptyParagraphLayout;
   }
But why should this have an uninitialized member?

Anyway, I'm quite puzzled by this and worried we'll find similar problems 
elsewhere. If anyone has any ideas, I'd love to hear them.


Obviously, svn up -r 23548, then HelpLaTeX Configuration to generate the 
crash.


Hm... this new 'Software Exception' dialog is pretty efficient at
creating useless stack traces.. *sigh*



That's why i needed some time to figure out the origin of the crash. Maybe it should be disabled in 
debug mode?


bernhard


Andre'





Re: InsetText Crash

2008-03-08 Thread Bernhard Roider

Andre Poenitz schrieb:

On Sat, Mar 08, 2008 at 01:36:04PM +0100, Abdelrazak Younes wrote:
[]
There was no crash here, I had the exception message box displayed and the 
buffer closed.


How do you get a backtrace in this situation?



I am on windows also, and it is hard this way. If the exception is not caught and i start the 
program from within visual studio i can immediately debug with a call stack in a separate window, 
where i can click every line to jump to the code and inspect all the variables that are involved.


bernhard



Re: InsetText Crash

2008-03-08 Thread Bernhard Roider

Andre Poenitz schrieb:

On Fri, Mar 07, 2008 at 07:16:50PM -0500, rgheck wrote:
I've fixed the crash reported by Bernhard at r23549. But I'm still puzzled 
about something. The crash is probably a consequence of my attempt to work 
on Paragraph.cpp, but I'm not sure exactly what's happened. The backtrace 
gives me a crash in the Layout constructor, and from there in basic_string. 
So it looks as if there's an uninitialized string in the Layout object, but 
I don't see how that could be. I think the the paragraph in question is 
using emptyParagraphLayout, which is simply a static and otherwise 
undefined Layout object:

   namespace {
   Layout const emptyParagraphLayout;
   }
But why should this have an uninitialized member?

Anyway, I'm quite puzzled by this and worried we'll find similar problems 
elsewhere. If anyone has any ideas, I'd love to hear them.


Obviously, svn up -r 23548, then Help>LaTeX Configuration to generate the 
crash.


Hm... this new 'Software Exception' dialog is pretty efficient at
creating useless stack traces.. *sigh*



That's why i needed some time to figure out the origin of the crash. Maybe it should be disabled in 
debug mode?


bernhard


Andre'





Re: InsetText Crash

2008-03-08 Thread Bernhard Roider

Andre Poenitz schrieb:

On Sat, Mar 08, 2008 at 01:36:04PM +0100, Abdelrazak Younes wrote:
[]
There was no crash here, I had the exception message box displayed and the 
buffer closed.


How do you get a backtrace in this situation?



I am on windows also, and it is hard this way. If the exception is not caught and i start the 
program from within visual studio i can immediately debug with a call stack in a separate window, 
where i can click every line to jump to the code and inspect all the variables that are involved.


bernhard



Re: cangeset 23520 - crash

2008-03-07 Thread Bernhard Roider

Uwe Stöhr schrieb:

Hello Bernhard,

could you please also add a description of bm.sty to the LaTeXConfig.lyx 


I tried to open this document with current trunk and got a crash. The attached patch avoids the 
crash but someone familiar with InsetText.cpp should have a look at it.


bernhard


file and add bm to the checked packages in chkconfig.ltx?

thanks and regards
Uwe





Re: cangeset 23520 - crash

2008-03-07 Thread Bernhard Roider

Uwe Stöhr schrieb:

Hello Bernhard,

could you please also add a description of bm.sty to the LaTeXConfig.lyx 


I tried to open this document with current trunk and got a crash. The attached 
patch avoids the
crash but someone familiar with InsetText.cpp should have a look at it.

bernhard


file and add bm to the checked packages in chkconfig.ltx?

thanks and regards
Uwe




Index: src/insets/InsetText.cpp
===
--- src/insets/InsetText.cpp(revision 23539)
+++ src/insets/InsetText.cpp(working copy)
@@ -142,12 +142,17 @@
ParagraphList  pars = paragraphs();
 
// This is a gross hack...
-   Layout old_layout = pars.begin()-layout();
+   Layout const * old_layout = 0;
+   if (pars.begin() != pars.end()) {
+   old_layout = pars.begin()-layout();
+   }
 
pars.clear();
pars.push_back(Paragraph());
pars.begin()-setInsetOwner(this);
-   pars.begin()-setLayout(old_layout);
+   if (old_layout) {
+   pars.begin()-setLayout(*old_layout);
+   }
 }
 
 


Re: cangeset 23520 - crash

2008-03-07 Thread Bernhard Roider

Uwe Stöhr schrieb:

Hello Bernhard,

could you please also add a description of bm.sty to the LaTeXConfig.lyx 


I tried to open this document with current trunk and got a crash. The attached patch avoids the 
crash but someone familiar with InsetText.cpp should have a look at it.


bernhard


file and add bm to the checked packages in chkconfig.ltx?

thanks and regards
Uwe





Re: cangeset 23520 - crash

2008-03-07 Thread Bernhard Roider

Uwe Stöhr schrieb:

Hello Bernhard,

could you please also add a description of bm.sty to the LaTeXConfig.lyx 


I tried to open this document with current trunk and got a crash. The attached 
patch avoids the
crash but someone familiar with InsetText.cpp should have a look at it.

bernhard


file and add bm to the checked packages in chkconfig.ltx?

thanks and regards
Uwe




Index: src/insets/InsetText.cpp
===
--- src/insets/InsetText.cpp(revision 23539)
+++ src/insets/InsetText.cpp(working copy)
@@ -142,12 +142,17 @@
ParagraphList & pars = paragraphs();
 
// This is a gross hack...
-   Layout old_layout = pars.begin()->layout();
+   Layout const * old_layout = 0;
+   if (pars.begin() != pars.end()) {
+   old_layout = ()->layout();
+   }
 
pars.clear();
pars.push_back(Paragraph());
pars.begin()->setInsetOwner(this);
-   pars.begin()->setLayout(old_layout);
+   if (old_layout) {
+   pars.begin()->setLayout(*old_layout);
+   }
 }
 
 


Re: [patch] Support for \bm (bm.sty) in math

2008-03-05 Thread Bernhard Roider

Uwe Stöhr schrieb:
  following the suggestion from Martin in an earlier mail i have a 
patch that adds support for \bm

  from bm.sty package to lyx.

Could you please open an enhancement report in bugzilla, to assure that 
your patch won't be forgotten.




I'd rather put it in.

bernhard



Re: crash in GuiCompleter

2008-03-05 Thread Bernhard Roider

Stefan Schimanski schrieb:


Am 03.03.2008 um 22:56 schrieb Bernhard Roider:


Stefan Schimanski schrieb:



Stefan


I tried to test the rtl completion but failed to do so - but i 
have really _no_ experience with rtl. When exactly should the 
items in the list show up rtl?
It should work the same as in LTR text, only that it is mirrored. 
I.e. the item in the popup are written from right to left and the 
inline completion extends to the left. To test it, set the language 
of some text to Hebrew. Then place the cursor somewhere press tab 
after a word which has a completion.


That's what i've tried already, but the item delegates do not seem 
to work at all here (see screenshot). When should there be icons 
visible (PixmapItemDelegate)?

The icons only work in math mode.


Not here. The icons are not displayed.


Can you try again? I fixed a problem with the column width. Maybe the 
icon are there, but not visible.




The same as before (see attached screen shots). Tomorrow evening i will have 
some time to investigate.

bernhard
inline: NoIconInMathList.jpginline: NoRTLInListAndCursorPos.jpg

Re: [patch] Support for \bm (bm.sty) in math

2008-03-05 Thread Bernhard Roider

Uwe Stöhr schrieb:
 > following the suggestion from Martin in an earlier mail i have a 
patch that adds support for \bm

 > from bm.sty package to lyx.

Could you please open an enhancement report in bugzilla, to assure that 
your patch won't be forgotten.




I'd rather put it in.

bernhard



Re: crash in GuiCompleter

2008-03-05 Thread Bernhard Roider

Stefan Schimanski schrieb:


Am 03.03.2008 um 22:56 schrieb Bernhard Roider:


Stefan Schimanski schrieb:



Stefan


I tried to test the rtl completion but failed to do so - but i 
have really _no_ experience with rtl. When exactly should the 
items in the list show up rtl?
It should work the same as in LTR text, only that it is mirrored. 
I.e. the item in the popup are written from right to left and the 
inline completion extends to the left. To test it, set the language 
of some text to "Hebrew". Then place the cursor somewhere press tab 
after a word which has a completion.


That's what i've tried already, but the item delegates do not seem 
to work at all here (see screenshot). When should there be icons 
visible (PixmapItemDelegate)?

The icons only work in math mode.


Not here. The icons are not displayed.


Can you try again? I fixed a problem with the column width. Maybe the 
icon are there, but not visible.




The same as before (see attached screen shots). Tomorrow evening i will have 
some time to investigate.

bernhard
<><>

Re: crash in GuiCompleter

2008-03-03 Thread Bernhard Roider

Stefan Schimanski schrieb:


Right, very strange. And it seems that the 
d-columnDelegates.value(column, 0) can be 0 in fact. But after 
setting it to a non-zero value, there is no way to go back.
We can of course put some flag in our delegate and use the standard 
delegate methods if the flag is false. Any other idea?


This is also what i thought would be the best.


I fixed this in trunk. Can you please try?



No crash but...




Stefan


I tried to test the rtl completion but failed to do so - but i have 
really _no_ experience with rtl. When exactly should the items in the 
list show up rtl?


It should work the same as in LTR text, only that it is mirrored. I.e. 
the item in the popup are written from right to left and the inline 
completion extends to the left. To test it, set the language of some 
text to Hebrew. Then place the cursor somewhere press tab after a word 
which has a completion.




That's what i've tried already, but the item delegates do not seem to work at all here (see 
screenshot). When should there be icons visible (PixmapItemDelegate)?


bernhard
inline: nortlinlist.jpg

Re: crash in GuiCompleter

2008-03-03 Thread Bernhard Roider

Stefan Schimanski schrieb:



Stefan


I tried to test the rtl completion but failed to do so - but i have 
really _no_ experience with rtl. When exactly should the items in 
the list show up rtl?
It should work the same as in LTR text, only that it is mirrored. 
I.e. the item in the popup are written from right to left and the 
inline completion extends to the left. To test it, set the language 
of some text to Hebrew. Then place the cursor somewhere press tab 
after a word which has a completion.


That's what i've tried already, but the item delegates do not seem to 
work at all here (see screenshot). When should there be icons visible 
(PixmapItemDelegate)?


The icons only work in math mode. 


Not here. The icons are not displayed.

reversed (or reverse twice). Can you try to find out (with a debugger or 
some printf's) what's going on?




I hope to find some time the next days. What i already found out: RtlItemDelegate::drawDisplay is 
never called.


It seems that the delegates are simply ignored.

Btw: When the completion list is displayed the items are filtered as i type. When no matching item 
remains then an empty list is still displayed - it should be hidden imho.


bernhard



Re: crash in GuiCompleter

2008-03-03 Thread Bernhard Roider

Stefan Schimanski schrieb:


Right, very strange. And it seems that the 
d->columnDelegates.value(column, 0) can be 0 in fact. But after 
setting it to a non-zero value, there is no way to go back.
We can of course put some flag in our delegate and use the standard 
delegate methods if the flag is false. Any other idea?


This is also what i thought would be the best.


I fixed this in trunk. Can you please try?



No crash but...




Stefan


I tried to test the rtl completion but failed to do so - but i have 
really _no_ experience with rtl. When exactly should the items in the 
list show up rtl?


It should work the same as in LTR text, only that it is mirrored. I.e. 
the item in the popup are written from right to left and the inline 
completion extends to the left. To test it, set the language of some 
text to "Hebrew". Then place the cursor somewhere press tab after a word 
which has a completion.




That's what i've tried already, but the item delegates do not seem to work at all here (see 
screenshot). When should there be icons visible (PixmapItemDelegate)?


bernhard
<>

Re: crash in GuiCompleter

2008-03-03 Thread Bernhard Roider

Stefan Schimanski schrieb:



Stefan


I tried to test the rtl completion but failed to do so - but i have 
really _no_ experience with rtl. When exactly should the items in 
the list show up rtl?
It should work the same as in LTR text, only that it is mirrored. 
I.e. the item in the popup are written from right to left and the 
inline completion extends to the left. To test it, set the language 
of some text to "Hebrew". Then place the cursor somewhere press tab 
after a word which has a completion.


That's what i've tried already, but the item delegates do not seem to 
work at all here (see screenshot). When should there be icons visible 
(PixmapItemDelegate)?


The icons only work in math mode. 


Not here. The icons are not displayed.

reversed (or reverse twice). Can you try to find out (with a debugger or 
some printf's) what's going on?




I hope to find some time the next days. What i already found out: RtlItemDelegate::drawDisplay is 
never called.


It seems that the delegates are simply ignored.

Btw: When the completion list is displayed the items are filtered as i type. When no matching item 
remains then an empty list is still displayed - it should be hidden imho.


bernhard



crash in GuiCompleter

2008-03-02 Thread Bernhard Roider

hello,

when i compile current trunk i get a crash when typing the first character in a document due to line 
440 in GuiCompleter.cpp:


popup()-setItemDelegateForColumn(0, rtl ? rtlItemDelegate_ : 0);

when i replace this call with

if (rtl) {
popup()-setItemDelegateForColumn(0, rtlItemDelegate_ );
}

the crash has gone. this seems to be related with my qt version: 4.2.3. in this version a 0-pointer 
is not allowed for the item delegate (there is an assert on this in the implementation of 
setItemDelegateForColumn).


the working code above may not be sufficient if one popup is used for rtl _and_ ltr entries, because 
then once rtl is set it would not be reset for ltr.


bernhard



Re: crash in GuiCompleter

2008-03-02 Thread Bernhard Roider

Stefan Schimanski schrieb:

Hi!

the crash has gone. this seems to be related with my qt version: 
4.2.3. in this version a 0-pointer is not allowed for the item 
delegate (there is an assert on this in the implementation of 
setItemDelegateForColumn).


Right, very strange. And it seems that the 
d-columnDelegates.value(column, 0) can be 0 in fact. But after setting 
it to a non-zero value, there is no way to go back.


We can of course put some flag in our delegate and use the standard 
delegate methods if the flag is false. Any other idea?


This is also what i thought would be the best.



Stefan



I tried to test the rtl completion but failed to do so - but i have really _no_ experience with rtl. 
When exactly should the items in the list show up rtl?


Bernhard



[patch] Support for \bm (bm.sty)

2008-03-02 Thread Bernhard Roider

Hello,

following the suggestion from Martin in an earlier mail i have a patch that adds support for \bm 
from bm.sty package to lyx. The Files InsetMathBM.{cpp,h} are copied and adapted from 
InsetMathBoldSymbol.{cpp,h}. I don't understand the comment

// FIXME: BROKEN!
in
void InsetMathBM::metricsT(TextMetricsInfo const  mi, Dimension  /*dim*/) 
const
and therefore left it as it is in the boldsymbol counterpart.

I tried to adapt all build systems as well (but could test cmake and VC2005 
only)

Comments are welcome.

Bernhard
Index: development/scons/scons_manifest.py
===
--- development/scons/scons_manifest.py (revision 23401)
+++ development/scons/scons_manifest.py (working copy)
@@ -455,6 +455,7 @@
 InsetMathAMSArray.h
 InsetMathArray.h
 InsetMathBig.h
+InsetMathBM.h
 InsetMathBoldSymbol.h
 InsetMathBox.h
 InsetMathBrace.h
@@ -523,6 +524,7 @@
 InsetMathAMSArray.cpp
 InsetMathArray.cpp
 InsetMathBig.cpp
+InsetMathBM.cpp
 InsetMathBoldSymbol.cpp
 InsetMathBox.cpp
 InsetMathBrace.cpp
Index: src/LaTeXFeatures.cpp
===
--- src/LaTeXFeatures.cpp   (revision 23401)
+++ src/LaTeXFeatures.cpp   (working copy)
@@ -547,7 +547,8 @@
endnotes,
ifthen,
amsthm,
-   listings
+   listings,
+   bm
 };
 
 int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
Index: src/Makefile.am
===
--- src/Makefile.am (revision 23401)
+++ src/Makefile.am (working copy)
@@ -332,6 +332,7 @@
mathed/InsetMathAMSArray.cpp \
mathed/InsetMathArray.cpp \
mathed/InsetMathBig.cpp \
+   mathed/InsetMathBM.cpp \
mathed/InsetMathBoldSymbol.cpp \
mathed/InsetMathBox.cpp \
mathed/InsetMathBrace.cpp \
@@ -397,6 +398,7 @@
mathed/InsetMathAMSArray.h \
mathed/InsetMathArray.h \
mathed/InsetMathBig.h \
+   mathed/InsetMathBM.h \
mathed/InsetMathBoldSymbol.h \
mathed/InsetMathBox.h \
mathed/InsetMathBrace.h \
Index: src/mathed/InsetMathBM.cpp
===
--- src/mathed/InsetMathBM.cpp  (revision 0)
+++ src/mathed/InsetMathBM.cpp  (revision 0)
@@ -0,0 +1,86 @@
+/**
+ * \file InsetMathBM.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Bernhard Roider
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include config.h
+
+#include InsetMathBM.h
+
+#include MathStream.h
+#include MathData.h
+#include LaTeXFeatures.h
+
+#include ostream
+
+
+namespace lyx {
+
+InsetMathBM::InsetMathBM()
+   : InsetMathNest(1)
+{}
+
+
+Inset * InsetMathBM::clone() const
+{
+   return new InsetMathBM(*this);
+}
+
+
+void InsetMathBM::metrics(MetricsInfo  mi, Dimension  dim) const
+{
+   //FontSetChanger dummy(mi.base, mathbf);
+   cell(0).metrics(mi, dim);
+   metricsMarkers(dim);
+   ++dim.wid;  // for 'double stroke'
+}
+
+
+void InsetMathBM::draw(PainterInfo  pi, int x, int y) const
+{
+   //FontSetChanger dummy(pi.base, mathbf);
+   cell(0).draw(pi, x + 1, y);
+   cell(0).draw(pi, x + 2, y);
+   drawMarkers(pi, x, y);
+}
+
+
+void InsetMathBM::metricsT(TextMetricsInfo const  mi, Dimension  /*dim*/) 
const
+{
+   // FIXME: BROKEN!
+   Dimension dim;
+   cell(0).metricsT(mi, dim);
+}
+
+
+void InsetMathBM::drawT(TextPainter  pain, int x, int y) const
+{
+   cell(0).drawT(pain, x, y);
+}
+
+
+void InsetMathBM::validate(LaTeXFeatures  features) const
+{
+   InsetMathNest::validate(features);
+   features.require(bm);
+}
+
+
+void InsetMathBM::write(WriteStream  os) const
+{
+   os  \\bm{  cell(0)  };
+}
+
+
+void InsetMathBM::infoize(odocstream  os) const
+{
+   os  bm ;
+}
+
+
+} // namespace lyx
Index: src/mathed/InsetMathBM.h
===
--- src/mathed/InsetMathBM.h(revision 0)
+++ src/mathed/InsetMathBM.h(revision 0)
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+/**
+ * \file InsetMathBM.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Bernhard Roider
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef MATH_BMINSET_H
+#define MATH_BMINSET_H
+
+#include InsetMathNest.h
+
+
+namespace lyx {
+
+
+/// Inset for \bm
+class InsetMathBM : public InsetMathNest {
+public:
+   ///
+   InsetMathBM();
+   ///
+   void metrics(MetricsInfo  mi, Dimension  dim) const;
+   ///
+   void draw(PainterInfo  pi, int x, int y) const;
+   ///
+   void metricsT(TextMetricsInfo const  mi, Dimension  dim) const;
+   ///
+   void drawT(TextPainter  pi, int

crash in GuiCompleter

2008-03-02 Thread Bernhard Roider

hello,

when i compile current trunk i get a crash when typing the first character in a document due to line 
440 in GuiCompleter.cpp:


popup()->setItemDelegateForColumn(0, rtl ? rtlItemDelegate_ : 0);

when i replace this call with

if (rtl) {
popup()->setItemDelegateForColumn(0, rtlItemDelegate_ );
}

the crash has gone. this seems to be related with my qt version: 4.2.3. in this version a 0-pointer 
is not allowed for the item delegate (there is an assert on this in the implementation of 
setItemDelegateForColumn).


the working code above may not be sufficient if one popup is used for rtl _and_ ltr entries, because 
then once rtl is set it would not be reset for ltr.


bernhard



Re: crash in GuiCompleter

2008-03-02 Thread Bernhard Roider

Stefan Schimanski schrieb:

Hi!

the crash has gone. this seems to be related with my qt version: 
4.2.3. in this version a 0-pointer is not allowed for the item 
delegate (there is an assert on this in the implementation of 
setItemDelegateForColumn).


Right, very strange. And it seems that the 
d->columnDelegates.value(column, 0) can be 0 in fact. But after setting 
it to a non-zero value, there is no way to go back.


We can of course put some flag in our delegate and use the standard 
delegate methods if the flag is false. Any other idea?


This is also what i thought would be the best.



Stefan



I tried to test the rtl completion but failed to do so - but i have really _no_ experience with rtl. 
When exactly should the items in the list show up rtl?


Bernhard



[patch] Support for \bm (bm.sty)

2008-03-02 Thread Bernhard Roider

Hello,

following the suggestion from Martin in an earlier mail i have a patch that adds support for \bm 
from bm.sty package to lyx. The Files InsetMathBM.{cpp,h} are copied and adapted from 
InsetMathBoldSymbol.{cpp,h}. I don't understand the comment

// FIXME: BROKEN!
in
void InsetMathBM::metricsT(TextMetricsInfo const & mi, Dimension & /*dim*/) 
const
and therefore left it as it is in the boldsymbol counterpart.

I tried to adapt all build systems as well (but could test cmake and VC2005 
only)

Comments are welcome.

Bernhard
Index: development/scons/scons_manifest.py
===
--- development/scons/scons_manifest.py (revision 23401)
+++ development/scons/scons_manifest.py (working copy)
@@ -455,6 +455,7 @@
 InsetMathAMSArray.h
 InsetMathArray.h
 InsetMathBig.h
+InsetMathBM.h
 InsetMathBoldSymbol.h
 InsetMathBox.h
 InsetMathBrace.h
@@ -523,6 +524,7 @@
 InsetMathAMSArray.cpp
 InsetMathArray.cpp
 InsetMathBig.cpp
+InsetMathBM.cpp
 InsetMathBoldSymbol.cpp
 InsetMathBox.cpp
 InsetMathBrace.cpp
Index: src/LaTeXFeatures.cpp
===
--- src/LaTeXFeatures.cpp   (revision 23401)
+++ src/LaTeXFeatures.cpp   (working copy)
@@ -547,7 +547,8 @@
"endnotes",
"ifthen",
"amsthm",
-   "listings"
+   "listings",
+   "bm"
 };
 
 int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
Index: src/Makefile.am
===
--- src/Makefile.am (revision 23401)
+++ src/Makefile.am (working copy)
@@ -332,6 +332,7 @@
mathed/InsetMathAMSArray.cpp \
mathed/InsetMathArray.cpp \
mathed/InsetMathBig.cpp \
+   mathed/InsetMathBM.cpp \
mathed/InsetMathBoldSymbol.cpp \
mathed/InsetMathBox.cpp \
mathed/InsetMathBrace.cpp \
@@ -397,6 +398,7 @@
mathed/InsetMathAMSArray.h \
mathed/InsetMathArray.h \
mathed/InsetMathBig.h \
+   mathed/InsetMathBM.h \
mathed/InsetMathBoldSymbol.h \
mathed/InsetMathBox.h \
mathed/InsetMathBrace.h \
Index: src/mathed/InsetMathBM.cpp
===
--- src/mathed/InsetMathBM.cpp  (revision 0)
+++ src/mathed/InsetMathBM.cpp  (revision 0)
@@ -0,0 +1,86 @@
+/**
+ * \file InsetMathBM.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Bernhard Roider
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include 
+
+#include "InsetMathBM.h"
+
+#include "MathStream.h"
+#include "MathData.h"
+#include "LaTeXFeatures.h"
+
+#include 
+
+
+namespace lyx {
+
+InsetMathBM::InsetMathBM()
+   : InsetMathNest(1)
+{}
+
+
+Inset * InsetMathBM::clone() const
+{
+   return new InsetMathBM(*this);
+}
+
+
+void InsetMathBM::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+   //FontSetChanger dummy(mi.base, "mathbf");
+   cell(0).metrics(mi, dim);
+   metricsMarkers(dim);
+   ++dim.wid;  // for 'double stroke'
+}
+
+
+void InsetMathBM::draw(PainterInfo & pi, int x, int y) const
+{
+   //FontSetChanger dummy(pi.base, "mathbf");
+   cell(0).draw(pi, x + 1, y);
+   cell(0).draw(pi, x + 2, y);
+   drawMarkers(pi, x, y);
+}
+
+
+void InsetMathBM::metricsT(TextMetricsInfo const & mi, Dimension & /*dim*/) 
const
+{
+   // FIXME: BROKEN!
+   Dimension dim;
+   cell(0).metricsT(mi, dim);
+}
+
+
+void InsetMathBM::drawT(TextPainter & pain, int x, int y) const
+{
+   cell(0).drawT(pain, x, y);
+}
+
+
+void InsetMathBM::validate(LaTeXFeatures & features) const
+{
+   InsetMathNest::validate(features);
+   features.require("bm");
+}
+
+
+void InsetMathBM::write(WriteStream & os) const
+{
+   os << "\\bm{" << cell(0) << "}";
+}
+
+
+void InsetMathBM::infoize(odocstream & os) const
+{
+   os << "bm ";
+}
+
+
+} // namespace lyx
Index: src/mathed/InsetMathBM.h
===
--- src/mathed/InsetMathBM.h(revision 0)
+++ src/mathed/InsetMathBM.h(revision 0)
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+/**
+ * \file InsetMathBM.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Bernhard Roider
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef MATH_BMINSET_H
+#define MATH_BMINSET_H
+
+#include "InsetMathNest.h"
+
+
+namespace lyx {
+
+
+/// Inset for \bm
+class InsetMathBM : public InsetMathNest {
+public:
+   ///
+   Inset

Re: [Cvslog] r23332 - /lyx-devel/trunk/src/insets/InsetBibtex.cpp

2008-02-28 Thread Bernhard Roider

trunk does not compile:

[EMAIL PROTECTED] schrieb:

-   if (!contains(buffer().params().documentClass().name(), art)) 
{
+   if (!contains(buffer().params().baseClass()-name(), art)) {
  

InsetBibtex.cpp
..\..\..\trunk\src\insets\InsetBibtex.cpp(313) : error C2027: use of
undefined type 'lyx::BaseClassIndex'
   D:\lyx\trunk\src\BufferParams.h(35) : see declaration of
'lyx::BaseClassIndex'

bernhard



Re: [Cvslog] r23332 - /lyx-devel/trunk/src/insets/InsetBibtex.cpp

2008-02-28 Thread Bernhard Roider

trunk does not compile:

[EMAIL PROTECTED] schrieb:

-   if (!contains(buffer().params().documentClass().name(), "art")) 
{
+   if (!contains(buffer().params().baseClass()->name(), "art")) {
  

InsetBibtex.cpp
..\..\..\trunk\src\insets\InsetBibtex.cpp(313) : error C2027: use of
undefined type 'lyx::BaseClassIndex'
   D:\lyx\trunk\src\BufferParams.h(35) : see declaration of
'lyx::BaseClassIndex'

bernhard



Re: possible recursion in labelstring for counters

2008-02-23 Thread Bernhard Roider




etc instead of the owner/new/delete logic?

Andre'



you are right, allocation on the stack is really better here...

bernhard




That was the wrong patch... here's the correct one

bernhard
Index: src/Counters.cpp
===
--- src/Counters.cpp(revision 23138)
+++ src/Counters.cpp(working copy)
@@ -340,22 +340,47 @@
 
 docstring Counters::theCounter(docstring const  counter)
 {
+   std::setdocstring callers;
+   return theCounter(counter, callers);
+}
+
+docstring Counters::theCounter(docstring const  counter,
+  std::setdocstring 
 callers)
+{
if (!hasCounter(counter))
return from_ascii(??);
 
-   Counter const  c = counterList[counter];
-   docstring ls = appendix() ? c.labelStringAppendix() : c.labelString();
+   docstring label;
 
-   if (ls.empty()) {
-   if (!c.master().empty())
-   ls = from_ascii(\\the) + c.master() + from_ascii(.);
-   ls += from_ascii(\\arabic{) + counter + };
+   if (callers.find(counter) == callers.end()) {
+   
+   pairstd::setdocstring::iterator, bool result = 
callers.insert(counter);
+
+   Counter const  c = counterList[counter];
+   docstring ls = appendix() ? c.labelStringAppendix() : 
c.labelString();
+
+   if (ls.empty()) {
+   if (!c.master().empty())
+   ls = from_ascii(\\the) + c.master() + 
from_ascii(.);
+   ls += from_ascii(\\arabic{) + counter + };
+   }
+
+   label = counterLabel(ls, callers);
+
+   callers.erase(result.first);
+   } else {
+   // recursion detected
+   lyxerr  Warning: Recursion in label for counter `
+   counter  ' detected
+   endl;
}
-   return counterLabel(ls);
+
+   return label;
 }
 
 
-docstring Counters::counterLabel(docstring const  format)
+docstring Counters::counterLabel(docstring const  format,
+
std::setdocstring * callers)
 {
docstring label = format;
 
@@ -373,10 +398,11 @@
lowercase(label[k]) = 'z')
++k;
docstring counter = label.substr(j, k - j);
-   docstring repl = theCounter(counter);
+   docstring repl = callers? theCounter(counter, *callers): 
+ theCounter(counter);
label.replace(i, k - j + 4, repl);
}
-   
+
while (true) {
//lyxerr  label=  to_utf8(label)  endl;
 
Index: src/Counters.h
===
--- src/Counters.h  (revision 23138)
+++ src/Counters.h  (working copy)
@@ -18,6 +18,7 @@
 #include support/docstring.h
 
 #include map
+#include set
 
 
 namespace lyx {
@@ -105,7 +106,8 @@
docstring theCounter(docstring const  c);
/// Replace om format all the LaTeX-like macros that depend on
/// counters.
-   docstring counterLabel(docstring const  format);
+   docstring counterLabel(docstring const  format, 
+ std::setdocstring * callers = 0);
/// Are we in apendix?
bool appendix() const { return appendix_; };
/// Set the state variable indicating whether we are in appendix.
@@ -115,6 +117,10 @@
/// Sets the current enclosing float.
void current_float(std::string const  f) { current_float_ = f; }
 private:
+   /// returns the expanded string representation of the counter
+   /// with recursion protection through callers.
+   docstring theCounter(docstring const  c, 
+ std::setdocstring  callers);
/// Returns the value of the counter according to the
/// numbering scheme numbertype.
/* Available numbering schemes are arabic (1, 2,...), roman


Re: possible recursion in labelstring for counters

2008-02-23 Thread Bernhard Roider




etc instead of the owner/new/delete logic?

Andre'



you are right, allocation on the stack is really better here...

bernhard




That was the wrong patch... here's the correct one

bernhard
Index: src/Counters.cpp
===
--- src/Counters.cpp(revision 23138)
+++ src/Counters.cpp(working copy)
@@ -340,22 +340,47 @@
 
 docstring Counters::theCounter(docstring const & counter)
 {
+   std::set callers;
+   return theCounter(counter, callers);
+}
+
+docstring Counters::theCounter(docstring const & counter,
+  std::set 
& callers)
+{
if (!hasCounter(counter))
return from_ascii("??");
 
-   Counter const & c = counterList[counter];
-   docstring ls = appendix() ? c.labelStringAppendix() : c.labelString();
+   docstring label;
 
-   if (ls.empty()) {
-   if (!c.master().empty())
-   ls = from_ascii("\\the") + c.master() + from_ascii(".");
-   ls += from_ascii("\\arabic{") + counter + "}";
+   if (callers.find(counter) == callers.end()) {
+   
+   pair result = 
callers.insert(counter);
+
+   Counter const & c = counterList[counter];
+   docstring ls = appendix() ? c.labelStringAppendix() : 
c.labelString();
+
+   if (ls.empty()) {
+   if (!c.master().empty())
+   ls = from_ascii("\\the") + c.master() + 
from_ascii(".");
+   ls += from_ascii("\\arabic{") + counter + "}";
+   }
+
+   label = counterLabel(ls, );
+
+   callers.erase(result.first);
+   } else {
+   // recursion detected
+   lyxerr << "Warning: Recursion in label for counter `"
+  << counter << "' detected"
+  << endl;
}
-   return counterLabel(ls);
+
+   return label;
 }
 
 
-docstring Counters::counterLabel(docstring const & format)
+docstring Counters::counterLabel(docstring const & format,
+
std::set * callers)
 {
docstring label = format;
 
@@ -373,10 +398,11 @@
   && lowercase(label[k]) <= 'z')
++k;
docstring counter = label.substr(j, k - j);
-   docstring repl = theCounter(counter);
+   docstring repl = callers? theCounter(counter, *callers): 
+ theCounter(counter);
label.replace(i, k - j + 4, repl);
}
-   
+
while (true) {
//lyxerr << "label=" << to_utf8(label) << endl;
 
Index: src/Counters.h
===
--- src/Counters.h  (revision 23138)
+++ src/Counters.h  (working copy)
@@ -18,6 +18,7 @@
 #include "support/docstring.h"
 
 #include 
+#include 
 
 
 namespace lyx {
@@ -105,7 +106,8 @@
docstring theCounter(docstring const & c);
/// Replace om format all the LaTeX-like macros that depend on
/// counters.
-   docstring counterLabel(docstring const & format);
+   docstring counterLabel(docstring const & format, 
+ std::set * callers = 0);
/// Are we in apendix?
bool appendix() const { return appendix_; };
/// Set the state variable indicating whether we are in appendix.
@@ -115,6 +117,10 @@
/// Sets the current enclosing float.
void current_float(std::string const & f) { current_float_ = f; }
 private:
+   /// returns the expanded string representation of the counter
+   /// with recursion protection through callers.
+   docstring theCounter(docstring const & c, 
+ std::set & callers);
/// Returns the value of the counter according to the
/// numbering scheme numbertype.
/* Available numbering schemes are arabic (1, 2,...), roman


possible recursion in labelstring for counters

2008-02-22 Thread Bernhard Roider

hello,

yesterday i played around with layout files and created the following counter definition (ok, i 
didn't read the docs carefully enough)


Counter
Name MajorVersion
LabelString  \theMajorVersion.0
End

Using this counter causes lyx to crash because of the recursion in the label string. The attached 
patch catches the recursion and prints a warning message to the console.


ok to commit?

bernhard
Index: src/Counters.cpp
===
--- src/Counters.cpp(revision 23138)
+++ src/Counters.cpp(working copy)
@@ -338,24 +338,51 @@
 }
 
 
-docstring Counters::theCounter(docstring const  counter)
+docstring Counters::theCounter(docstring const  counter,
+  std::setdocstring 
* callers)
 {
if (!hasCounter(counter))
return from_ascii(??);
 
-   Counter const  c = counterList[counter];
-   docstring ls = appendix() ? c.labelStringAppendix() : c.labelString();
+   bool owner = false;
+   if (!callers) {
+   callers = new std::setdocstring;
+   owner = true;
+   }
 
-   if (ls.empty()) {
-   if (!c.master().empty())
-   ls = from_ascii(\\the) + c.master() + from_ascii(.);
-   ls += from_ascii(\\arabic{) + counter + };
+   docstring label;
+
+   if (callers-find(counter) == callers-end()) {
+   
+   pairstd::setdocstring::iterator, bool result = 
callers-insert(counter);
+
+   Counter const  c = counterList[counter];
+   docstring ls = appendix() ? c.labelStringAppendix() : 
c.labelString();
+
+   if (ls.empty()) {
+   if (!c.master().empty())
+   ls = from_ascii(\\the) + c.master() + 
from_ascii(.);
+   ls += from_ascii(\\arabic{) + counter + };
+   }
+   label = counterLabel(ls, callers);
+   callers-erase(result.first);
+   } else {
+   // recursion detected
+   lyxerr  Warning: Recursion in label for counter `
+   counter  ' detected
+   endl;
}
-   return counterLabel(ls);
+
+   if (owner) {
+   delete callers;
+   }
+
+   return label;
 }
 
 
-docstring Counters::counterLabel(docstring const  format)
+docstring Counters::counterLabel(docstring const  format,
+
std::setdocstring * callers)
 {
docstring label = format;
 
@@ -373,10 +400,10 @@
lowercase(label[k]) = 'z')
++k;
docstring counter = label.substr(j, k - j);
-   docstring repl = theCounter(counter);
+   docstring repl = theCounter(counter, callers);
label.replace(i, k - j + 4, repl);
}
-   
+
while (true) {
//lyxerr  label=  to_utf8(label)  endl;
 
Index: src/Counters.h
===
--- src/Counters.h  (revision 23138)
+++ src/Counters.h  (working copy)
@@ -18,6 +18,7 @@
 #include support/docstring.h
 
 #include map
+#include set
 
 
 namespace lyx {
@@ -102,10 +103,12 @@
void copy(Counters  from, Counters  to,
  docstring const  match = docstring());
/// returns the expanded string representation of the counter.
-   docstring theCounter(docstring const  c);
+   docstring theCounter(docstring const  c, 
+ std::setdocstring * callers = 0);
/// Replace om format all the LaTeX-like macros that depend on
/// counters.
-   docstring counterLabel(docstring const  format);
+   docstring counterLabel(docstring const  format, 
+ std::setdocstring * callers = 0);
/// Are we in apendix?
bool appendix() const { return appendix_; };
/// Set the state variable indicating whether we are in appendix.


Re: possible recursion in labelstring for counters

2008-02-22 Thread Bernhard Roider

Andre Poenitz schrieb:

On Sat, Feb 23, 2008 at 12:06:18AM +0100, Bernhard Roider wrote:

hello,

yesterday i played around with layout files and created the following 
counter definition (ok, i didn't read the docs carefully enough)


Counter
Name MajorVersion
LabelString  \theMajorVersion.0
End

Using this counter causes lyx to crash because of the recursion in the 
label string. The attached patch catches the recursion and prints a warning 
message to the console.


ok to commit?

bernhard



Index: src/Counters.cpp
===
--- src/Counters.cpp(revision 23138)
+++ src/Counters.cpp(working copy)
@@ -338,24 +338,51 @@
 }
 
 
-docstring Counters::theCounter(docstring const  counter)

+docstring Counters::theCounter(docstring const  counter,
+  std::setdocstring 
* callers)
 {
if (!hasCounter(counter))
return from_ascii(??);
 
-	Counter const  c = counterList[counter];

-   docstring ls = appendix() ? c.labelStringAppendix() : c.labelString();
+   bool owner = false;
+   if (!callers) {
+   callers = new std::setdocstring;
+   owner = true;
+   }


Hm... what about

docstring Counters::theCounter(docstring const  counter)
{
 std::setdocstrin callers;
 return theCounter(counter, callers);
}

docstring Counters::theCounter(docstring const  counter,
std::setdocstring  callers)
{
[...]
}

etc instead of the owner/new/delete logic?

Andre'



you are right, allocation on the stack is really better here...

bernhard


Index: src/paragraph.C
===
--- src/paragraph.C (revision 17140)
+++ src/paragraph.C (working copy)
@@ -601,8 +601,17 @@
 }
 
 
-char Paragraph::getAlign() const
+void Paragraph::setAlign(LyXAlignment align)
 {
+   if (align == LYX_ALIGN_LAYOUT || align == layout()-align)
+   params().align(LYX_ALIGN_LAYOUT);
+   else if (align  layout()-alignpossible)
+   params().align(align);
+}
+
+
+LyXAlignment Paragraph::getAlign() const
+{
if (params().align() == LYX_ALIGN_LAYOUT)
return layout()-align;
else
Index: src/paragraph.h
===
--- src/paragraph.h (revision 17140)
+++ src/paragraph.h (working copy)
@@ -21,6 +21,7 @@
 #include InsetList.h
 #include lyxlayout_ptr_fwd.h
 #include RowList_fwd.h
+#include layout.h
 
 #include insets/insetbase.h // only for InsetBase::Code
 
@@ -237,7 +238,10 @@
docstring expandLabel(LyXLayout_ptr const , BufferParams const ,
bool process_appendix = true) const;
/// Actual paragraph alignment used
-   char getAlign() const;
+   LyXAlignment getAlign() const;
+   /// Set the paragraph alignment if it is allowed by the layout
+   void setAlign(LyXAlignment align);
+
/// The nesting depth of a paragraph
depth_type getDepth() const;
/// The maximal possible depth of a paragraph after this one
Index: src/text2.C
===
--- src/text2.C (revision 17140)
+++ src/text2.C (working copy)
@@ -604,18 +604,7 @@
Paragraph  par = pars_[pit];
ParagraphParameters  params = par.params();
params.spacing(spacing);
-
-   // does the layout allow the new alignment?
-   LyXLayout_ptr const  layout = par.layout();
-
-   if (align == LYX_ALIGN_LAYOUT)
-   align = layout-align;
-   if (align  layout-alignpossible) {
-   if (align == layout-align)
-   params.align(LYX_ALIGN_LAYOUT);
-   else
-   params.align(align);
-   }
+   par.setAlign(align);
par.setLabelWidthString(labelwidthstring);
params.noindent(noindent);
}
Index: src/text3.C
===
--- src/text3.C (revision 17140)
+++ src/text3.C (working copy)
@@ -1229,10 +1229,11 @@
// paragraph at the bottom so that the user can choose where to 
put
// the graphics (or table).
if (!content) {
+   pars[0].setAlign(LYX_ALIGN_CENTER);
pars.push_back(Paragraph());
pars.back().setInsetOwner(pars[0].inInset());
pars.back().layout(tclass.defaultLayout());
-   
+   pars.back().setAlign(LYX_ALIGN_CENTER);
}
 
// reposition the cursor to the caption


possible recursion in labelstring for counters

2008-02-22 Thread Bernhard Roider

hello,

yesterday i played around with layout files and created the following counter definition (ok, i 
didn't read the docs carefully enough)


Counter
Name MajorVersion
LabelString  "\theMajorVersion.0"
End

Using this counter causes lyx to crash because of the recursion in the label string. The attached 
patch catches the recursion and prints a warning message to the console.


ok to commit?

bernhard
Index: src/Counters.cpp
===
--- src/Counters.cpp(revision 23138)
+++ src/Counters.cpp(working copy)
@@ -338,24 +338,51 @@
 }
 
 
-docstring Counters::theCounter(docstring const & counter)
+docstring Counters::theCounter(docstring const & counter,
+  std::set 
* callers)
 {
if (!hasCounter(counter))
return from_ascii("??");
 
-   Counter const & c = counterList[counter];
-   docstring ls = appendix() ? c.labelStringAppendix() : c.labelString();
+   bool owner = false;
+   if (!callers) {
+   callers = new std::set;
+   owner = true;
+   }
 
-   if (ls.empty()) {
-   if (!c.master().empty())
-   ls = from_ascii("\\the") + c.master() + from_ascii(".");
-   ls += from_ascii("\\arabic{") + counter + "}";
+   docstring label;
+
+   if (callers->find(counter) == callers->end()) {
+   
+   pair result = 
callers->insert(counter);
+
+   Counter const & c = counterList[counter];
+   docstring ls = appendix() ? c.labelStringAppendix() : 
c.labelString();
+
+   if (ls.empty()) {
+   if (!c.master().empty())
+   ls = from_ascii("\\the") + c.master() + 
from_ascii(".");
+   ls += from_ascii("\\arabic{") + counter + "}";
+   }
+   label = counterLabel(ls, callers);
+   callers->erase(result.first);
+   } else {
+   // recursion detected
+   lyxerr << "Warning: Recursion in label for counter `"
+  << counter << "' detected"
+  << endl;
}
-   return counterLabel(ls);
+
+   if (owner) {
+   delete callers;
+   }
+
+   return label;
 }
 
 
-docstring Counters::counterLabel(docstring const & format)
+docstring Counters::counterLabel(docstring const & format,
+
std::set * callers)
 {
docstring label = format;
 
@@ -373,10 +400,10 @@
   && lowercase(label[k]) <= 'z')
++k;
docstring counter = label.substr(j, k - j);
-   docstring repl = theCounter(counter);
+   docstring repl = theCounter(counter, callers);
label.replace(i, k - j + 4, repl);
}
-   
+
while (true) {
//lyxerr << "label=" << to_utf8(label) << endl;
 
Index: src/Counters.h
===
--- src/Counters.h  (revision 23138)
+++ src/Counters.h  (working copy)
@@ -18,6 +18,7 @@
 #include "support/docstring.h"
 
 #include 
+#include 
 
 
 namespace lyx {
@@ -102,10 +103,12 @@
void copy(Counters & from, Counters & to,
  docstring const & match = docstring());
/// returns the expanded string representation of the counter.
-   docstring theCounter(docstring const & c);
+   docstring theCounter(docstring const & c, 
+ std::set * callers = 0);
/// Replace om format all the LaTeX-like macros that depend on
/// counters.
-   docstring counterLabel(docstring const & format);
+   docstring counterLabel(docstring const & format, 
+ std::set * callers = 0);
/// Are we in apendix?
bool appendix() const { return appendix_; };
/// Set the state variable indicating whether we are in appendix.


Re: possible recursion in labelstring for counters

2008-02-22 Thread Bernhard Roider

Andre Poenitz schrieb:

On Sat, Feb 23, 2008 at 12:06:18AM +0100, Bernhard Roider wrote:

hello,

yesterday i played around with layout files and created the following 
counter definition (ok, i didn't read the docs carefully enough)


Counter
Name MajorVersion
LabelString  "\theMajorVersion.0"
End

Using this counter causes lyx to crash because of the recursion in the 
label string. The attached patch catches the recursion and prints a warning 
message to the console.


ok to commit?

bernhard



Index: src/Counters.cpp
===
--- src/Counters.cpp(revision 23138)
+++ src/Counters.cpp(working copy)
@@ -338,24 +338,51 @@
 }
 
 
-docstring Counters::theCounter(docstring const & counter)

+docstring Counters::theCounter(docstring const & counter,
+  std::set 
* callers)
 {
if (!hasCounter(counter))
return from_ascii("??");
 
-	Counter const & c = counterList[counter];

-   docstring ls = appendix() ? c.labelStringAppendix() : c.labelString();
+   bool owner = false;
+   if (!callers) {
+   callers = new std::set;
+   owner = true;
+   }


Hm... what about

docstring Counters::theCounter(docstring const & counter)
{
 std::set callers;
 return theCounter(counter, callers);
}

docstring Counters::theCounter(docstring const & counter,
std::set & callers)
{
[...]
}

etc instead of the owner/new/delete logic?

Andre'



you are right, allocation on the stack is really better here...

bernhard


Index: src/paragraph.C
===
--- src/paragraph.C (revision 17140)
+++ src/paragraph.C (working copy)
@@ -601,8 +601,17 @@
 }
 
 
-char Paragraph::getAlign() const
+void Paragraph::setAlign(LyXAlignment align)
 {
+   if (align == LYX_ALIGN_LAYOUT || align == layout()->align)
+   params().align(LYX_ALIGN_LAYOUT);
+   else if (align & layout()->alignpossible)
+   params().align(align);
+}
+
+
+LyXAlignment Paragraph::getAlign() const
+{
if (params().align() == LYX_ALIGN_LAYOUT)
return layout()->align;
else
Index: src/paragraph.h
===
--- src/paragraph.h (revision 17140)
+++ src/paragraph.h (working copy)
@@ -21,6 +21,7 @@
 #include "InsetList.h"
 #include "lyxlayout_ptr_fwd.h"
 #include "RowList_fwd.h"
+#include "layout.h"
 
 #include "insets/insetbase.h" // only for InsetBase::Code
 
@@ -237,7 +238,10 @@
docstring expandLabel(LyXLayout_ptr const &, BufferParams const &,
bool process_appendix = true) const;
/// Actual paragraph alignment used
-   char getAlign() const;
+   LyXAlignment getAlign() const;
+   /// Set the paragraph alignment if it is allowed by the layout
+   void setAlign(LyXAlignment align);
+
/// The nesting depth of a paragraph
depth_type getDepth() const;
/// The maximal possible depth of a paragraph after this one
Index: src/text2.C
===
--- src/text2.C (revision 17140)
+++ src/text2.C (working copy)
@@ -604,18 +604,7 @@
Paragraph & par = pars_[pit];
ParagraphParameters & params = par.params();
params.spacing(spacing);
-
-   // does the layout allow the new alignment?
-   LyXLayout_ptr const & layout = par.layout();
-
-   if (align == LYX_ALIGN_LAYOUT)
-   align = layout->align;
-   if (align & layout->alignpossible) {
-   if (align == layout->align)
-   params.align(LYX_ALIGN_LAYOUT);
-   else
-   params.align(align);
-   }
+   par.setAlign(align);
par.setLabelWidthString(labelwidthstring);
params.noindent(noindent);
}
Index: src/text3.C
===
--- src/text3.C (revision 17140)
+++ src/text3.C (working copy)
@@ -1229,10 +1229,11 @@
// paragraph at the bottom so that the user can choose where to 
put
// the graphics (or table).
if (!content) {
+   pars[0].setAlign(LYX_ALIGN_CENTER);
pars.push_back(Paragraph());
pars.back().setInsetOwner(pars[0].inInset());
pars.back().layout(tclass.defaultLayout());
-   
+   pars.back().setAlign(LYX_ALIGN_CENTER);
}
 
// reposition the cursor to the caption


Re: Aussie is *slow*

2008-02-06 Thread Bernhard Roider

[EMAIL PROTECTED] schrieb:

On Tue, 5 Feb 2008, Abdelrazak Younes wrote:


rgheck wrote:


 As Andre suggested, another option would be to require forwarding, and
 then people can sort out their own spam.


Yes, I think that's the simplest and most useful solution.


Is this just a matter of adding the file

~/.forward

that contains a single line with your email address?


i tried that a while ago but it didn't work. maybe the access rights where not 
set correct?
lars told me i should use ~/.procmailrc which works.

bernhard


(it's been so long since I did that, so I don't remember)

/C





Re: Aussie is *slow*

2008-02-06 Thread Bernhard Roider

[EMAIL PROTECTED] schrieb:

On Tue, 5 Feb 2008, Abdelrazak Younes wrote:


rgheck wrote:


 As Andre suggested, another option would be to require forwarding, and
 then people can sort out their own spam.


Yes, I think that's the simplest and most useful solution.


Is this just a matter of adding the file

~/.forward

that contains a single line with your email address?


i tried that a while ago but it didn't work. maybe the access rights where not 
set correct?
lars told me i should use ~/.procmailrc which works.

bernhard


(it's been so long since I did that, so I don't remember)

/C





Re: Aussie is *slow*

2008-02-05 Thread Bernhard Roider

Pavel Sanda schrieb:

On Mon, 4 Feb 2008, rgheck wrote:


 looking at the RES memory usage, the main consumers are these. what if
 we start by running less childerns of spamd?

   59m   2:32.53 spamd   57m   0:52.08 spamd
   37m   1:48.72 spamd

Do we even need 'spamd'?   I mean, does it serve a useful purpose on
aussie?


i guess its purpose is to filter spam from [EMAIL PROTECTED] address and not 
doing
this filter would mean megabytes of disk space on aussie every day because many
people dont forward their mails etc.


shouldn't it be possible to restrict the mailbox size per user?

bernhard



We should check on which addresses it is run. I suspect there is one
instance per mail address...


afaik spamd has fixed number of childs (here 3); so its just to change this
parameter in config.

pavel





Re: Aussie is *slow*

2008-02-05 Thread Bernhard Roider

Pavel Sanda schrieb:

On Mon, 4 Feb 2008, rgheck wrote:


 looking at the RES memory usage, the main consumers are these. what if
 we start by running less childerns of spamd?

   59m   2:32.53 spamd   57m   0:52.08 spamd
   37m   1:48.72 spamd

Do we even need 'spamd'?   I mean, does it serve a useful purpose on
aussie?


i guess its purpose is to filter spam from [EMAIL PROTECTED] address and not 
doing
this filter would mean megabytes of disk space on aussie every day because many
people dont forward their mails etc.


shouldn't it be possible to restrict the mailbox size per user?

bernhard



We should check on which addresses it is run. I suspect there is one
instance per mail address...


afaik spamd has fixed number of childs (here 3); so its just to change this
parameter in config.

pavel





Re: [Cvslog] r22675 - /lyx-devel/trunk/src/BufferView.cpp

2008-01-27 Thread Bernhard Roider

Abdelrazak Younes schrieb:

rgheck wrote:

Stefan Schimanski wrote:


Am 26.01.2008 um 21:22 schrieb Bernhard Roider:


[EMAIL PROTECTED] schrieb:

Author: sts
Date: Sat Jan 26 01:47:22 2008
New Revision: 22675

URL: http://www.lyx.org/trac/changeset/22675
Log:
* fix random jumps when scrolling very fast using a touchpad or 
mouse wheel.





Does this one apply to trunk also?



You mean to the 1.5 branch?



That's what i meant.

Good question. Abdel might know more because he changed a lot with 
scrolling. I only touched one of the functions, but for smooth 
scrolling a lot more might be needed.


Yes, Abdel will answer, but I'll guess that so much work has been done 
here that it won't apply to branch.


Good guess Richard and nice work Stefan!


hm. 1.5.x also jumps around in the document during fast scrolling and so i thought it could be the 
same reason.


Bernhard



Re: [Cvslog] r22675 - /lyx-devel/trunk/src/BufferView.cpp

2008-01-27 Thread Bernhard Roider

Abdelrazak Younes schrieb:

rgheck wrote:

Stefan Schimanski wrote:


Am 26.01.2008 um 21:22 schrieb Bernhard Roider:


[EMAIL PROTECTED] schrieb:

Author: sts
Date: Sat Jan 26 01:47:22 2008
New Revision: 22675

URL: http://www.lyx.org/trac/changeset/22675
Log:
* fix random jumps when scrolling very fast using a touchpad or 
mouse wheel.





Does this one apply to trunk also?



You mean to the 1.5 branch?



That's what i meant.

Good question. Abdel might know more because he changed a lot with 
scrolling. I only touched one of the functions, but for smooth 
scrolling a lot more might be needed.


Yes, Abdel will answer, but I'll guess that so much work has been done 
here that it won't apply to branch.


Good guess Richard and nice work Stefan!


hm. 1.5.x also jumps around in the document during fast scrolling and so i thought it could be the 
same reason.


Bernhard



Re: [Cvslog] r22675 - /lyx-devel/trunk/src/BufferView.cpp

2008-01-26 Thread Bernhard Roider

[EMAIL PROTECTED] schrieb:

Author: sts
Date: Sat Jan 26 01:47:22 2008
New Revision: 22675

URL: http://www.lyx.org/trac/changeset/22675
Log:
* fix random jumps when scrolling very fast using a touchpad or mouse wheel.

  


Does this one apply to trunk also?

bernhard



Re: [Cvslog] r22675 - /lyx-devel/trunk/src/BufferView.cpp

2008-01-26 Thread Bernhard Roider

[EMAIL PROTECTED] schrieb:

Author: sts
Date: Sat Jan 26 01:47:22 2008
New Revision: 22675

URL: http://www.lyx.org/trac/changeset/22675
Log:
* fix random jumps when scrolling very fast using a touchpad or mouse wheel.

  


Does this one apply to trunk also?

bernhard



support for bm.sty?

2008-01-24 Thread Bernhard Roider

Hello,

how difficult would it be to add support for the bm package (i.e. bold greek in math) and display it 
correct when editing formulas?


bernhard



support for bm.sty?

2008-01-24 Thread Bernhard Roider

Hello,

how difficult would it be to add support for the bm package (i.e. bold greek in math) and display it 
correct when editing formulas?


bernhard



Re: r22565 - /lyx-devel/trunk/src/LyXAction.cpp

2008-01-15 Thread Bernhard Roider

Abdelrazak Younes schrieb:

[EMAIL PROTECTED] wrote:

Author: rgheck
Date: Mon Jan 14 23:22:07 2008
New Revision: 22565

 { LFUN_CAPTION_INSERT, caption-insert, Noop, Edit },
 { LFUN_DATE_INSERT, date-insert, Noop, Edit },
 { LFUN_FOOTNOTE_INSERT, footnote-insert, Noop, Edit },
 { LFUN_ERT_INSERT, ert-insert, Noop, Edit },
 { LFUN_FLOAT_INSERT, float-insert, Noop, Edit },
 { LFUN_FLOAT_WIDE_INSERT, float-wide-insert, Noop, Edit },


Couldn't we merge all those LFUNs into one LFUN_INSERT_INSET?

insert caption instead of caption-insert
insert footnote instead of footnote-insert
etc



some of them are covered by inset-insert. try e.g.
inset-insert ert
inset-insert ert 0
inset-insert ert 1
inset-insert ert 2
...

bernhard



Re: r22565 - /lyx-devel/trunk/src/LyXAction.cpp

2008-01-15 Thread Bernhard Roider

Abdelrazak Younes schrieb:

[EMAIL PROTECTED] wrote:

Author: rgheck
Date: Mon Jan 14 23:22:07 2008
New Revision: 22565

 { LFUN_CAPTION_INSERT, "caption-insert", Noop, Edit },
 { LFUN_DATE_INSERT, "date-insert", Noop, Edit },
 { LFUN_FOOTNOTE_INSERT, "footnote-insert", Noop, Edit },
 { LFUN_ERT_INSERT, "ert-insert", Noop, Edit },
 { LFUN_FLOAT_INSERT, "float-insert", Noop, Edit },
 { LFUN_FLOAT_WIDE_INSERT, "float-wide-insert", Noop, Edit },


Couldn't we merge all those LFUNs into one LFUN_INSERT_INSET?

"insert caption" instead of "caption-insert"
"insert footnote" instead of "footnote-insert"
etc



some of them are covered by inset-insert. try e.g.
inset-insert ert
inset-insert ert 0
inset-insert ert 1
inset-insert ert 2
...

bernhard



Re: [Cvslog] r22556 - /lyx-devel/trunk/src/LyXAction.cpp

2008-01-14 Thread Bernhard Roider
it's basically an alias for an lfun, but it has two big advantages (mainly if the lfun is 
complicated, see e.g. http://wiki.lyx.org/Tips/CommandSequences):
1. the complicated part has to be written only once and can then be used in menu, toolbar or bind 
file (- easier to change)
2. the name of the toolbar image for the lfun is derived from CMDNAME (try to add the lfun 
command-sequence word-select; cut; ert-insert; self-insert \; paste; self-insert {}; inset-toggle; 
directly to a toolbar and assign an image to it!)


bernhard

Pavel Sanda schrieb:

Author: broider
Date: Mon Jan 14 20:37:52 2008
New Revision: 22556

* \var lyx::kb_action lyx::LFUN_CALL
* \li Action: Executes a command defined in a .def file.
* \li Syntax: call CMDNAME
* \li Params: CMDNAME: Name of the command that must be called.
* \li Origin: broider, 2 Oct 2007



what is the point of this lfun? only name aliasing? or more lfuns
can be run as one CMDNAME?

pavel





Re: [Cvslog] r22556 - /lyx-devel/trunk/src/LyXAction.cpp

2008-01-14 Thread Bernhard Roider
it's basically an alias for an lfun, but it has two big advantages (mainly if the lfun is 
complicated, see e.g. http://wiki.lyx.org/Tips/CommandSequences):
1. the complicated part has to be written only once and can then be used in menu, toolbar or bind 
file (-> easier to change)
2. the name of the toolbar image for the lfun is derived from  (try to add the lfun 
"command-sequence word-select; cut; ert-insert; self-insert \; paste; self-insert {}; inset-toggle;" 
directly to a toolbar and assign an image to it!)


bernhard

Pavel Sanda schrieb:

Author: broider
Date: Mon Jan 14 20:37:52 2008
New Revision: 22556

* \var lyx::kb_action lyx::LFUN_CALL
* \li Action: Executes a command defined in a .def file.
* \li Syntax: call 
* \li Params: : Name of the command that must be called.
* \li Origin: broider, 2 Oct 2007



what is the point of this lfun? only name aliasing? or more lfuns
can be run as one CMDNAME?

pavel





Re: LyX 1.5 Patch Candidate List #13

2007-12-14 Thread Bernhard Roider


http://www.lyx.org/trac/changeset/22133 - broider- Correct func_type 
for LFUN_MATH_INSERT


not relevant

bernhard



Re: LyX 1.5 Patch Candidate List #13

2007-12-14 Thread Bernhard Roider


http://www.lyx.org/trac/changeset/22133 - broider- Correct func_type 
for LFUN_MATH_INSERT


not relevant

bernhard



LFUN_MATH_INSERT func_type

2007-12-12 Thread Bernhard Roider

Hello,

shouldn't LFUN_MATH_INSERT have func_type Math instead of Edit?

see LyXAction.cpp around line 221:

{ LFUN_MATH_DELIM, math-delim, Noop, Math },
{ LFUN_MATH_BIGDELIM, math-bigdelim, Noop, Math },
{ LFUN_MATH_DISPLAY, math-display, Noop, Math },
{ LFUN_MATH_INSERT, math-insert, Noop, Edit },
{ LFUN_MATH_SUBSCRIPT, math-subscript, Noop, Math },
{ LFUN_MATH_SUPERSCRIPT, math-superscript, Noop, Math },


Bernhard



LFUN_MATH_INSERT func_type

2007-12-12 Thread Bernhard Roider

Hello,

shouldn't LFUN_MATH_INSERT have func_type Math instead of Edit?

see LyXAction.cpp around line 221:

{ LFUN_MATH_DELIM, "math-delim", Noop, Math },
{ LFUN_MATH_BIGDELIM, "math-bigdelim", Noop, Math },
{ LFUN_MATH_DISPLAY, "math-display", Noop, Math },
{ LFUN_MATH_INSERT, "math-insert", Noop, Edit },
{ LFUN_MATH_SUBSCRIPT, "math-subscript", Noop, Math },
{ LFUN_MATH_SUPERSCRIPT, "math-superscript", Noop, Math },


Bernhard



Re: Patch Candidate List #10

2007-11-14 Thread Bernhard Roider



http://www.lyx.org/trac/changeset/21542 - add missing case LyXRC::RC_DEFFILE 
(and shut up compiler)


no: CmdDef is not in branch



Re: Patch Candidate List #10

2007-11-14 Thread Bernhard Roider



http://www.lyx.org/trac/changeset/21542 - add missing case LyXRC::RC_DEFFILE 
(and shut up compiler)


no: CmdDef is not in branch



Re: [Cvslog] r21542 - /lyx-devel/trunk/src/LyXFunc.cpp

2007-11-10 Thread Bernhard Roider

[EMAIL PROTECTED] schrieb:

Author: spitz
Date: Sat Nov 10 12:22:19 2007
New Revision: 21542

URL: http://www.lyx.org/trac/changeset/21542
Log:
* src/LyXFunc.cpp (actOnUpdatedPrefs): 
	- add missing case LyXRC::RC_DEFFILE (and shut up compiler)


  

so there was still another case missing. cas this warning be enabled for
msvc?

bernhard




Re: [Cvslog] r21542 - /lyx-devel/trunk/src/LyXFunc.cpp

2007-11-10 Thread Bernhard Roider

[EMAIL PROTECTED] schrieb:

Author: spitz
Date: Sat Nov 10 12:22:19 2007
New Revision: 21542

URL: http://www.lyx.org/trac/changeset/21542
Log:
* src/LyXFunc.cpp (actOnUpdatedPrefs): 
	- add missing case LyXRC::RC_DEFFILE (and shut up compiler)


  

so there was still another case missing. cas this warning be enabled for
msvc?

bernhard




Re: [Cvslog] r21445 - /lyx-devel/branches/BRANCH_1_5_X/src/mathed/Math...

2007-11-05 Thread Bernhard Roider

Jürgen Spitzmüller schrieb:

broider wrote:

+   else
+   added = addRow(grid, cellrow, docstring());


Is there a reason why you did this differently in branch and trunk?

Jürgen


no, i did this by accident. will correct it

bernhard



Re: Where to report bugs?

2007-11-05 Thread Bernhard Roider

Richard Heck schrieb:

sebastian guttenberg wrote:

Shall I report bug's here or directly at bugzilla?
  
There's no fixed rule. But if it's a relatively minor thing, then I'd go 
to bugzilla. If it's a crash, or if it's significant enough that it 
prevents you from getting work done, then report it here, the idea being 
that perhaps it can be addressed sooner rather than later.




i would say file a bug report at bugzilla and if it is significant then write a mail to the list 
referring to the bug #.


bernhard



Re: [Cvslog] r21445 - /lyx-devel/branches/BRANCH_1_5_X/src/mathed/Math...

2007-11-05 Thread Bernhard Roider

Jürgen Spitzmüller schrieb:

broider wrote:

+   else
+   added = addRow(grid, cellrow, docstring());


Is there a reason why you did this differently in branch and trunk?

Jürgen


no, i did this by accident. will correct it

bernhard



Re: Where to report bugs?

2007-11-05 Thread Bernhard Roider

Richard Heck schrieb:

sebastian guttenberg wrote:

Shall I report bug's here or directly at bugzilla?
  
There's no fixed rule. But if it's a relatively minor thing, then I'd go 
to bugzilla. If it's a crash, or if it's significant enough that it 
prevents you from getting work done, then report it here, the idea being 
that perhaps it can be addressed sooner rather than later.




i would say file a bug report at bugzilla and if it is significant then write a mail to the list 
referring to the bug #.


bernhard



Re: [Cvslog] r21420 - /lyx-devel/trunk/src/LyXRC.cpp

2007-11-04 Thread Bernhard Roider

[EMAIL PROTECTED] schrieb:

Author: spitz
Date: Sun Nov  4 12:29:12 2007
New Revision: 21420

URL: http://www.lyx.org/trac/changeset/21420
Log:
* src/LyXRC.cpp: shut up compiler.

  

hello,
as i have 3 evenings to spend i just sat down to my computer to fix that
- too late as i see. but there is a question i have concerning that
code: why does the compiler look at that code at all? it's commented out
with #if 0 ... #endif! i guess that (and the fact that msvc is quiet) is
the reason why i didn't have a closer look at it before.

bernhard

+   case RC_DEFFILE:
+   //FIXME: fix description.
+   str = _(Command definition file.);
+   break;
+
  





[PATCH] Fix Bug 4301: crash on bookmark in ERT

2007-11-04 Thread Bernhard Roider

hello,

the attached patch fixes bug 4301:
in fact BufferView::moveToPosition(..) failed for every position inside an inset because 
buffer_-text() was used instead of cursor_.text() to set the current font.


ok, jürgen?

bernhard
Index: src/BufferView.cpp
===
--- src/BufferView.cpp  (revision 21421)
+++ src/BufferView.cpp  (working copy)
@@ -546,7 +546,7 @@
break;
}
setCursor(dit);
-   buffer_-text().setCurrentFont(cursor_);
+   cursor_.text()-setCurrentFont(cursor_);
// Note: return bottom (document) level pit.
return boost::make_tuple(cursor_.bottom().pit(), 
cursor_.bottom().pos(), top_id);
}
@@ -562,7 +562,7 @@
it.pit() = bottom_pit;
it.pos() = min(bottom_pos, it.paragraph().size());
setCursor(it);
-   buffer_-text().setCurrentFont(cursor_);
+   cursor_.text()-setCurrentFont(cursor_);
return boost::make_tuple(it.pit(), it.pos(),
 it.paragraph().id());
}


aussie is really slow

2007-11-04 Thread Bernhard Roider

and bugzilla does not respond

i logged on with ssh and saw that there are many httpd tasks in uninterruptible 
sleep mode

bernhard



Re: aussie is really slow

2007-11-04 Thread Bernhard Roider

Dov Feldstern schrieb:

Bernhard Roider wrote:

and bugzilla does not respond

i logged on with ssh and saw that there are many httpd tasks in 
uninterruptible sleep mode


bernhard




Hurry up and download your own, personal copy of the lyx repository 
while aussie is still alive!




the problem is: i want to access bugzilla. is there anybody out who can restart 
httpd on aussie?

bernhard



Re: [Bug 4318] New: crash when pasting to formula

2007-11-04 Thread Bernhard Roider

Jürgen Spitzmüller schrieb:

Andre Poenitz wrote:

We definitely should switch to a more user friendly error handling then
plain crashs. While it might be annoying that one cannot properly paste
form the clipboard we should not crash...


On Linux, it only crashes with --enable-stdlib-debug. The attached patch fixes 
this particular crash for me, but it's rater a shot in the dark.


Does it make sense, André?



what about the attached patch?

bernhard
Index: src/mathed/MathParser.cpp
===
--- src/mathed/MathParser.cpp   (revision 21421)
+++ src/mathed/MathParser.cpp   (working copy)
@@ -1018,12 +1018,14 @@
else if (t.cs() == \\) {
if (flags  FLAG_ALIGN)
return;
-   bool added;
+   bool added = false;
if (nextToken().asInput() == *) {
getToken();
added = addRow(grid, cellrow, docstring(), 
false);
-   } else
+   } else if (good())
added = addRow(grid, cellrow, getArg('[', ']'));
+   else
+   error(missing token after );
if (added) {
cellcol = 0;
if (grid.asHullInset())


Re: [Cvslog] r21420 - /lyx-devel/trunk/src/LyXRC.cpp

2007-11-04 Thread Bernhard Roider

[EMAIL PROTECTED] schrieb:

Author: spitz
Date: Sun Nov  4 12:29:12 2007
New Revision: 21420

URL: http://www.lyx.org/trac/changeset/21420
Log:
* src/LyXRC.cpp: shut up compiler.

  

hello,
as i have 3 evenings to spend i just sat down to my computer to fix that
- too late as i see. but there is a question i have concerning that
code: why does the compiler look at that code at all? it's commented out
with #if 0 ... #endif! i guess that (and the fact that msvc is quiet) is
the reason why i didn't have a closer look at it before.

bernhard

+   case RC_DEFFILE:
+   //FIXME: fix description.
+   str = _("Command definition file.");
+   break;
+
  





[PATCH] Fix Bug 4301: crash on bookmark in ERT

2007-11-04 Thread Bernhard Roider

hello,

the attached patch fixes bug 4301:
in fact BufferView::moveToPosition(..) failed for every position inside an inset because 
buffer_->text() was used instead of cursor_.text() to set the current font.


ok, jürgen?

bernhard
Index: src/BufferView.cpp
===
--- src/BufferView.cpp  (revision 21421)
+++ src/BufferView.cpp  (working copy)
@@ -546,7 +546,7 @@
break;
}
setCursor(dit);
-   buffer_->text().setCurrentFont(cursor_);
+   cursor_.text()->setCurrentFont(cursor_);
// Note: return bottom (document) level pit.
return boost::make_tuple(cursor_.bottom().pit(), 
cursor_.bottom().pos(), top_id);
}
@@ -562,7 +562,7 @@
it.pit() = bottom_pit;
it.pos() = min(bottom_pos, it.paragraph().size());
setCursor(it);
-   buffer_->text().setCurrentFont(cursor_);
+   cursor_.text()->setCurrentFont(cursor_);
return boost::make_tuple(it.pit(), it.pos(),
 it.paragraph().id());
}


aussie is really slow

2007-11-04 Thread Bernhard Roider

and bugzilla does not respond

i logged on with ssh and saw that there are many httpd tasks in uninterruptible 
sleep mode

bernhard



  1   2   3   4   5   6   >