diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-10-26 22:31:12 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2013-10-26 22:31:12 +0000 |
| commit | bfb70c0a66051c665b8729916eceedb3cd7f51f8 (patch) | |
| tree | 3bc3e44d7b83526900175b5e86bbc1afeeab86f4 /src/sp-tref.cpp | |
| parent | Update to trunk (diff) | |
| parent | Added some consts. (diff) | |
| download | inkscape-bfb70c0a66051c665b8729916eceedb3cd7f51f8.tar.gz inkscape-bfb70c0a66051c665b8729916eceedb3cd7f51f8.zip | |
Update to trunk
(bzr r11950.1.190)
Diffstat (limited to 'src/sp-tref.cpp')
| -rw-r--r-- | src/sp-tref.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp index 1c0481547..edbb9faa7 100644 --- a/src/sp-tref.cpp +++ b/src/sp-tref.cpp @@ -206,7 +206,7 @@ Inkscape::XML::Node* SPTRef::write(Inkscape::XML::Document *xml_doc, Inkscape::X return repr; } -Geom::OptRect SPTRef::bbox(Geom::Affine const &transform, SPItem::BBoxType type) { +Geom::OptRect SPTRef::bbox(Geom::Affine const &transform, SPItem::BBoxType type) const { Geom::OptRect bbox; // find out the ancestor text which holds our layout SPObject const *parent_text = this; @@ -233,14 +233,14 @@ Geom::OptRect SPTRef::bbox(Geom::Affine const &transform, SPItem::BBoxType type) return bbox; } -const char* SPTRef::displayName() { +const char* SPTRef::displayName() const { return _("Cloned Character Data"); } -gchar* SPTRef::description() { - SPObject *referred = this->getObjectReferredTo(); +gchar* SPTRef::description() const { + SPObject const *referred = this->getObjectReferredTo(); - if (this->getObjectReferredTo()) { + if (referred) { char *child_desc; if (SP_IS_ITEM(referred)) { @@ -313,6 +313,19 @@ SPObject * SPTRef::getObjectReferredTo(void) return referredObject; } +/** + * Return the object referred to via the URI reference + */ +SPObject const *SPTRef::getObjectReferredTo() const { + SPObject *referredObject = NULL; + + if (uriOriginalRef) { + referredObject = uriOriginalRef->getObject(); + } + + return referredObject; +} + /** * Returns true when the given tref is allowed to refer to a particular object |
