Pasting in Writer or how to create a SwDoc deep copy?

Miklos Vajna vmiklos at collabora.co.uk
Thu Jun 26 01:54:38 PDT 2014


Hi Jan-Marek,

On Wed, Jun 25, 2014 at 01:09:01PM +0200, Jan-Marek Glogowski <glogow at fbihome.de> wrote:
> My best idea is to use
> 
> SwNodeIndex aSourceIdx( rSource.GetNodes().GetEndOfExtras(), *1* );

Are you sure such an explicit offset is required here? I'm thinking
about special situations like when the document starts with a table, if
you want to paste that into a new document, you probably want to have
the selection start at the first content node of the document, so no
static offset will work here.

I'm thinking about something like:

SwNodeIndex aNodeIndex rSource.GetNodes().GetEndOfAutotext();
SwCntntNode* pStart = rSource.GetNodes().GoNext(&aNodeIndex);

Any kind of explicit offset sounds a bit scary to me.

> SwPaM aPara( <document content start );
> this->DelFullPara(aPara);

But you're not really trying to delete the paragraph content, just join
the two, right? SwDoc::DeleteAndJoin() might be useful to do that.

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20140626/d70376aa/attachment.sig>


More information about the LibreOffice mailing list