Some (most?) of the time we look at something like:
#0 0x403185a7 in memcpy () from /lib/libc.so.6
#1 0x08489d5e in stringbuf::overflow (this=0xbfffe3b8, c=32)
at /usr/include/g++/sstream:111
#2 0x4030dc16 in __overflow () from /lib/libc.so.6
#3 0x40309e41 in putc () from /lib/libc.so.6
#4 0x4024bcb8 in ostream::operator<< () from
/usr/lib/libstdc++-libc6.2-2.so.3
#5 0x0822260b in TextPainter::show (this=0xbfffe35c, os=@0xbfffe3b4,
offset=3)
at ../../../lyx-devel/src/mathed/textpainter.C:64
#6 0x081de80f in InsetFormula::ascii (this=0x8abc680, os=@0xbfffe3b4)
at ../../../lyx-devel/src/mathed/formula.C:150
#7 0x0817aec9 in Paragraph::asString (this=0x8abbc40, buffer=0x892f520,
beg=47, end=48, label=true) at ../../lyx-devel/src/paragraph.C:1771
#8 0x081ab01e in LyXText::selectionAsString (this=0x8c398f0,
buffer=0x892f520, label=true) at ../../lyx-devel/src/text2.C:930
#9 0x081b020c in LyXText::cutSelection (this=0x8c398f0, bview=0x882e1e8,
doclear=true, realcut=true) at ../../lyx-devel/src/text2.C:1442
#10 0x081b78a7 in LyXText::dispatch (this=0x8c398f0, cmd=@0xbfffe7f4)
at ../../lyx-devel/src/text3.C:1046
#11 0x0805f6e3 in BufferView::Pimpl::dispatch (this=0x882e1f8,
ev=@0xbfffe9d4)
at ../../lyx-devel/src/BufferView_pimpl.C:1262
#12 0x08051779 in BufferView::dispatch (this=0x882e1e8, ev=@0xbfffe9d4)
at ../../lyx-devel/src/BufferView.C:257
Now, the time is spend in TextPainter, so it is "matheds fault"
as it tries to come up with a nice ASCII art drawing of the formula.
However, I fail to see the reason why we call asString at all:
Well:
void LyXText::cutSelection(BufferView * bview, bool doclear, bool realcut)
{
// Stuff what we got on the clipboard. Even if there is no selection.
// There is a problem with having the stuffing here in that the
// larger the selection the slower LyX will get. This can be
// solved by running the line below only when the selection has
// finished. The solution used currently just works, to make it
// faster we need to be more clever and probably also have more
// calls to stuffClipboard. (Lgb)
bview->stuffClipboard(selectionAsString(bview->buffer(), true));
And indeed, it gets _slow_. Up to a few minutes freeze when cutting a few
pages full of formula.
Why do we have to _stuff_ the clipboard?
And which clipboard?
Andre'
--
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)