Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
On Wed, Feb 05, 2003 at 11:47:15AM +0100, Michael Abshoff wrote: > The patch works for me, please apply. Done. Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Wed, Feb 05, 2003 at 11:47:15AM +0100, Michael Abshoff wrote: | > >>On Fri, Jan 31, 2003 at 01:05:13PM +0100, Lars Gullik Bjønnes wrote: | > >>Michael, please test. | > > | > Sorry for the delay, but I am currently swamped with work. | > | > The patch works for me, please apply. | | This is the second 'works for me' for #860. | | Ok to apply? Yes. -- Lgb
Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
On Wed, Feb 05, 2003 at 11:47:15AM +0100, Michael Abshoff wrote: > >>On Fri, Jan 31, 2003 at 01:05:13PM +0100, Lars Gullik Bjønnes wrote: > >>Michael, please test. > > > Sorry for the delay, but I am currently swamped with work. > > The patch works for me, please apply. This is the second 'works for me' for #860. Ok to apply? Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
Michael Abshoff wrote: Andre Poenitz wrote: On Fri, Jan 31, 2003 at 01:05:13PM +0100, Lars Gullik Bjønnes wrote: Michael, please test. Sorry for the delay, but I am currently swamped with work. The patch works for me, please apply. Michael -- Michael Abshoff - MRB - Universität Dortmund - Telefon 755-3463 (intern) Where do you want to RTFM today?
Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Fri, Jan 31, 2003 at 01:05:13PM +0100, Lars Gullik Bjønnes wrote: | > Can you get Michael to test this first? | | Michael, please test. | | > I'd really like to know if the reporter of the problem also see it | > fixed by this patch. | | [Usually I'd put that in the "obviously correct" corner. It fixes the | problem in the file Michael sent us] I would too... but not now. -- Lgb
Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes: Andre> On Fri, Jan 31, 2003 at 12:43:14PM +0100, Michael Abshoff Andre> wrote: >> Thanks. Could you also apply it to 1.2.x cvs? Andre> Possibly. But I guess there won't be 1.2.x releases anymore. As far as I am concerned, I have stopped making changes to the 1.2.x branch. Unless something really horrible surfaces in 1.2.3, it will be the last. JMarc
Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
Andre Poenitz wrote: On Fri, Jan 31, 2003 at 01:05:13PM +0100, Lars Gullik Bjønnes wrote: Can you get Michael to test this first? Michael, please test. I'd really like to know if the reporter of the problem also see it fixed by this patch. [Usually I'd put that in the "obviously correct" corner. It fixes the problem in the file Michael sent us] Andre' I will give it a shot this afternoon and report back. Michael -- Michael Abshoff - MRB - Universität Dortmund - Telefon 755-3463 (intern) Where do you want to RTFM today?
Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
On Fri, Jan 31, 2003 at 01:05:13PM +0100, Lars Gullik Bjønnes wrote: > Can you get Michael to test this first? Michael, please test. > I'd really like to know if the reporter of the problem also see it > fixed by this patch. [Usually I'd put that in the "obviously correct" corner. It fixes the problem in the file Michael sent us] Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Fri, Jan 31, 2003 at 11:42:04AM +0100, Michael Abshoff wrote: | > up to lyx-1.1.6fix4 it was possible to specify an optional argument for | > xrightarrow, i.e. \xrightarrow[optinal]{blah}. | | Looks like this inset was forgotten at some point of time. | | > Are there any clever ways besides writing a macro for xrigtharrow | > to fix that problem? | | Urm, yes. The attached patch fixes the problem properly. | | Lars: This is a fix for a regression and should not touch anything | not directly related with xrightarrow and xleftarrow. Ok to apply? Can you get Michael to test this first? I'd really like to know if the reporter of the problem also see it fixed by this patch. -- Lgb
Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
Andre Poenitz wrote: On Fri, Jan 31, 2003 at 12:43:14PM +0100, Michael Abshoff wrote: Thanks. Could you also apply it to 1.2.x cvs? Possibly. But I guess there won't be 1.2.x releases anymore. Andre' That might be so. When I look at the different versions of lyx in the major distributions, especially SuSE in Germany, I am under the impression that "they" are usually a release or two behind. IE Suse 8.0 shipped with somehting like 1.1.6fix2 when 1.2.[01] was available and SuSE 8.1 shipped with something post 1.20 but pre 1.2.1 when 1.2.2 was there. That is pretty pathetic in my world. I hope that they get there act together - it is not that difficult to install several lyx-versions in parallel. -- Michael Abshoff - MRB - Universität Dortmund - Telefon 755-3463 (intern) Where do you want to RTFM today?
Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
On Fri, Jan 31, 2003 at 12:43:14PM +0100, Michael Abshoff wrote: > Thanks. Could you also apply it to 1.2.x cvs? Possibly. But I guess there won't be 1.2.x releases anymore. Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
Andre Poenitz wrote: On Fri, Jan 31, 2003 at 11:42:04AM +0100, Michael Abshoff wrote: up to lyx-1.1.6fix4 it was possible to specify an optional argument for xrightarrow, i.e. \xrightarrow[optinal]{blah}. Looks like this inset was forgotten at some point of time. Are there any clever ways besides writing a macro for xrigtharrow to fix that problem? Urm, yes. The attached patch fixes the problem properly. Lars: This is a fix for a regression and should not touch anything not directly related with xrightarrow and xleftarrow. Ok to apply? Andre' Thanks. Could you also apply it to 1.2.x cvs? Michael -- Michael Abshoff - MRB - Universität Dortmund - Telefon 755-3463 (intern) Where do you want to RTFM today?
Re: BUG: lyx-1.3pre3 mangels optional argument on \xrightarrow
On Fri, Jan 31, 2003 at 11:42:04AM +0100, Michael Abshoff wrote: > up to lyx-1.1.6fix4 it was possible to specify an optional argument for > xrightarrow, i.e. \xrightarrow[optinal]{blah}. Looks like this inset was forgotten at some point of time. > Are there any clever ways besides writing a macro for xrigtharrow > to fix that problem? Urm, yes. The attached patch fixes the problem properly. Lars: This is a fix for a regression and should not touch anything not directly related with xrightarrow and xleftarrow. Ok to apply? Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson) Index: math_xarrowinset.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_xarrowinset.C,v retrieving revision 1.5 diff -u -p -r1.5 math_xarrowinset.C --- math_xarrowinset.C 2 Aug 2002 14:29:42 - 1.5 +++ math_xarrowinset.C 31 Jan 2003 11:04:43 - @@ -12,7 +12,7 @@ MathXArrowInset::MathXArrowInset(string const & name) - : MathNestInset(1), name_(name) + : MathFracbaseInset(), name_(name) {} @@ -24,29 +24,34 @@ MathInset * MathXArrowInset::clone() con void MathXArrowInset::metrics(MathMetricsInfo & mi) const { - //MathMetricsInfo mi = st; - //smallerStyleScript(mi); + MathScriptChanger dummy(mi.base); cell(0).metrics(mi); - dim_.w = cell(0).width() + 10; + cell(1).metrics(mi); + dim_.w = std::max(cell(0).width(), cell(1).width()) + 10; dim_.a = cell(0).height() + 10; - dim_.d = 0; + dim_.d = cell(1).height(); } -void MathXArrowInset::draw(MathPainterInfo & pain, int x, int y) const +void MathXArrowInset::draw(MathPainterInfo & pi, int x, int y) const { - cell(0).draw(pain, x + 5, y - 10); - mathed_draw_deco(pain, x + 1, y - 7, width() - 2, 5, name_); + MathScriptChanger dummy(pi.base); + cell(0).draw(pi, x + 5, y - 10); + cell(1).draw(pi, x + 5, y + cell(1).height()); + mathed_draw_deco(pi, x + 1, y - 7, width() - 2, 5, name_); } void MathXArrowInset::write(WriteStream & os) const { - os << '\\' << name_ << '{' << cell(0) << '}'; + os << '\\' << name_; + if (cell(1).size()) + os << '[' << cell(1) << ']'; + os << '{' << cell(0) << '}'; } void MathXArrowInset::normalize(NormalStream & os) const { - os << "[xarrow " << name_ << ' ' << cell(0) << ']'; + os << "[xarrow " << name_ << ' ' << cell(0) << ' ' << cell(1) << ']'; } Index: math_xarrowinset.h === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_xarrowinset.h,v retrieving revision 1.3 diff -u -p -r1.3 math_xarrowinset.h --- math_xarrowinset.h 11 Sep 2002 08:26:02 - 1.3 +++ math_xarrowinset.h 31 Jan 2003 11:04:43 - @@ -2,7 +2,7 @@ #ifndef MATH_XARROWINSET_H #define MATH_XARROWINSET_H -#include "math_nestinset.h" +#include "math_fracbase.h" #include "LString.h" #ifdef __GNUG__ @@ -15,18 +15,18 @@ * Full author contact details are available in file CREDITS */ -class MathXArrowInset : public MathNestInset { +class MathXArrowInset : public MathFracbaseInset { public: /// explicit MathXArrowInset(string const & name); /// MathInset * clone() const; /// - void draw(MathPainterInfo &, int x, int y) const; + void draw(MathPainterInfo & pi, int x, int y) const; /// void write(WriteStream & os) const; /// - void metrics(MathMetricsInfo & st) const; + void metrics(MathMetricsInfo & mi) const; /// void normalize(NormalStream & os) const; Index: math_parser.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_parser.C,v retrieving revision 1.258 diff -u -p -r1.258 math_parser.C --- math_parser.C 18 Dec 2002 10:57:45 - 1.258 +++ math_parser.C 31 Jan 2003 11:04:43 - @@ -959,6 +959,12 @@ void Parser::parse1(MathGridInset & grid } } + else if (t.cs() == "xrightarrow" || t.cs() == "xleftarrow") { + cell->push_back(createMathInset(t.cs())); + parse(cell->back().nucleus()->cell(1), FLAG_OPTION, mode); + parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode); + } + else if (t.cs() == "ref") { cell->push_back(MathAtom(new RefInset)); parse(cell->back().nucleus()->cell(1), FLAG_OPTION, mode);