From d1947e768272c703674129d5c583204ff2b59251 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 13 Jul 2016 13:36:19 +0200 Subject: Second part of new SPObject children list (bzr r14954.1.19) --- src/sp-tspan.cpp | 80 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'src/sp-tspan.cpp') diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp index 05f8430ba..23df18503 100644 --- a/src/sp-tspan.cpp +++ b/src/sp-tspan.cpp @@ -96,9 +96,9 @@ void SPTSpan::update(SPCtx *ctx, guint flags) { } childflags &= SP_OBJECT_MODIFIED_CASCADE; - for ( SPObject *ochild = this->firstChild() ; ochild ; ochild = ochild->getNext() ) { - if ( flags || ( ochild->uflags & SP_OBJECT_MODIFIED_FLAG )) { - ochild->updateDisplay(ctx, childflags); + for (auto& ochild: _children) { + if ( flags || ( ochild.uflags & SP_OBJECT_MODIFIED_FLAG )) { + ochild.updateDisplay(ctx, childflags); } } @@ -128,9 +128,9 @@ void SPTSpan::modified(unsigned int flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; - for ( SPObject *ochild = this->firstChild() ; ochild ; ochild = ochild->getNext() ) { - if (flags || (ochild->mflags & SP_OBJECT_MODIFIED_FLAG)) { - ochild->emitModified(flags); + for (auto& ochild: _children) { + if (flags || (ochild.mflags & SP_OBJECT_MODIFIED_FLAG)) { + ochild.emitModified(flags); } } } @@ -175,15 +175,15 @@ Inkscape::XML::Node* SPTSpan::write(Inkscape::XML::Document *xml_doc, Inkscape:: if ( flags&SP_OBJECT_WRITE_BUILD ) { GSList *l = NULL; - for (SPObject* child = this->firstChild() ; child ; child = child->getNext() ) { + for (auto& child: _children) { Inkscape::XML::Node* c_repr=NULL; - if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) { - c_repr = child->updateRepr(xml_doc, NULL, flags); - } else if ( SP_IS_TEXTPATH(child) ) { - //c_repr = child->updateRepr(xml_doc, NULL, flags); // shouldn't happen - } else if ( SP_IS_STRING(child) ) { - c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str()); + if ( SP_IS_TSPAN(&child) || SP_IS_TREF(&child) ) { + c_repr = child.updateRepr(xml_doc, NULL, flags); + } else if ( SP_IS_TEXTPATH(&child) ) { + //c_repr = child.updateRepr(xml_doc, NULL, flags); // shouldn't happen + } else if ( SP_IS_STRING(&child) ) { + c_repr = xml_doc->createTextNode(SP_STRING(&child)->string.c_str()); } if ( c_repr ) { @@ -197,13 +197,13 @@ Inkscape::XML::Node* SPTSpan::write(Inkscape::XML::Document *xml_doc, Inkscape:: l = g_slist_remove(l, l->data); } } else { - for (SPObject* child = this->firstChild() ; child ; child = child->getNext() ) { - if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) { - child->updateRepr(flags); - } else if ( SP_IS_TEXTPATH(child) ) { + for (auto& child: _children) { + if ( SP_IS_TSPAN(&child) || SP_IS_TREF(&child) ) { + child.updateRepr(flags); + } else if ( SP_IS_TEXTPATH(&child) ) { //c_repr = child->updateRepr(xml_doc, NULL, flags); // shouldn't happen - } else if ( SP_IS_STRING(child) ) { - child->getRepr()->setContent(SP_STRING(child)->string.c_str()); + } else if ( SP_IS_STRING(&child) ) { + child.getRepr()->setContent(SP_STRING(&child)->string.c_str()); } } } @@ -313,9 +313,9 @@ void SPTextPath::update(SPCtx *ctx, guint flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; - for ( SPObject *ochild = this->firstChild() ; ochild ; ochild = ochild->getNext() ) { - if ( flags || ( ochild->uflags & SP_OBJECT_MODIFIED_FLAG )) { - ochild->updateDisplay(ctx, flags); + for (auto& ochild: _children) { + if ( flags || ( ochild.uflags & SP_OBJECT_MODIFIED_FLAG )) { + ochild.updateDisplay(ctx, flags); } } @@ -367,9 +367,9 @@ void SPTextPath::modified(unsigned int flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; - for ( SPObject *ochild = this->firstChild() ; ochild ; ochild = ochild->getNext() ) { - if (flags || (ochild->mflags & SP_OBJECT_MODIFIED_FLAG)) { - ochild->emitModified(flags); + for (auto& ochild: _children) { + if (flags || (ochild.mflags & SP_OBJECT_MODIFIED_FLAG)) { + ochild.emitModified(flags); } } } @@ -399,15 +399,15 @@ Inkscape::XML::Node* SPTextPath::write(Inkscape::XML::Document *xml_doc, Inkscap if ( flags & SP_OBJECT_WRITE_BUILD ) { GSList *l = NULL; - for (SPObject* child = this->firstChild() ; child ; child = child->getNext() ) { + for (auto& child: _children) { Inkscape::XML::Node* c_repr=NULL; - if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) { - c_repr = child->updateRepr(xml_doc, NULL, flags); - } else if ( SP_IS_TEXTPATH(child) ) { + if ( SP_IS_TSPAN(&child) || SP_IS_TREF(&child) ) { + c_repr = child.updateRepr(xml_doc, NULL, flags); + } else if ( SP_IS_TEXTPATH(&child) ) { //c_repr = child->updateRepr(xml_doc, NULL, flags); // shouldn't happen - } else if ( SP_IS_STRING(child) ) { - c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str()); + } else if ( SP_IS_STRING(&child) ) { + c_repr = xml_doc->createTextNode(SP_STRING(&child)->string.c_str()); } if ( c_repr ) { @@ -421,13 +421,13 @@ Inkscape::XML::Node* SPTextPath::write(Inkscape::XML::Document *xml_doc, Inkscap l = g_slist_remove(l, l->data); } } else { - for (SPObject* child = this->firstChild() ; child ; child = child->getNext() ) { - if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) { - child->updateRepr(flags); - } else if ( SP_IS_TEXTPATH(child) ) { - //c_repr = child->updateRepr(xml_doc, NULL, flags); // shouldn't happen - } else if ( SP_IS_STRING(child) ) { - child->getRepr()->setContent(SP_STRING(child)->string.c_str()); + for (auto& child: _children) { + if ( SP_IS_TSPAN(&child) || SP_IS_TREF(&child) ) { + child.updateRepr(flags); + } else if ( SP_IS_TEXTPATH(&child) ) { + //c_repr = child.updateRepr(xml_doc, NULL, flags); // shouldn't happen + } else if ( SP_IS_STRING(&child) ) { + child.getRepr()->setContent(SP_STRING(&child)->string.c_str()); } } } @@ -466,8 +466,8 @@ void sp_textpath_to_text(SPObject *tp) // make a list of textpath children GSList *tp_reprs = NULL; - for (SPObject *o = tp->firstChild() ; o != NULL; o = o->next) { - tp_reprs = g_slist_prepend(tp_reprs, o->getRepr()); + for (auto& o: tp->_children) { + tp_reprs = g_slist_prepend(tp_reprs, o.getRepr()); } for ( GSList *i = tp_reprs ; i ; i = i->next ) { -- cgit v1.2.3 From 24d3f50003ca3cec6a03a7f5267cc4fe5588c69f Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Jul 2016 13:17:21 +0200 Subject: Renamed children list in SPObject (bzr r14954.1.21) --- src/sp-tspan.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/sp-tspan.cpp') diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp index 23df18503..5a82f2c05 100644 --- a/src/sp-tspan.cpp +++ b/src/sp-tspan.cpp @@ -96,7 +96,7 @@ void SPTSpan::update(SPCtx *ctx, guint flags) { } childflags &= SP_OBJECT_MODIFIED_CASCADE; - for (auto& ochild: _children) { + for (auto& ochild: children) { if ( flags || ( ochild.uflags & SP_OBJECT_MODIFIED_FLAG )) { ochild.updateDisplay(ctx, childflags); } @@ -128,7 +128,7 @@ void SPTSpan::modified(unsigned int flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; - for (auto& ochild: _children) { + for (auto& ochild: children) { if (flags || (ochild.mflags & SP_OBJECT_MODIFIED_FLAG)) { ochild.emitModified(flags); } @@ -175,7 +175,7 @@ Inkscape::XML::Node* SPTSpan::write(Inkscape::XML::Document *xml_doc, Inkscape:: if ( flags&SP_OBJECT_WRITE_BUILD ) { GSList *l = NULL; - for (auto& child: _children) { + for (auto& child: children) { Inkscape::XML::Node* c_repr=NULL; if ( SP_IS_TSPAN(&child) || SP_IS_TREF(&child) ) { @@ -197,7 +197,7 @@ Inkscape::XML::Node* SPTSpan::write(Inkscape::XML::Document *xml_doc, Inkscape:: l = g_slist_remove(l, l->data); } } else { - for (auto& child: _children) { + for (auto& child: children) { if ( SP_IS_TSPAN(&child) || SP_IS_TREF(&child) ) { child.updateRepr(flags); } else if ( SP_IS_TEXTPATH(&child) ) { @@ -313,7 +313,7 @@ void SPTextPath::update(SPCtx *ctx, guint flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; - for (auto& ochild: _children) { + for (auto& ochild: children) { if ( flags || ( ochild.uflags & SP_OBJECT_MODIFIED_FLAG )) { ochild.updateDisplay(ctx, flags); } @@ -367,7 +367,7 @@ void SPTextPath::modified(unsigned int flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; - for (auto& ochild: _children) { + for (auto& ochild: children) { if (flags || (ochild.mflags & SP_OBJECT_MODIFIED_FLAG)) { ochild.emitModified(flags); } @@ -399,7 +399,7 @@ Inkscape::XML::Node* SPTextPath::write(Inkscape::XML::Document *xml_doc, Inkscap if ( flags & SP_OBJECT_WRITE_BUILD ) { GSList *l = NULL; - for (auto& child: _children) { + for (auto& child: children) { Inkscape::XML::Node* c_repr=NULL; if ( SP_IS_TSPAN(&child) || SP_IS_TREF(&child) ) { @@ -421,7 +421,7 @@ Inkscape::XML::Node* SPTextPath::write(Inkscape::XML::Document *xml_doc, Inkscap l = g_slist_remove(l, l->data); } } else { - for (auto& child: _children) { + for (auto& child: children) { if ( SP_IS_TSPAN(&child) || SP_IS_TREF(&child) ) { child.updateRepr(flags); } else if ( SP_IS_TEXTPATH(&child) ) { @@ -466,7 +466,7 @@ void sp_textpath_to_text(SPObject *tp) // make a list of textpath children GSList *tp_reprs = NULL; - for (auto& o: tp->_children) { + for (auto& o: tp->children) { tp_reprs = g_slist_prepend(tp_reprs, o.getRepr()); } -- cgit v1.2.3 From 35830f456cadaecf8b8e3944e3031a1a93f6cb41 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 3 Aug 2016 15:29:38 +0200 Subject: Removed unused includes, decreased compilation time. Once again (bzr r15034) --- src/sp-tspan.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/sp-tspan.cpp') diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp index 05f8430ba..2b4ecf92b 100644 --- a/src/sp-tspan.cpp +++ b/src/sp-tspan.cpp @@ -24,7 +24,7 @@ */ #ifdef HAVE_CONFIG_H -# include "config.h" +#include #endif #include @@ -40,9 +40,7 @@ #include "sp-textpath.h" #include "text-editing.h" #include "style.h" -#include "xml/repr.h" #include "document.h" -#include "2geom/transforms.h" /*##################################################### # SPTSPAN -- cgit v1.2.3