diff options
| author | Felipe Corr??a da Silva Sanches <juca@members.fsf.org> | 2009-01-06 15:51:51 +0000 |
|---|---|---|
| committer | JucaBlues <JucaBlues@users.sourceforge.net> | 2009-01-06 15:51:51 +0000 |
| commit | 8c4858cdaba44f478922fca8b6320b3acedcbd97 (patch) | |
| tree | 513ba4f6985551f82cf321b2b31bd1e425232c71 | |
| parent | Remove utest (diff) | |
| download | inkscape-8c4858cdaba44f478922fca8b6320b3acedcbd97.tar.gz inkscape-8c4858cdaba44f478922fca8b6320b3acedcbd97.zip | |
fix crash when no glyph is selected at the svgfonts dialog
(bzr r7085)
| -rw-r--r-- | src/ui/dialog/svg-fonts-dialog.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 930d5a0a3..1a908e3c5 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -473,6 +473,8 @@ void SvgFontsDialog::set_glyph_description_from_selected_path(){ Inkscape::XML::Node* node = (Inkscape::XML::Node*) g_slist_nth_data((GSList *)sel->reprList(), 0); if (!node || !node->matchAttributeName("d")) return; if (!node->attribute("d")) return; //TODO: give a message to the user + //"This object does not have a path description." + //How should we tell it to the user? Geom::PathVector pathv = sp_svg_read_pathv(node->attribute("d")); @@ -482,7 +484,9 @@ void SvgFontsDialog::set_glyph_description_from_selected_path(){ //then we offset it pathv+=Geom::Point(Geom::Coord(0),Geom::Coord(get_selected_spfont()->horiz_adv_x)); - get_selected_glyph()->repr->setAttribute("d", (char*) sp_svg_write_path (pathv)); + SPGlyph* glyph = get_selected_glyph(); + if (!glyph) return; //TODO: give a message: "No glyph selected" + glyph->repr->setAttribute("d", (char*) sp_svg_write_path (pathv)); sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves")); update_glyphs(); |
