From 67c3fc5586ae05506f75bb30fe46a071e20613d2 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 24 Apr 2014 14:04:31 +0200 Subject: Clean up of style code, removal of SPFontStyle. Step 2. (bzr r13300) --- src/widgets/text-toolbar.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index 7b59fa633..3a4f315da 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -72,20 +72,20 @@ using Inkscape::UI::PrefPusher; static void sp_print_font( SPStyle *query ) { - bool family_set = query->text->font_family.set; + bool family_set = query->font_family.set; bool style_set = query->font_style.set; - bool fontspec_set = query->text->font_specification.set; + bool fontspec_set = query->font_specification.set; std::cout << " Family set? " << family_set << " Style set? " << style_set << " FontSpec set? " << fontspec_set << std::endl; std::cout << " Family: " - << (query->text->font_family.value ? query->text->font_family.value : "No value") + << (query->font_family.value ? query->font_family.value : "No value") << " Style: " << query->font_style.computed << " Weight: " << query->font_weight.computed << " FontSpec: " - << (query->text->font_specification.value ? query->text->font_specification.value : "No value") + << (query->font_specification.value ? query->font_specification.value : "No value") << std::endl; std::cout << " LineHeight: " << query->line_height.computed << " WordSpacing: " << query->word_spacing.computed @@ -930,7 +930,6 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/ } // If we have valid query data for text (font-family, font-specification) set toolbar accordingly. - if (query->text) { // Size (average of text selected) Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -1058,11 +1057,11 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/ ege_select_one_action_set_active( textOrientationAction, activeButton2 ); - } // if( query->text ) + } #ifdef DEBUG_TEXT std::cout << " GUI: fontfamily.value: " - << (query->text->font_family.value ? query->text->font_family.value : "No value") + << (query->font_family.value ? query->font_family.value : "No value") << std::endl; std::cout << " GUI: font_size.computed: " << query->font_size.computed << std::endl; std::cout << " GUI: font_weight.computed: " << query->font_weight.computed << std::endl; @@ -1174,15 +1173,15 @@ static void sp_text_toolbox_select_cb( GtkEntry* entry, GtkEntryIconPosition /*p SPItem *item = SP_ITEM(i->data); SPStyle *style = item->style; - if (style && style->text) { + if (style) { Glib::ustring family_style; - if (style->text->font_family.set) { - family_style = style->text->font_family.value; + if (style->font_family.set) { + family_style = style->font_family.value; //std::cout << " family style from font_family: " << family_style << std::endl; } - else if (style->text->font_specification.set) { - family_style = style->text->font_specification.value; + else if (style->font_specification.set) { + family_style = style->font_specification.value; //std::cout << " family style from font_spec: " << family_style << std::endl; } -- cgit v1.2.3 From 20452bbd40fe1d93b2093cb5dea8e4cb8ae967d3 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 24 Apr 2014 14:53:30 +0200 Subject: Clean up of style code: refactor marker properties. Step 3. (bzr r13301) --- src/widgets/stroke-style.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index a4cca9472..0e0a4fd72 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -581,7 +581,8 @@ StrokeStyle::forkMarker(SPObject *marker, int loc, SPItem *item) Glib::ustring urlId = Glib::ustring::format("url(#", marker->getRepr()->attribute("id"), ")"); unsigned int refs = 0; for (int i = SP_MARKER_LOC_START; i < SP_MARKER_LOC_QTY; i++) { - if (item->style->marker[i].set && !strcmp(urlId.c_str(), item->style->marker[i].value)) { + if (item->style->marker_ptrs[i]->set && + !strcmp(urlId.c_str(), item->style->marker_ptrs[i]->value)) { refs++; } } @@ -1176,11 +1177,11 @@ StrokeStyle::updateAllMarkers(GSList const *objects) combo->setDesktop(desktop); - if (object->style->marker[keyloc[i].loc].value != NULL && !all_texts) { + if (object->style->marker_ptrs[keyloc[i].loc]->value != NULL && !all_texts) { // If the object has this type of markers, // Extract the name of the marker that the object uses - SPObject *marker = getMarkerObj(object->style->marker[keyloc[i].loc].value, object->document); + SPObject *marker = getMarkerObj(object->style->marker_ptrs[keyloc[i].loc]->value, object->document); // Scroll the combobox to that marker combo->set_current(marker); -- cgit v1.2.3 From b9f4d7dfe7411f551192a98a3d8151e14149c5ae Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Sat, 26 Apr 2014 10:17:28 +0200 Subject: Clean up of style code: Patch from suv: SPStyle: struct -> class (bzr r13309) --- src/widgets/paint-selector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/paint-selector.h b/src/widgets/paint-selector.h index d3b3f4116..d6ad3f50c 100644 --- a/src/widgets/paint-selector.h +++ b/src/widgets/paint-selector.h @@ -23,7 +23,7 @@ class SPGradient; class SPDesktop; class SPPattern; -struct SPStyle; +class SPStyle; #define SP_TYPE_PAINT_SELECTOR (sp_paint_selector_get_type ()) #define SP_PAINT_SELECTOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SP_TYPE_PAINT_SELECTOR, SPPaintSelector)) -- cgit v1.2.3