summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 71c9191)
raw | patch | inline | side by side (parent: 71c9191)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 17 Jan 2008 21:04:37 +0000 (21:04 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 17 Jan 2008 21:04:37 +0000 (21:04 +0000) |
src/2geom/exception.h | patch | blob | history | |
src/2geom/sbasis-to-bezier.cpp | patch | blob | history |
diff --git a/src/2geom/exception.h b/src/2geom/exception.h
index 0791c85475f67f120841add7ebe1abfa18652bab..920cd58082080489ac5216018f9664a3f5ef13cd 100644 (file)
--- a/src/2geom/exception.h
+++ b/src/2geom/exception.h
protected:
std::string msgstr;
};
+#define throwException(message) throw(Geom::Exception(message, __FILE__, __LINE__))
//-----------------------------------------------------------------------
// Two main exception classes: LogicalError and RangeError.
index 415b30d8989f823f64ca49cf65bd7626c345d759..497091d1c65f29e7b95b4d4dc9d4e7ffd61ddd6d 100644 (file)
#include "choose.h"
#include "svg-path.h"
#include <iostream>
+#include "exception.h"
namespace Geom{
@@ -179,7 +180,9 @@ subpath_from_sbasis_incremental(Geom::OldPathSetBuilder &pb, D2<SBasis> B, doubl
#endif
void build_from_sbasis(Geom::PathBuilder &pb, D2<SBasis> const &B, double tol) {
- assert(B.isFinite());
+ if (!B.isFinite()) {
+ throwException("assertion failed: B.isFinite()");
+ }
if(tail_error(B, 2) < tol || sbasis_size(B) == 2) { // nearly cubic enough
if(sbasis_size(B) <= 1) {
pb.lineTo(B.at1());