DOCX import: MS Office WordArt to LO Fontwork
Miklos Vajna
vmiklos at collabora.com
Thu Dec 15 08:34:46 UTC 2022
Hi Regina,
On Wed, Dec 14, 2022 at 11:39:03PM +0100, Regina Henschel <rb.henschel at t-online.de> wrote:
> (A)
>
> The principle in my patch is to use the information in the
> CharInteropGrabBag to create LineProperties and FillProperties. The problem
> in Writer is that only after the text has been read and the shape, including
> the frame bundled with it, has been created, is it known whether it is a
> WordArt shape.
>
> Do you have any concerns about my approach? Do you have suggestions for a
> better approach?
As long as we use a SAX parser to handle the DOCX input, I don't think
we can do better here.
> (B)
> The current import does not generate a Fontwork at all. However, LO will
> recreate the WordArt from the GrabBags, if the document is resaved to docx
> and nothing on the shape was changed. With my work, a Fontwork is created
> which will nicely look as far it is principle possible and will be kept when
> converting to ODF, but resave to docx looses the styling of the Fontwork.
>
> How to progress? Use this approach nevertheless and start working on export
> of Fontwork to WordArt after that (which would include export from ODF), or
> extend my work to cover export too?
I think it makes sense to progress in steps. Let's get the DOCX import
in, then you can look at the DOCX export. And next time perhaps do it in
the other order to avoid temporary problems. :-)
> (D)
> I have introduced a new file fontworkhelpers, which includes that part, that
> is uses in import from pptx as well. Currently my solution has a lot of
> lcl_foo methods, which could be move to that new file too. Should I do that
> although they are only used in WpsContext.cxx?
I think this is a matter of taste. I usually start breaking out
functionality into a new file when the current file is >1000 lines, but
it's not a strict rule.
Regards,
Miklos
More information about the LibreOffice
mailing list