diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-06-25 19:50:01 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-06-25 19:50:01 +0000 |
| commit | 3ccf382ef8ca5d2d0a299f16eea6f38ca0ed2c58 (patch) | |
| tree | 742813ba39bad35fdfc2afe7e18e8224d0b459e8 | |
| parent | adding list of available SVGFonts to the SVGFonts dialog (diff) | |
| download | inkscape-3ccf382ef8ca5d2d0a299f16eea6f38ca0ed2c58.tar.gz inkscape-3ccf382ef8ca5d2d0a299f16eea6f38ca0ed2c58.zip | |
help detection of path read bug
(bzr r6060)
| -rw-r--r-- | src/svg/svg-path.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/svg/svg-path.cpp b/src/svg/svg-path.cpp index 24ce3c15c..353bb1da3 100644 --- a/src/svg/svg-path.cpp +++ b/src/svg/svg-path.cpp @@ -43,6 +43,7 @@ #include <2geom/sbasis-to-bezier.h> #include <2geom/svg-path.h> #include <2geom/svg-path-parser.h> +#include <2geom/exception.h> /* This module parses an SVG path element into an RsvgBpathDef. @@ -676,14 +677,18 @@ NArtBpath *sp_svg_read_path(gchar const *str) Geom::PathVector sp_svg_read_pathv(char const * str) { std::vector<Geom::Path> pathv; + if (!str) + return pathv; // return empty pathvector when str == NULL - // TODO: enable this exception catching. don't catch now to better see when things go wrong -// try { + try { pathv = Geom::parse_svg_path(str); -// } -// catch (std::runtime_error e) { -// g_warning("SVGPathParseError: %s", e.what()); -// } + } + catch (Geom::SVGPathParseError e) { + g_warning("SVGPathParseError: %s", e.what()); + g_warning("svgd str: %s", str); + throw Geom::SVGPathParseError(); // rethrow, maybe not necessary, can instead return empty path? + return std::vector<Geom::Path>(); + } return pathv; } |
