diff options
Diffstat (limited to 'src/widgets/stroke-style.cpp')
| -rw-r--r-- | src/widgets/stroke-style.cpp | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index 9da39bac4..8b5582163 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -157,8 +157,9 @@ sp_marker_prev_new(unsigned psize, gchar const *mname, { // Retrieve the marker named 'mname' from the source SVG document SPObject const *marker = source->getObjectById(mname); - if (marker == NULL) + if (marker == NULL) { return NULL; + } // Create a copy repr of the marker with id="sample" Inkscape::XML::Document *xml_doc = sandbox->getReprDoc(); @@ -168,8 +169,9 @@ sp_marker_prev_new(unsigned psize, gchar const *mname, // Replace the old sample in the sandbox by the new one Inkscape::XML::Node *defsrepr = sandbox->getObjectById("defs")->getRepr(); SPObject *oldmarker = sandbox->getObjectById("sample"); - if (oldmarker) + if (oldmarker) { oldmarker->deleteObject(false); + } defsrepr->appendChild(mrepr); Inkscape::GC::release(mrepr); @@ -183,12 +185,14 @@ sp_marker_prev_new(unsigned psize, gchar const *mname, sandbox->getRoot()->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); sandbox->ensureUpToDate(); - if (object == NULL || !SP_IS_ITEM(object)) + if (object == NULL || !SP_IS_ITEM(object)) { return NULL; // sandbox broken? + } + SPItem *item = SP_ITEM(object); // Find object's bbox in document - Geom::Affine const i2doc(SP_ITEM(object)->i2doc_affine()); - Geom::OptRect dbox = SP_ITEM(object)->getBounds(i2doc); + Geom::Affine const i2doc(item->i2doc_affine()); + Geom::OptRect dbox = item->getBounds(i2doc); if (!dbox) { return NULL; @@ -246,7 +250,7 @@ sp_marker_menu_build (Gtk::Menu *m, GSList *marker_list, SPDocument *source, SPD // Do this here, outside of loop, to speed up preview generation: NRArena const *arena = NRArena::create(); unsigned const visionkey = SPItem::display_key_new(1); - NRArenaItem *root = SP_ITEM(sandbox->getRoot())->invoke_show((NRArena *) arena, visionkey, SP_ITEM_SHOW_DISPLAY); + NRArenaItem *root = sandbox->getRoot()->invoke_show((NRArena *) arena, visionkey, SP_ITEM_SHOW_DISPLAY); for (; marker_list != NULL; marker_list = marker_list->next) { Inkscape::XML::Node *repr = reinterpret_cast<SPItem *>(marker_list->data)->getRepr(); @@ -284,7 +288,7 @@ sp_marker_menu_build (Gtk::Menu *m, GSList *marker_list, SPDocument *source, SPD m->append(*i); } - SP_ITEM(sandbox->getRoot())->invoke_hide(visionkey); + sandbox->getRoot()->invoke_hide(visionkey); nr_object_unref((NRObject *) arena); } @@ -721,7 +725,7 @@ sp_stroke_style_line_widget_new(void) tb = NULL; - tb = sp_stroke_radio_button(tb, INKSCAPE_ICON_STROKE_JOIN_MITER, + tb = sp_stroke_radio_button(tb, INKSCAPE_ICON("stroke-join-miter"), hb, spw, "join", "miter"); // TRANSLATORS: Miter join: joining lines with a sharp (pointed) corner. @@ -730,7 +734,7 @@ sp_stroke_style_line_widget_new(void) tt->set_tip(*tb, _("Miter join")); spw->set_data("miter join", tb); - tb = sp_stroke_radio_button(tb, INKSCAPE_ICON_STROKE_JOIN_ROUND, + tb = sp_stroke_radio_button(tb, INKSCAPE_ICON("stroke-join-round"), hb, spw, "join", "round"); @@ -740,7 +744,7 @@ sp_stroke_style_line_widget_new(void) tt->set_tip(*tb, _("Round join")); spw->set_data("round join", tb); - tb = sp_stroke_radio_button(tb, INKSCAPE_ICON_STROKE_JOIN_BEVEL, + tb = sp_stroke_radio_button(tb, INKSCAPE_ICON("stroke-join-bevel"), hb, spw, "join", "bevel"); @@ -787,7 +791,7 @@ sp_stroke_style_line_widget_new(void) tb = NULL; - tb = sp_stroke_radio_button(tb, INKSCAPE_ICON_STROKE_CAP_BUTT, + tb = sp_stroke_radio_button(tb, INKSCAPE_ICON("stroke-cap-butt"), hb, spw, "cap", "butt"); spw->set_data("cap butt", tb); @@ -795,7 +799,7 @@ sp_stroke_style_line_widget_new(void) // of the line; the ends of the line are square tt->set_tip(*tb, _("Butt cap")); - tb = sp_stroke_radio_button(tb, INKSCAPE_ICON_STROKE_CAP_ROUND, + tb = sp_stroke_radio_button(tb, INKSCAPE_ICON("stroke-cap-round"), hb, spw, "cap", "round"); spw->set_data("cap round", tb); @@ -803,7 +807,7 @@ sp_stroke_style_line_widget_new(void) // line; the ends of the line are rounded tt->set_tip(*tb, _("Round cap")); - tb = sp_stroke_radio_button(tb, INKSCAPE_ICON_STROKE_CAP_SQUARE, + tb = sp_stroke_radio_button(tb, INKSCAPE_ICON("stroke-cap-square"), hb, spw, "cap", "square"); spw->set_data("cap square", tb); @@ -949,13 +953,13 @@ sp_jointype_set (Gtk::Container *spw, unsigned const jointype) Gtk::RadioButton *tb = NULL; switch (jointype) { case SP_STROKE_LINEJOIN_MITER: - tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON_STROKE_JOIN_MITER)); + tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON("stroke-join-miter"))); break; case SP_STROKE_LINEJOIN_ROUND: - tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON_STROKE_JOIN_ROUND)); + tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON("stroke-join-round"))); break; case SP_STROKE_LINEJOIN_BEVEL: - tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON_STROKE_JOIN_BEVEL)); + tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON("stroke-join-bevel"))); break; default: break; @@ -972,13 +976,13 @@ sp_captype_set (Gtk::Container *spw, unsigned const captype) Gtk::RadioButton *tb = NULL; switch (captype) { case SP_STROKE_LINECAP_BUTT: - tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON_STROKE_CAP_BUTT)); + tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON("stroke-cap-butt"))); break; case SP_STROKE_LINECAP_ROUND: - tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON_STROKE_CAP_ROUND)); + tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON("stroke-cap-round"))); break; case SP_STROKE_LINECAP_SQUARE: - tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON_STROKE_CAP_SQUARE)); + tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON("stroke-cap-square"))); break; default: break; @@ -1325,16 +1329,16 @@ sp_stroke_style_set_join_buttons(Gtk::Container *spw, Gtk::ToggleButton *active) { Gtk::RadioButton *tb; - tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON_STROKE_JOIN_MITER)); + tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON("stroke-join-miter"))); tb->set_active(active == tb); Gtk::SpinButton *ml = static_cast<Gtk::SpinButton *>(spw->get_data("miterlimit_sb")); ml->set_sensitive(active == tb); - tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON_STROKE_JOIN_ROUND)); + tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON("stroke-join-round"))); tb->set_active(active == tb); - tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON_STROKE_JOIN_BEVEL)); + tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON("stroke-join-bevel"))); tb->set_active(active == tb); } @@ -1346,11 +1350,11 @@ sp_stroke_style_set_cap_buttons(Gtk::Container *spw, Gtk::ToggleButton *active) { Gtk::RadioButton *tb; - tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON_STROKE_CAP_BUTT)); + tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON("stroke-cap-butt"))); tb->set_active(active == tb); - tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON_STROKE_CAP_ROUND)); + tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON("stroke-cap-round"))); tb->set_active(active == tb); - tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON_STROKE_CAP_SQUARE)); + tb = static_cast<Gtk::RadioButton *>(spw->get_data(INKSCAPE_ICON("stroke-cap-square"))); tb->set_active(active == tb); } |
