Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi Miklos,


On Thu, Nov 21, 2013 at 10:55 AM, Miklos Vajna <vmiklos@collabora.co.uk>wrote:

Hi Adam,

When I look at the code that processes these nodes - I see that all of
these parameters
are being processed here

http://opengrok.libreoffice.org/xref/core/writerfilter/source/dmapper/DomainMapper.cxx#2114
and all are being inserted to the 'rContext' or used with
'appendGrabBag'.
So it seems like I should add a flag that is turned on when 'rPrChange'
is
entered,
and add a lot of 'if-else' statements in the code that processes all the
'italic', 'bold' etc
to check - if the flag is 'on' - insert the property to the
'RedlineParams'
structure,
otherwise - insert the property to the 'rContext'.
Is this the right approach? It will dirty the code...

You don't have to deal with each property individually, you can just
handle the collected properties. Have a look at text::XRedline, its
makeRedline() method takes a beans::PropertyValues, which is a
string-any map in practice. You can add a new "RedlineOldformat" (or
similar) key to that map, and the value of that key can be your property
list. When you handle that property in sw core, you can convert that to
an SfxItemset. (Have a look at how to code handles the "property list"
-> SfxItemSet conversion when you append a new text portion with a given
set of properties.)


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'.

Best,
Adam

-- 

[image: appicon.png]


*Adam Fyne*

Twitter <http://www.twitter.com/cloudoninc> |
LinkedIn<http://www.linkedin.com/company/cloudon>
 | Facebook <http://www.facebook.com/cloudoninc> |
Blog<http://site.cloudon.com/blog>

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.