diff options
| author | Marc Jeanmougin <mc@localhost.localdomain> | 2015-02-17 02:00:37 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <mc@localhost.localdomain> | 2015-02-17 02:00:37 +0000 |
| commit | a7f2b2ba3f13ceb60376802f4a31e104153839e8 (patch) | |
| tree | 6db393e9e5a0a9ab7916a0e7ed29d875efa39ea1 /src/widgets/text-toolbar.cpp | |
| parent | device-manager: Get rid of GLists (diff) | |
| download | inkscape-a7f2b2ba3f13ceb60376802f4a31e104153839e8.tar.gz inkscape-a7f2b2ba3f13ceb60376802f4a31e104153839e8.zip | |
At first, I was thinking "I just have to go to the selection file, and change that GSList* with a std::list, then resolve the few problems"
So, i tried that.
And I will continue tomorrow, and the days after, on and on.
(bzr r13922.1.1)
Diffstat (limited to 'src/widgets/text-toolbar.cpp')
| -rw-r--r-- | src/widgets/text-toolbar.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index 3d2e6eef8..ba7dfc1fd 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -366,9 +366,10 @@ static void sp_text_align_mode_changed( EgeSelectOneAction *act, GObject *tbl ) // move the x of all texts to preserve the same bbox Inkscape::Selection *selection = desktop->getSelection(); - for (GSList const *items = selection->itemList(); items != NULL; items = items->next) { - if (SP_IS_TEXT(SP_ITEM(items->data))) { - SPItem *item = SP_ITEM(items->data); + SelContainer itemlist=selection->itemList(); + for(SelContainer::const_iterator i=itemlist.begin();i!=itemlist.end();i++){ + if (SP_IS_TEXT(SP_ITEM(*i))) { + SPItem *item = SP_ITEM(*i); unsigned writing_mode = item->style->writing_mode.value; // below, variable names suggest horizontal move, but we check the writing direction @@ -517,11 +518,11 @@ static void sp_text_lineheight_value_changed( GtkAdjustment *adj, GObject *tbl ) // Until deprecated sodipodi:linespacing purged: Inkscape::Selection *selection = desktop->getSelection(); - GSList const *items = selection->itemList(); bool modmade = false; - for (; items != NULL; items = items->next) { - if (SP_IS_TEXT (items->data)) { - SP_OBJECT(items->data)->getRepr()->setAttribute("sodipodi:linespacing", sp_repr_css_property (css, "line-height", NULL)); + SelContainer itemlist=selection->itemList(); + for(SelContainer::const_iterator i=itemlist.begin();i!=itemlist.end();i++){ + if (SP_IS_TEXT (*i)) { + SP_OBJECT(*i)->getRepr()->setAttribute("sodipodi:linespacing", sp_repr_css_property (css, "line-height", NULL)); modmade = true; } } @@ -863,12 +864,11 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/ // Only flowed text can be justified, only normal text can be kerned... // Find out if we have flowed text now so we can use it several places gboolean isFlow = false; - for (GSList const *items = SP_ACTIVE_DESKTOP->getSelection()->itemList(); - items != NULL; - items = items->next) { + SelContainer itemlist=SP_ACTIVE_DESKTOP->getSelection()->itemList(); + for(SelContainer::const_iterator i=itemlist.begin();i!=itemlist.end();i++){ // const gchar* id = reinterpret_cast<SPItem *>(items->data)->getId(); // std::cout << " " << id << std::endl; - if( SP_IS_FLOWTEXT(SP_ITEM(items->data))) { + if( SP_IS_FLOWTEXT(SP_ITEM(*i))) { isFlow = true; // std::cout << " Found flowed text" << std::endl; break; @@ -1153,14 +1153,14 @@ static void sp_text_toolbox_select_cb( GtkEntry* entry, GtkEntryIconPosition /*p //std::cout << "text_toolbox_missing_font_cb: selecting: " << family << std::endl; // Get all items with matching font-family set (not inherited!). - GSList *selectList = NULL; + SelContainer selectList; SPDesktop *desktop = SP_ACTIVE_DESKTOP; SPDocument *document = desktop->getDocument(); - GSList *allList = get_all_items(NULL, document->getRoot(), desktop, false, false, true, NULL); - for (GSList *i = allList; i != NULL; i = i->next) { - - SPItem *item = SP_ITEM(i->data); + SelContainer x,y; + SelContainer allList = get_all_items(x, document->getRoot(), desktop, false, false, true, y); + for(SelContainer::const_iterator i=allList.begin();i!=allList.end();i++){ + SPItem *item = SP_ITEM(*i); SPStyle *style = item->style; if (style) { @@ -1177,7 +1177,7 @@ static void sp_text_toolbox_select_cb( GtkEntry* entry, GtkEntryIconPosition /*p if (family_style.compare( family ) == 0 ) { //std::cout << " found: " << item->getId() << std::endl; - selectList = g_slist_prepend (selectList, item); + selectList.push_front(static_cast<SPObject*>(item)); } } } |
