From a42853cdfdce51a8b5a36679ffc058c8a8fe9cc4 Mon Sep 17 00:00:00 2001 From: cxl Date: Fri, 12 Dec 2014 12:54:29 +0000 Subject: [PATCH] Core: CParser::ReadDouble now allows '.707' (but IsDouble still false) git-svn-id: svn://ultimatepp.org/upp/trunk@7967 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/parser.cpp | 2 +- uppsrc/Painter/PainterPath.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/uppsrc/Core/parser.cpp b/uppsrc/Core/parser.cpp index ee2d5ce42..47e94f8dd 100644 --- a/uppsrc/Core/parser.cpp +++ b/uppsrc/Core/parser.cpp @@ -280,7 +280,7 @@ double CParser::ReadDouble() throw(Error) { LTIMING("ReadDouble"); int sign = Sgn(); - if(!IsDigit(*term)) + if(!IsDigit(*term) && *term != '.') ThrowError("missing number"); double n = 0; while(IsDigit(*term)) diff --git a/uppsrc/Painter/PainterPath.cpp b/uppsrc/Painter/PainterPath.cpp index 71a9d0cbf..81ea43997 100644 --- a/uppsrc/Painter/PainterPath.cpp +++ b/uppsrc/Painter/PainterPath.cpp @@ -99,8 +99,11 @@ Painter& Painter::Path(CParser& p) Painter& Painter::Path(const char *path) { - CParser p(path); - Path(p); + try { + CParser p(path); + Path(p); + } + catch(CParser::Error) {} return *this; }