diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-06-27 05:41:53 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-06-27 05:41:53 +0000 |
| commit | 6f008746350aab3d895a7905e1dd036a9b615a94 (patch) | |
| tree | 736226313250bc53a193b4f4cf516f6909efcc8e /src/uri-references.cpp | |
| parent | fix issue introduced in r14229 (diff) | |
| download | inkscape-6f008746350aab3d895a7905e1dd036a9b615a94.tar.gz inkscape-6f008746350aab3d895a7905e1dd036a9b615a94.zip | |
switch SPStyle to using SPFilterReference for filters; sp_style_new now requires an SPDocument; SPURIReference and SPFilterReference have an alternative constructor taking an owner_document instead of owner object
(bzr r3116)
Diffstat (limited to 'src/uri-references.cpp')
| -rw-r--r-- | src/uri-references.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/uri-references.cpp b/src/uri-references.cpp index 6b2a8401f..8e14c9336 100644 --- a/src/uri-references.cpp +++ b/src/uri-references.cpp @@ -24,19 +24,32 @@ static gchar *uri_to_id(SPDocument *document, const gchar *uri); namespace Inkscape { URIReference::URIReference(SPObject *owner) -: _owner(owner), _obj(NULL), _uri(NULL) + : _owner(owner), _owner_document(NULL), _obj(NULL), _uri(NULL) { g_assert(_owner != NULL); /* FIXME !!! attach to owner's destroy signal to clean up in case */ } +URIReference::URIReference(SPDocument *owner_document) + : _owner_document(owner_document), _owner(NULL), _obj(NULL), _uri(NULL) +{ + g_assert(_owner_document != NULL); +} + URIReference::~URIReference() { detach(); } void URIReference::attach(const URI &uri) throw(BadURIException) { - SPDocument *document = SP_OBJECT_DOCUMENT(_owner); + SPDocument *document; + if (_owner) { + document = SP_OBJECT_DOCUMENT(_owner); + } else if (_owner_document) { + document = _owner_document; + } else { + g_assert_not_reached(); + } gchar const *fragment = uri.getFragment(); if ( !uri.isRelative() || uri.getQuery() || !fragment ) { throw UnsupportedURIException(); |
