summaryrefslogtreecommitdiffstats
path: root/src/sp-tref.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp-tref.cpp')
-rw-r--r--src/sp-tref.cpp23
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