<div dir="ltr"><u>And some more elaboration on that:</u><div>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'.</div>
<div>When I round-tripped the DOCX through LO - the outputted file <i style="font-weight:bold">had</i> the 'bold' and 'italic' turned on.</div><div>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).</div>
<div>This ephasises the need to detect when 'r->rPrChange->rPr' are being analyzed in the importer - and to <u style="font-weight:bold;font-style:italic">not</u> analyze them normally on the run itself, but to store them in the 'RedlineParams' somehow.</div>
<div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Nov 24, 2013 at 6:06 PM, Adam Fyne <span dir="ltr"><<a href="mailto:adam.fyne@cloudon.com" target="_blank">adam.fyne@cloudon.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Miklos,<br><div class="gmail_extra"><br>
<br><div class="gmail_quote"><div class="im">On Thu, Nov 21, 2013 at 10:55 AM, Miklos Vajna <span dir="ltr"><<a href="mailto:vmiklos@collabora.co.uk" target="_blank">vmiklos@collabora.co.uk</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Adam,<br>
<div><br></div><div class="im"><div>
> When I look at the code that processes these nodes - I see that all of<br>
> these parameters<br>
> are being processed here<br>
> <a href="http://opengrok.libreoffice.org/xref/core/writerfilter/source/dmapper/DomainMapper.cxx#2114" target="_blank">http://opengrok.libreoffice.org/xref/core/writerfilter/source/dmapper/DomainMapper.cxx#2114</a><br>


> and all are being inserted to the 'rContext' or used with 'appendGrabBag'.<br>
> So it seems like I should add a flag that is turned on when 'rPrChange' is<br>
> entered,<br>
> and add a lot of 'if-else' statements in the code that processes all the<br>
> 'italic', 'bold' etc<br>
> to check - if the flag is 'on' - insert the property to the 'RedlineParams'<br>
> structure,<br>
> otherwise - insert the property to the 'rContext'.<br>
> Is this the right approach? It will dirty the code...<br>
<br>
</div>You don't have to deal with each property individually, you can just<br>
handle the collected properties. Have a look at text::XRedline, its<br>
makeRedline() method takes a beans::PropertyValues, which is a<br>
string-any map in practice. You can add a new "RedlineOldformat" (or<br>
similar) key to that map, and the value of that key can be your property<br>
list. When you handle that property in sw core, you can convert that to<br>
an SfxItemset. (Have a look at how to code handles the "property list"<br>
-> SfxItemSet conversion when you append a new text portion with a given<br>
set of properties.)<br></div></blockquote><div><br></div><div>I think I was misunderstood.</div><div>I think you thought I was asking : "I need to add each property like bold\italic\underline separatly to the RedlineParams".</div>

<div>What I actually meant to ask was:</div><div>Currently there are a lot of XML nodes that might appear under 'rPr' node (that is under the 'rPrChange').</div><div>For example: 'bold', 'boldbidi', 'italic', 'italicbidi', language, etc.</div>

<div>Currently each of these XML nodes is handled by different code in the 'DomainMapper.cxx' file </div><div>(here is some of it: <a href="http://opengrok.libreoffice.org/xref/core/writerfilter/source/dmapper/DomainMapper.cxx#2100" target="_blank">http://opengrok.libreoffice.org/xref/core/writerfilter/source/dmapper/DomainMapper.cxx#2100</a>)</div>

<div><br></div><div>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'?</div><div>Or is there any smart way of turning on some flag when the 'rPrChange->rPr' tag is entered,</div>

<div>and checking at the end of the 'rPrChange->rPr' tag which properties were inserted to the 'rContext' and add those properties to the 'RedlineParams'.</div><div><br></div></div></div></div>
</blockquote></div><div><br></div>-- <br><div dir="ltr">
        <table border="0" cellpadding="0" cellspacing="0" style="font-family:arial;font-size:small">
                <tbody>
                        <tr>
                                <td style="width:51pt;padding:0.75pt" width="68">
                                        <p style="margin-right:0.4pt;margin-bottom:0.0001pt;margin-left:0.4pt">
                                                <a name="SafeHtmlFilter_SafeHtmlFilter_13ed1a8c2f9e26a1__MailAutoSig" style="color:rgb(17,85,204)"></a><span style="font-size:9pt;font-family:Helvetica,sans-serif"><img alt="appicon.png" height="63" src="http://site.cloudon.com/wp-content/uploads/2012/05/appicon.png" width="64"></span></p>

                                </td>
                                <td>
                                         </td>
                                <td style="width:207pt;padding:0.75pt" width="276">
                                        <p style="margin-right:0.4pt;margin-bottom:0.0001pt;margin-left:0.4pt">
                                                <strong>Adam Fyne</strong><br>
                                                <br>
                                                <a href="http://www.twitter.com/cloudoninc" style="color:rgb(17,85,204)" target="_blank"><span style="font-size:10pt;font-family:Helvetica,sans-serif;color:rgb(148,201,71);text-decoration:none">Twitter</span></a><span style="font-size:11.5pt;font-family:Helvetica,sans-serif"> </span><span style="font-size:10pt;font-family:Helvetica,sans-serif;color:rgb(102,102,102)">|</span><span style="font-size:11.5pt;font-family:Helvetica,sans-serif"> </span><a href="http://www.linkedin.com/company/cloudon" style="color:rgb(17,85,204)" target="_blank"><span style="font-size:10pt;font-family:Helvetica,sans-serif;color:rgb(148,201,71);text-decoration:none">LinkedIn</span></a><span style="font-size:10pt;font-family:Helvetica,sans-serif;color:rgb(102,102,102)"> |</span><span style="font-size:11.5pt;font-family:Helvetica,sans-serif"> </span><a href="http://www.facebook.com/cloudoninc" style="color:rgb(17,85,204)" target="_blank"><span style="font-size:10pt;font-family:Helvetica,sans-serif;color:rgb(148,201,71);text-decoration:none">Facebook</span></a><span style="font-size:11.5pt;font-family:Helvetica,sans-serif"> </span><span style="font-size:10pt;font-family:Helvetica,sans-serif;color:rgb(102,102,102)">|</span><span style="font-size:11.5pt;font-family:Helvetica,sans-serif"> </span><a href="http://site.cloudon.com/blog" style="color:rgb(17,85,204)" target="_blank"><span style="font-size:10pt;font-family:Helvetica,sans-serif;color:rgb(148,201,71);text-decoration:none">Blog</span></a></p>

                                </td>
                        </tr>
                </tbody>
        </table>
        <table border="0" cellpadding="0" cellspacing="0">
                <tbody>
                        <tr>
                                <td style="width:51pt;padding:0.75pt" width="68">
                                         </td>
                                <td style="width:207pt;padding:0.75pt" width="276">
                                        <p style="margin:0in 0.4pt 0.0001pt">
                                                 </p>
                                </td>
                        </tr>
                </tbody>
        </table>
</div>
<br>
</div></div></div>