Weekly Status Update 14
Aung Khant Oo Gu Gu
wildgugu2020 at gmail.com
Wed Aug 14 11:58:22 UTC 2024
Hi,
This is my gsoc weekly report for improving user experience around windows.
Sorry, I made a mistake in my last weekly report. LibreOffice has not yet
support for conversion from/to xml as whole document as I understood wrong
from the xml filter tutorials about converting xml from/to document. This
[1] explains about xml not being implemented to save binary data like
images and this [2] FAQ #6 answers conversion plain xml from/to document
has not been supported yet.
However, LibreOffice is able to access a single xml file and it is better
for the performance since we don't need to export the whole document. The
source codes refer to the xml files (content.xml, settings.xml, etc) as a
stream within a package. (E.g DocumentMetaDataAccess already works with
content, styles and manifest streams and also does the exporting/filtering
within the file and in the SvXMLExport_Impl class, content.xml is referred
as a stream in xmloff/source/core/xmlexp.cxx).
To access the stream, I tried to use this 'Storage' service [3] (which is
used to access the package). There is only two storage services inheriting
the base storage and the other one is FileSystemStorage used to access the
folder. Although loading the input stream was successful, there was a sax
error while using DOM builder method parse.
Currently, there are different things I have to understand to use a stream
from the storage.
Chart2/source/model/filter/XMLFilter shows when getting the stream from the
storage, we have to use different filter services (imports/exports) as
respective to the stream we are getting. Also storage type and versions.
If the stream access from the package is successful just like in
DocumentMetaDataAccess, I can try to work with the DomBuilder as in OOME or
as in DocumentMetaDataAccess. But as it requires different handling for
streams as described above, and as it feels wrong to handle everything
outside the relative files I am shifting the approach to using filters.
This document [3] shows about adding a new xml token. Maybe it will become
useful.
In the case of writer xml exporter, it calls sub-exporters which in turn
finally ends up calling addAttribute methods (document handlers), which
means each specific setting is exported separately and We can add
import/export methods within the filters for each application and the
filter classes which call those methods which is currently still in
progress as below.
I am currently wanting to use the XMLSettingsExportHelper
(xmloff/source/core/SettingsExportHelper.cxx) .It can take exporters from
writer, calc etc. It already has an export method for a string and a header
file so that I might be able to use it from the other folders. Afterwards,
I will have to learn about creating/registering a new service for the new
filters.
[1] https://www.openoffice.org/xml/package.html
[2] https://www.openoffice.org/xml/faq.html#6
[3] https://docs.libreoffice.org/xmloff.html
[4]
https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1embed_1_1Storage.html
Sorry, if I had made mistakes as I am new to filters.
Best,
Aung
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20240814/acc81e4d/attachment.htm>
More information about the LibreOffice
mailing list