From 73edade30f70b4c0ad94c9561b4e4ec0675465b0 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 27 Oct 2013 00:00:51 +0200 Subject: Added some consts. (bzr r12729) --- src/sp-tref.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/sp-tref.cpp') 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 -- cgit v1.2.3