text:id is deprecated
Boudewijn Rempt
boud at valdyas.org
Wed Dec 14 15:21:53 GMT 2011
On Wednesday 14 December 2011 Dec, C. Boemann wrote:
> all well, except how do the animation framework get the related qobject from
> this?
I'm not sure how that works now, I guess they use the xml:id or draw:id as a qstring key into a map. So then it should use the reference, not the id string itself as a key into that map.
The thing is that we've got all these QString id's around that have weird and meaningful formats -- rdf-uuid, ftn-number and so on, and now we have to share the xml:id's among different maps, so the id cannot have any meaning anymore and should be replaced by a uuid.
Now the tricky part I'm running into is that sometimes we assume that if there's an xml:id present, it _must_ mean there's some bit of rdf, like this bit of code in KoBookmark::loadOdf:
// Add inline Rdf to the bookmark.
if (element.hasAttributeNS(KoXmlNS::xhtml, "property") || element.hasAttribute("id")) {
KoTextInlineRdf* inlineRdf = new KoTextInlineRdf(const_cast<QTextDocument*>(d->document), this);
if (inlineRdf->loadOdf(element)) {
setInlineRdf(inlineRdf);
}
}
and I'm still not sure how to fix that -- maybe check whether there's rdf in the manifest.rdf with the same id. (I'm also not sure why it's "element.hasAttribute("id"), not element.hasAttribute("xml:id") or element.hasAttributeNS("KoXmlNS::xml, "id"))
--
Boudewijn Rempt
http://www.valdyas.org, http://www.krita.org, http://www.boudewijnrempt.nl
More information about the calligra-devel
mailing list