Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-11 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > > Maybe a new flag AS_STR_TOC should be introduced for Paragraph::asString, > > in order to discriminate between tocString and a new clipboardString (or > > somesuch) method. Of course, all uses of asString should be audited. > > Or maybe a flag like AS_COMPACT_INSETS

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-09 Thread Jean-Marc Lasgouttes
Enrico Forestieri writes: > Maybe a new flag AS_STR_TOC should be introduced for Paragraph::asString, > in order to discriminate between tocString and a new clipboardString (or > somesuch) method. Of course, all uses of asString should be audited. Or maybe a flag like AS_COMPACT_INSETS that we co

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-09 Thread Enrico Forestieri
On Fri, Oct 09, 2009 at 11:38:10AM +0200, Jürgen Spitzmüller wrote: > Enrico Forestieri wrote: > > I'll leave to others the decision about renaming tocString as textString > > (which is the most obvious and easy thing to do, IMHO). > > I still think it should not be renamed, but splitted up to two

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-09 Thread Jürgen Spitzmüller
Enrico Forestieri wrote: > I'll leave to others the decision about renaming tocString as textString > (which is the most obvious and easy thing to do, IMHO). I still think it should not be renamed, but splitted up to two functions. We should not use the same function for pasting and the toc. Jür

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-09 Thread Enrico Forestieri
On Sat, Oct 03, 2009 at 11:56:50AM +0200, Jürgen Spitzmüller wrote: > Is it really correct to assume utf8 in plaintext (after all, other plaintext > methods use the runparams' encoding, so we would get a mish-mash of encodings, > wouldn't we)? I agree that utf8 is te correct encoding for pasting a

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-07 Thread Enrico Forestieri
On Wed, Oct 07, 2009 at 10:24:41AM +0200, Jean-Marc Lasgouttes wrote: > Coming back to the bug, could some kind soul explain what is going on? The method that once was named textString() was being used to provide a stringified representation of insets. This was used both for the GUI toc *and* for

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-07 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > Coming back to the bug, could some kind soul explain what is going on? > Why doesn't the patch remove InsetMathHull::tocString instead of > rewriting it? We do not want math insets in tocs, do we? I'm not into this code either, but I suppose we really just renamed a

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-07 Thread Jean-Marc Lasgouttes
Jürgen Spitzmüller writes: > Jean-Marc Lasgouttes wrote: > >> We have a Paragraph::stringify that uses Inset::plaintext. Is it good >> enough or not? We cannot expect to have more than two methods for each >> inset... > > What is this used for? Only for find, actually. It may not be what we want

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-07 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > We have a Paragraph::stringify that uses Inset::plaintext. Is it good > enough or not? We cannot expect to have more than two methods for each > inset... What is this used for? Jürgen

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-07 Thread Jean-Marc Lasgouttes
Jürgen Spitzmüller writes: > Jean-Marc Lasgouttes wrote: > >> Notice that I wrote "called". The culprit is Paragraph::asString. Does >> the cut and paste code need to call that (I am not sure where it is >> done), and in this case should we add a new flag to the function? > > I would also think t

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-07 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > Notice that I wrote "called". The culprit is Paragraph::asString. Does > the cut and paste code need to call that (I am not sure where it is > done), and in this case should we add a new flag to the function? I would also think that we need a separate copyString (or

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-06 Thread Jean-Marc Lasgouttes
Enrico Forestieri writes: >> I missed the start of this thread. Where is tocString called? I do not >> see any instance in mathed/ directory. > > $ grep tocString src/mathed/* > src/mathed/InsetMathHull.cpp:void InsetMathHull::tocString(odocstream & os) > const > src/mathed/InsetMathHull.h: v

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-06 Thread Enrico Forestieri
On Tue, Oct 06, 2009 at 05:24:12PM +0200, Jean-Marc Lasgouttes wrote: > Enrico Forestieri writes: > > > On Mon, Oct 05, 2009 at 02:09:08PM +0200, Jean-Marc Lasgouttes wrote: > >> The renaming was to make it clear that this is a function for TOC, > >> especially to avoid mixing it up with othe rus

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-06 Thread Jean-Marc Lasgouttes
Enrico Forestieri writes: > On Mon, Oct 05, 2009 at 02:09:08PM +0200, Jean-Marc Lasgouttes wrote: >> The renaming was to make it clear that this is a function for TOC, >> especially to avoid mixing it up with othe ruses such as cut-and-paste. > > Except that it was already mixed up with other use

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-06 Thread Enrico Forestieri
On Mon, Oct 05, 2009 at 02:09:08PM +0200, Jean-Marc Lasgouttes wrote: > The renaming was to make it clear that this is a function for TOC, > especially to avoid mixing it up with othe ruses such as cut-and-paste. Except that it was already mixed up with other uses such as cut-and-paste. -- Enric

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-05 Thread Jean-Marc Lasgouttes
Jürgen Spitzmüller writes: > Enrico Forestieri wrote: >> The method was once named textString() and was changed to tocString() >> at http://www.lyx.org/trac/changeset/27378 for (seemingly) unknown >> reasons (maybe due to a wrong comment in src/insets/Inset.h ?). > > I remember that Jean-Marc opt

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-03 Thread Pavel Sanda
Jürgen Spitzmüller wrote: > Enrico Forestieri wrote: > > > I remember that Jean-Marc opted for the renaming. Could it be that we > > > need to split this method, if it's really used for pasting as well? > > > > It is also used for pasting, so the renaming was inappropriate, apparently. > > Indeed

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-03 Thread Jürgen Spitzmüller
Enrico Forestieri wrote: > > I remember that Jean-Marc opted for the renaming. Could it be that we > > need to split this method, if it's really used for pasting as well? > > It is also used for pasting, so the renaming was inappropriate, apparently. > Indeed, it can lead to pitfalls, as in your

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-03 Thread Enrico Forestieri
On Sat, Oct 03, 2009 at 11:56:50AM +0200, Jürgen Spitzmüller wrote: > Enrico Forestieri wrote: > > The method was once named textString() and was changed to tocString() > > at http://www.lyx.org/trac/changeset/27378 for (seemingly) unknown > > reasons (maybe due to a wrong comment in src/insets/In

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-03 Thread Jürgen Spitzmüller
Enrico Forestieri wrote: > The method was once named textString() and was changed to tocString() > at http://www.lyx.org/trac/changeset/27378 for (seemingly) unknown > reasons (maybe due to a wrong comment in src/insets/Inset.h ?). I remember that Jean-Marc opted for the renaming. Could it be that

Re: [patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-02 Thread Enrico Forestieri
On Fri, Oct 02, 2009 at 04:43:09PM +0200, Jürgen Spitzmüller wrote: > http://www.lyx.org/trac/ticket/6250 > > This crash was introduced in the 1.6.4 cycle with r30538. However, I > think this revision just uncovered the problem: tocString (previously > uncalled) triggers an iconv exception in Ins

[patch] bug 6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard

2009-10-02 Thread Jürgen Spitzmüller
http://www.lyx.org/trac/ticket/6250 This crash was introduced in the 1.6.4 cycle with r30538. However, I think this revision just uncovered the problem: tocString (previously uncalled) triggers an iconv exception in InsetMathString::write, because a character is unknown in the current encoding.