[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Review Request: Enable the modification of KoXml DOM tree
From:       "Ganesh Paramasivam" <ganesh () crystalfab ! com>
Date:       2010-02-27 6:16:40
Message-ID: 20100227061640.23648.90266 () localhost
[Download RAW message or body]



> On 2010-02-27 04:56:52, Thorsten Zachmann wrote:
> > Can you please explain why you need to modify the document while you are loading \
> > it? 
> > Please note that modifying is not possible as the document is const during \
> > loading.  
> > I personally think that modifying of the document during the loading should be \
> > avoided.

This is due to the approach taken by ODF spec for storing delete changes. Deleted \
changes in a document are stored separately in a <text:deletion> tag and a <change \
change-id=""> is placed at the location of deletion. ODF specifies the following \
rules to the used for loading delete changes

To reconstruct the text before a deletion took place:
-If the change mark is inside a paragraph, insert the text content of the \
<text:deletion> element as if the beginning <text:p> and final </text:p> tags were \
                missing.
-If the change mark is inside a heading, proceed as above, except adapt the end tags \
                to match their new counterparts.
-Otherwise, copy the text content of the <text:deletion> element in place of the \
change mark.

As you can see, these rules actually imply a modification of the DOM. We already have \
a working code for loading delete changes which does not require a write-able DOM \
tree. But the code would be a lot more cleaner with a write-able one. Hence this \
change.


- Ganesh


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/3064/#review4302
-----------------------------------------------------------


On 2010-02-26 18:22:38, Ganesh Paramasivam wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/3064/
> -----------------------------------------------------------
> 
> (Updated 2010-02-26 18:22:38)
> 
> 
> Review request for KOffice and Pierre Stirnweiss.
> 
> 
> Summary
> -------
> 
> This set of modifications enables the ability to modify the DOM tree created in \
> KoXmlReader.cpp. This has been added to have a much more cleaner approach to load \
> delete change elements in a change-tracked ODF document. I have added only those \
> API's which I believe will be needed for this specifc requirement. 
> Specifically, the API's that have been added are 
> - setTagName()and setAttribute() in KoXmlElement
> - appendChild(), removeChild(), insertBefore(), insertAfter() in KoXmlNode
> All the newly added API's are compatible with the respective Qt/XML API's. 
> 
> TestCases to test the new API's have been added in tests/TestXmlReader.cpp.
> 
> 
> Diffs
> -----
> 
> trunk/koffice/libs/odf/KoXmlReader.h 1095930 
> trunk/koffice/libs/odf/KoXmlReader.cpp 1095930 
> trunk/koffice/libs/odf/tests/TestXmlReader.cpp 1095930 
> 
> Diff: http://reviewboard.kde.org/r/3064/diff
> 
> 
> Testing
> -------
> 
> TestCases to test the new functionality has been added in tests/TestXmlReader.cpp \
> and all the test-cases have been run.   
> 
> Thanks,
> 
> Ganesh
> 
> 

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic