From d07f7a584ecfbb026421dc2d3b9b984a696409f2 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Mon, 23 Sep 2013 22:22:43 +0200 Subject: Added missing registration of FeDistantLight; made sure warnings on missing types are always issued. Fixed bugs: - https://launchpad.net/bugs/1229326 (bzr r12580) --- src/sp-object.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/sp-object.cpp') diff --git a/src/sp-object.cpp b/src/sp-object.cpp index 8c7a24a2b..fa7d30dab 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -597,6 +597,7 @@ void SPObject::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) ochild->invoke_build(object->document, child, object->cloned); } catch (const FactoryExceptions::TypeNotRegistered& e) { std::string node = e.what(); + // special cases if (node == "rdf:RDF") return; // no SP node yet if (node == "inkscape:clipboard") return; // SP node not necessary @@ -646,27 +647,20 @@ void SPObject::build(SPDocument *document, Inkscape::XML::Node *repr) { object->readAttr("inkscape:collect"); for (Inkscape::XML::Node *rchild = repr->firstChild() ; rchild != NULL; rchild = rchild->next()) { -// GType type = sp_repr_type_lookup(rchild); -// if (!type) { -// continue; -// } -// SPObject *child = SP_OBJECT(g_object_new(type, 0)); - -// SPObject* child = SPFactory::instance().createObject(*rchild); -// if (!child) { -// continue; -// } - try { const std::string typeString = NodeTraits::get_type_string(*rchild); + // special cases + if (typeString == "rdf:RDF") continue; // no SP node yet + if (typeString == "inkscape:clipboard") continue; // SP node not necessary + SPObject* child = SPFactory::instance().createObject(typeString); object->attach(child, object->lastChild()); sp_object_unref(child, NULL); child->invoke_build(document, rchild, object->cloned); } catch (const FactoryExceptions::TypeNotRegistered& e) { - //g_warning("TypeNotRegistered exception: %s", e.what()); + g_warning("TypeNotRegistered exception: %s", e.what()); } } } -- cgit v1.2.3