From 1636c1dd1651780d01759676b194312529f211f7 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Sat, 25 Jun 2016 22:24:26 +0200 Subject: Moved next functions, added namespace, renamed range functions (bzr r14954.1.10) --- src/text-chemistry.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/text-chemistry.cpp') diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index fbbbe5807..5565464a1 100644 --- a/src/text-chemistry.cpp +++ b/src/text-chemistry.cpp @@ -43,7 +43,7 @@ using Inkscape::DocumentUndo; static SPItem * flowtext_in_selection(Inkscape::Selection *selection) { - std::vector items = selection->itemList(); + std::vector items = selection->items(); for(std::vector::const_iterator i=items.begin();i!=items.end();++i){ if (SP_IS_FLOWTEXT(*i)) return *i; @@ -54,7 +54,7 @@ flowtext_in_selection(Inkscape::Selection *selection) static SPItem * text_or_flowtext_in_selection(Inkscape::Selection *selection) { - std::vector items = selection->itemList(); + std::vector items = selection->items(); for(std::vector::const_iterator i=items.begin();i!=items.end();++i){ if (SP_IS_TEXT(*i) || SP_IS_FLOWTEXT(*i)) return *i; @@ -65,7 +65,7 @@ text_or_flowtext_in_selection(Inkscape::Selection *selection) static SPItem * shape_in_selection(Inkscape::Selection *selection) { - std::vector items = selection->itemList(); + std::vector items = selection->items(); for(std::vector::const_iterator i=items.begin();i!=items.end();++i){ if (SP_IS_SHAPE(*i)) return *i; @@ -87,7 +87,7 @@ text_put_on_path() Inkscape::XML::Document *xml_doc = desktop->doc()->getReprDoc(); - if (!text || !shape || selection->itemList().size() != 2) { + if (!text || !shape || selection->items().size() != 2) { desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select a text and a path to put text on path.")); return; } @@ -196,7 +196,7 @@ text_remove_from_path() } bool did = false; - std::vector items(selection->itemList()); + std::vector items(selection->items()); for(std::vector::const_iterator i=items.begin();i!=items.end();++i){ SPObject *obj = *i; @@ -214,7 +214,7 @@ text_remove_from_path() } else { DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Remove text from path")); - selection->setList(selection->itemList()); // reselect to update statusbar description + selection->setList(selection->items()); // reselect to update statusbar description } } @@ -260,7 +260,7 @@ text_remove_all_kerns() bool did = false; - std::vector items = selection->itemList(); + std::vector items = selection->items(); for(std::vector::const_iterator i=items.begin();i!=items.end();++i){ SPObject *obj = *i; @@ -296,7 +296,7 @@ text_flow_into_shape() SPItem *text = text_or_flowtext_in_selection(selection); SPItem *shape = shape_in_selection(selection); - if (!text || !shape || selection->itemList().size() < 2) { + if (!text || !shape || selection->items().size() < 2) { desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select a text and one or more paths or shapes to flow text into frame.")); return; } @@ -320,7 +320,7 @@ text_flow_into_shape() g_return_if_fail(SP_IS_FLOWREGION(object)); /* Add clones */ - std::vector items = selection->itemList(); + std::vector items = selection->items(); for(std::vector::const_iterator i=items.begin();i!=items.end();++i){ SPItem *item = *i; if (SP_IS_SHAPE(item)){ @@ -387,7 +387,7 @@ text_unflow () Inkscape::Selection *selection = desktop->getSelection(); - if (!flowtext_in_selection(selection) || selection->itemList().size() < 1) { + if (!flowtext_in_selection(selection) || selection->items().size() < 1) { desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select a flowed text to unflow it.")); return; } @@ -395,7 +395,7 @@ text_unflow () std::vector new_objs; GSList *old_objs = NULL; - std::vector items = selection->itemList(); + std::vector items = selection->items(); for(std::vector::const_iterator i=items.begin();i!=items.end();++i){ if (!SP_IS_FLOWTEXT(*i)) { @@ -480,7 +480,7 @@ flowtext_to_text() bool did = false; std::vector reprs; - std::vector items(selection->itemList()); + std::vector items(selection->items()); for(std::vector::const_iterator i=items.begin();i!=items.end();++i){ SPItem *item = *i; -- cgit v1.2.3 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/text-chemistry.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/text-chemistry.cpp') diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index 86aee1831..f539652c0 100644 --- a/src/text-chemistry.cpp +++ b/src/text-chemistry.cpp @@ -240,9 +240,9 @@ text_remove_all_kerns_recursively(SPObject *o) g_strfreev(xa_comma); } - for (SPObject *i = o->firstChild(); i != NULL; i = i->getNext()) { - text_remove_all_kerns_recursively(i); - i->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_TEXT_LAYOUT_MODIFIED_FLAG); + for (auto& i: o->_children) { + text_remove_all_kerns_recursively(&i); + i.requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_TEXT_LAYOUT_MODIFIED_FLAG); } } -- cgit v1.2.3 From 9e210a6d1333c3366681547e3e81593ef69ff73e Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Jul 2016 12:56:49 +0200 Subject: Last part of new SPObject children list (bzr r14954.1.20) --- src/text-chemistry.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/text-chemistry.cpp') diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index f539652c0..56048d1f7 100644 --- a/src/text-chemistry.cpp +++ b/src/text-chemistry.cpp @@ -142,8 +142,8 @@ text_put_on_path() // make a list of text children GSList *text_reprs = NULL; - for (SPObject *o = text->children; o != NULL; o = o->next) { - text_reprs = g_slist_prepend(text_reprs, o->getRepr()); + for(auto& o: text->_children) { + text_reprs = g_slist_prepend(text_reprs, o.getRepr()); } // create textPath and put it into the text @@ -353,9 +353,9 @@ text_flow_into_shape() Inkscape::GC::release(text_repr); } else { // reflow an already flowed text, preserving paras - for (SPObject *o = text->children; o != NULL; o = o->next) { - if (SP_IS_FLOWPARA(o)) { - Inkscape::XML::Node *para_repr = o->getRepr()->duplicate(xml_doc); + for(auto& o: text->_children) { + if (SP_IS_FLOWPARA(&o)) { + Inkscape::XML::Node *para_repr = o.getRepr()->duplicate(xml_doc); root_repr->appendChild(para_repr); object = doc->getObjectByRepr(para_repr); g_return_if_fail(SP_IS_FLOWPARA(object)); -- 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/text-chemistry.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/text-chemistry.cpp') diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index 56048d1f7..a950dfebe 100644 --- a/src/text-chemistry.cpp +++ b/src/text-chemistry.cpp @@ -142,7 +142,7 @@ text_put_on_path() // make a list of text children GSList *text_reprs = NULL; - for(auto& o: text->_children) { + for(auto& o: text->children) { text_reprs = g_slist_prepend(text_reprs, o.getRepr()); } @@ -240,7 +240,7 @@ text_remove_all_kerns_recursively(SPObject *o) g_strfreev(xa_comma); } - for (auto& i: o->_children) { + for (auto& i: o->children) { text_remove_all_kerns_recursively(&i); i.requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_TEXT_LAYOUT_MODIFIED_FLAG); } @@ -353,7 +353,7 @@ text_flow_into_shape() Inkscape::GC::release(text_repr); } else { // reflow an already flowed text, preserving paras - for(auto& o: text->_children) { + for(auto& o: text->children) { if (SP_IS_FLOWPARA(&o)) { Inkscape::XML::Node *para_repr = o.getRepr()->duplicate(xml_doc); root_repr->appendChild(para_repr); -- cgit v1.2.3