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


Hi Michael,

Thanks a lot for your detailled answer.

Le 15/11/2013 18:26, Michael Stahl a écrit :
hi Arnaud,

sorry for late reply, somehow i missed your mail initially :(

On 06/11/13 10:00, Miklos Vajna wrote:
Hi,

On Thu, Oct 31, 2013 at 02:37:21PM +0100, arkarell <arnaud.malguy@arkarell.com> wrote:
I would like to extend support for "RDF metadata" in LibreOffice
Writer in order to be able to set metadata
on a lot of elements unsupported today like tables.
Is there anybody that could help me to find what source code are involved ?
unfortunately i don't have time to work on the implementation myself but
can point you to the relevant places in the code, answer questions and
review patches.

the main parts for adding an xml:id are:

1. derive the core object from sfx2::Metadatable
    and implement the pure virtual methods
    (see include/sfx2/Metadatable.hxx)

2. derive the UNO wrapper object from sfx2::MetadatableMixin
    and implement the pure virtual methods

3. adapt all places that copy the core object to call
    Metadatable::RegisterAsCopyOf

4. for Undo, insert calls to Metadatable::CreateUndo
    and Metadatable::RestoreMetadata

5. in case the core object can be "merged" like paragraphs:
    add call to Metadatable::JoinMetadatable

of course you can "git grep" for these functions and classes to see
usage examples.

well one thing that is still a sort of unresolved conceptual issue is
how to copy/paste the RDF metadata in case some content entity with an
xml:id is copied.  especially _which_ RDF statements should be copied in
that case.
I managed few days ago to implement the points 1 and 2 for text:table.
I worked in analogy with what was done for sections.
I used the SwTableFmt core object and the SwXTextTable UNO wrapper object. But I also modified the SwXMLExport::ExportTable method in sw/source/filter/xml/xmltble.cxx in order to export xml:id. And it's working, I can set and retrieve rdf metadata on tables !!!

I didn't treat any undo/copy/paste/merge, because first, as you said, specifications are missing and needs could be very different, and second because it doesn't seem to be already treated for yet supported elements. For instance, if i set metadata on a paragraph and copy/paste this paragraph,
the rdf data are not copied.

My problem in my modifications is that I put some code at some place but without knowledge of the purpose and links of impacted classes. And I'm not sure to use the good class : for instance for table support in core object, why SwTableFmt and not SwTable ? Because SwSectionFmt ? Do you have some documentation to understand these objects (core, uno wrapper, std or *Fmt, ...) and their relations ?

Thanks

regards,

Arnaud

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.