Questions about Domain Mapper

Miklos Vajna vmiklos at collabora.co.uk
Mon Nov 25 01:51:43 PST 2013


Hi Adam,

On Sun, Nov 24, 2013 at 06:06:06PM +0200, Adam Fyne <adam.fyne at cloudon.com> wrote:
> I think I was misunderstood.
> I think you thought I was asking : "I need to add each property like
> bold\italic\underline separatly to the RedlineParams".
> What I actually meant to ask was:
> Currently there are a lot of XML nodes that might appear under 'rPr' node
> (that is under the 'rPrChange').
> For example: 'bold', 'boldbidi', 'italic', 'italicbidi', language, etc.
> Currently each of these XML nodes is handled by different code in the
> 'DomainMapper.cxx' file
> (here is some of it:
> http://opengrok.libreoffice.org/xref/core/writerfilter/source/dmapper/DomainMapper.cxx#2100
> )
> 
> So I am asking - do I have to go node-by-node and add it to the
> 'property-list' that will be in the 'RedlineParams'?
> Or is there any smart way of turning on some flag when the 'rPrChange->rPr'
> tag is entered,
> and checking at the end of the 'rPrChange->rPr' tag which properties were
> inserted to the 'rContext' and add those properties to the 'RedlineParams'.

Yes, that should be possible. Either when you expand the token of
"rPrChange", then you can do something like:

- turn flag on
- resolve children
- turn flag off

(DomainMapper.cxx:3039 has examples of that, the interop-grab-bag
reading of table styles use this technique)

or in case that doesn't work, you can still generate tokens when you
start or leave a context. If you search for tblStart/tblEnd in
model.xml, you'll find examples for this as well.

> *And some more elaboration on that:*
> I just checked a simple DOCX that had some text in 'bold' and 'italic'. I
> then turned ON the 'track changes' and removed the 'bold' and 'italic'.
> When I round-tripped the DOCX through LO - the outputted file *had* the
> 'bold' and 'italic' turned on.
> This means that the nodes that were inside the 'r->rPrChange->rPr' were
> treated as if they were simply inside the 'r'->'rPr' (which is wrong).

Right, that's quite possible.

> This ephasises the need to detect when 'r->rPrChange->rPr' are being
> analyzed in the importer - and to *not* analyze them normally on the run
> itself, but to store them in the 'RedlineParams' somehow.

Agreed, that makes sense.

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/20131125/a7c21bda/attachment.pgp>


More information about the LibreOffice mailing list