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-use.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/sp-use.cpp') diff --git a/src/sp-use.cpp b/src/sp-use.cpp index ec367d786..b2a51b8d9 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -178,7 +178,7 @@ Inkscape::XML::Node* SPUse::write(Inkscape::XML::Document *xml_doc, Inkscape::XM return repr; } -Geom::OptRect SPUse::bbox(Geom::Affine const &transform, SPItem::BBoxType bboxtype) { +Geom::OptRect SPUse::bbox(Geom::Affine const &transform, SPItem::BBoxType bboxtype) const { Geom::OptRect bbox; if (this->child) { @@ -208,7 +208,7 @@ void SPUse::print(SPPrintContext* ctx) { } } -const char* SPUse::displayName() { +const char* SPUse::displayName() const { if (this->child && SP_IS_SYMBOL( this->child )) { return _("Symbol"); } @@ -216,7 +216,7 @@ const char* SPUse::displayName() { return _("Clone"); } -gchar* SPUse::description() { +gchar* SPUse::description() const { if (this->child) { if( SP_IS_SYMBOL( this->child ) ) { return g_strdup_printf(_("called %s"), this->child->title()); @@ -295,6 +295,10 @@ SPItem *SPUse::root() { return orig; } +SPItem const *SPUse::root() const { + return const_cast(this)->root(); +} + /** * Returns the effective transform that goes from the ultimate original to given SPUse, both ends * included. @@ -652,8 +656,8 @@ SPItem *SPUse::get_original() { return ref; } -void SPUse::snappoints(std::vector &p, Inkscape::SnapPreferences const *snapprefs) { - SPItem *root = this->root(); +void SPUse::snappoints(std::vector &p, Inkscape::SnapPreferences const *snapprefs) const { + SPItem const *root = this->root(); if (!root) { return; -- cgit v1.2.3