Michael Gerz wrote:

> +        // do not copy text (also nested in insets) which is marked as
> deleted
> +        // FIXME: acceptChanges() is defined for LyXText rather than
> ParagraphList
> +        // Therefore we must wrap 'paragraphs' into a LyXText object and
> cross our fingers
> +        LyXText lt;
> +        lt.pars_ = paragraphs;

You should do what is done in pasteSelectionHelper:

        // This works without copying any paragraph data because we have
        // a specialized swap method for ParagraphList. This is important
        // since we store pointers to insets at some places and we don't
        // want to invalidate them.
        insertion.swap(in.paragraphs());

This may also be visible performancewise if paragraphs is big.


Georg

Reply via email to