Am Freitag, den 10.06.2005, 13:55 +0200 schrieb Martin Thoma:
> Hello! I just try to duplicate a section of a text identified by a
> XTextCursor in Basic. The text may contain different formatting,
> text-tables, perhaps some graphics and so on.
> 
> A restriction is that the contents of the clipboard should not been
> destroyed, so I think I have to do a kind of "enumerating over all elements
> and copy them"-thing.

I personally think that there should be a (set of) method(s) for doing
this, I would need that, too. Moving around formatted pieces of text is
very common in writer, I think.

You would do something like:

create an enumeration at your XText(Cursor)
iterate over the paragraphs
        get an enumeration from that
        iterate over atomic formatted char portions
                ...

I looked for that solution and rejected doing it that way, it's too much
effort.

One dirty little trick you might want to consider is:

- create an autotext from your text portion
- navigate to and insert at the target location
- delete the temporary autotext

Look out for "com.sun.star.text.AutoTextEntry". But beware, there is
only one central container in each installation

HTH,
Marc



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to