summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6fd67bd)
raw | patch | inline | side by side (parent: 6fd67bd)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Wed, 25 Jun 2008 19:50:01 +0000 (19:50 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Wed, 25 Jun 2008 19:50:01 +0000 (19:50 +0000) |
src/svg/svg-path.cpp | patch | blob | history |
diff --git a/src/svg/svg-path.cpp b/src/svg/svg-path.cpp
index 24ce3c15c415e1f930fdd798ef1db61fd3954bdb..353bb1da34351f1684c857bf81330984b5244870 100644 (file)
--- a/src/svg/svg-path.cpp
+++ b/src/svg/svg-path.cpp
#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.
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;
}