<div dir="ltr"><div class="gmail_extra"><br>Hi Miklos,</div><div class="gmail_extra"> </div><div class="gmail_extra">Thanks for the help. it helps a lot !</div><div class="gmail_extra">See my comments below <font color="#0b5394">in blue</font> ...</div>
<div class="gmail_extra"><br> </div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">

<div class="im">



> I have a few questions:<br>
><br>
> 1.       Shouldn't "CT_PTab" call "ptab" instead of "tab"?<br>

</div>That's right, except that writerfilter::ooxml::OOXMLFastContextHandler<br>
has a tab() method, but no ptab() method, that will be one thing you<br>
need to implement first.<br></blockquote><div><font color="#0b5394">Why would I implement a 'ptab' function? </font></div><div><font color="#0b5394">From what you wrote below - it seems that I do not need to do any action for 'ptab'.</font></div>
<div><font color="#0b5394">So does your recommendation still stand that I need 'ptab'?</font></div><div><font color="#0b5394">(you said that 'tab()' inserts a '\t' instead of the <tab> element).</font></div>
<div> </div><div> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div class="im">
> 2.       What is the meaning of the 'tag' attribute of the 'resource' node?<br>
</div>As far as I know, the <action .. action="name"/> is always a method
call.<br></blockquote><div><font color="#0b5394">The question was actually about the 'tag' element of a resource, not the 'action' element.</font></div><div> </div><div> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">

<div class="im">> 3.       The way information is stored in 'model.xml' is so confusing.<br>

</div>You're not alone, writerfilter/documentation/ooxml/model.xml is what we<br>
found out so far, feel free to extend that if you manage to decode some<br>
more detail.<br>
<br>
In short, whenever you add support for new XML tags, you typically need<br>
to extend the file at two places:<br>
<br>
- the new tag is a child of some existing tag, so extend the parent's<br>
  definition<br>
- you also need to add a matching <resource> tag in model.xml<br>
<br>
Once those two definitions match, you get new tokens in dmapper.<br>
363dafefad14411a16f6ea9d2ee0d55b67bc9c8d is hopefully a good example.<br>
(Though your case is easier, as you add a new token in an existing<br>
namespace.)<br></blockquote><div><font color="#0b5394">What do you mean when you say that my case is easy because I add a new token to an existing namespace?</font></div><div><font color="#0b5394">what namespace would that be?</font></div>
<div><font color="#0b5394">(I looked at the commit you mentioned and it doesn't make any sense to me...)</font></div><div> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">

<div class="im"><br>
> From the code – I understood that 'action' calls a function in<br>
> "OOXMLFastContextHandler".<br>
><br>
> When do we need such actions? Why is this done on some nodes and on other<br>
> nodes (like 'run', 'paragraph', 'brush' etc) not done?<br>
><br>
><br>
> So – say I need to add a new function called 'ptab' to<br>
> 'OOXMLFastContextHandler' – Do I simply copy the logic of 'tab()' ?<br>
<br>
</div>I think it's all about where do you want to handle the input. Normally,<br>
the tokenizer just generates these tokens, and dmapper does the mapping.<br>
<br>
However, in case of tabs, other (RTF, WW8) formats handle the tab as a<br>
normal character, so in case of DOCX, an action is used, that converts<br>
the OOXML tokens to a simple character, so in dmapper you always get a<br>
tab character. So actions are used to generate these "fake tokens".<br>
Other example: w:hyperlink is also handled in the tokenizer, and it<br>
generates a HYPERLINK field from it, and dmapper handles only that.<br></blockquote><div><font color="#0b5394">So, should I handle 'ptab' in OOXMLFastContextHandler' or not?</font></div><div><font color="#0b5394">Sounds like I shouldn't.</font></div>
<div><font color="#0b5394">If not - should I remove the action from the xml node?</font></div><div> </div><div> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">

<div class="im">
> Where do I parse the attributes themselves of the 'ptab'?<br>

</div>If you handle ptab as a normal element in model.xml, you'll have the<br>
usual way to get all its attributes. I would recommend going that way,<br>
as ptab is not a character (tab is), but an element with attributes.<br></blockquote><div><font color="#0b5394">From what I saw - 'ptab' attributes <u>are</u> handled in the dmapper. </font></div><div><font color="#0b5394">So the <strong><u>current</u></strong> way it works, where 'ptab' is both parsed in 'OOXMLFastContextHandler'</font></div>
<div><font color="#0b5394">and it's attributes are parsed in the dmapper is very confusing.</font></div><div> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">

<div class="im"><br>
> I add it as properties to some existing object of the core?<br>

</div>I would check how existing similar features are implement, and do<br>
something similar. Normal tabs are not a good example, as those are<br>
stored as a \t character inside SwTxtNode, but page break may be a good<br>
example.<br></blockquote><div><font color="#0b5394">How is 'Page Break' stored in the core?</font></div><div><font color="#0b5394">Is there some tutorial on how to add an entirely new object to the core?</font></div>
<div><font color="#0b5394">(you told me once that adding a property to an existing core object is relatively easy,</font></div><div><font color="#0b5394">but adding a new object is a much more complex task).</font></div><div>
 </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
<div class="im"><br>
Sure, so -- as usual, the first step would be to design how the document<br>
model should store these paragraph tabs, then either do the UNO API or<br>
some UI, so you can test it. Then you can continue with filters and<br>
layout, etc.<br></div></blockquote><div><font color="#0b5394">You say "either do the UNO API or some UI".</font></div><div><font color="#0b5394">What UI do you mean?</font></div><div><font color="#0b5394">How would one control the 'paragraph tabs' through the UI?</font></div>
<div> </div><div> </div><div><font color="#0b5394">Thanks, it helps a great deal !</font></div><div><font color="#0b5394"></font> </div><div><font color="#0b5394">Adam</font></div></div></div>