diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2016-06-04 15:21:05 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2016-06-04 15:21:05 +0000 |
| commit | 9f749722c869cbdbab91d935fb626886058c12b0 (patch) | |
| tree | 3a4bd7fb533ffc7566d28326bda1fc68dea0b4c7 /src/style-internal.cpp | |
| parent | Fix for bug on previous commit about guides lock (diff) | |
| download | inkscape-9f749722c869cbdbab91d935fb626886058c12b0.tar.gz inkscape-9f749722c869cbdbab91d935fb626886058c12b0.zip | |
Fix reading of 'stroke-dasharray' when there is a trailing blank.
Also fixes reading a value when there is no digit before a decimal point.
Fixed bugs:
- https://launchpad.net/bugs/1485197
(bzr r14950)
Diffstat (limited to 'src/style-internal.cpp')
| -rw-r--r-- | src/style-internal.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/style-internal.cpp b/src/style-internal.cpp index b425a1c80..62b0de52d 100644 --- a/src/style-internal.cpp +++ b/src/style-internal.cpp @@ -1810,9 +1810,11 @@ SPIDashArray::read( gchar const *str ) { return; } + // std::vector<Glib::ustring> tokens = Glib::Regex::split_simple("[,\\s]+", str ); + gchar *e = NULL; bool LineSolid = true; - while (e != str) { + while (e != str && *str != '\0') { /* TODO: Should allow <length> rather than just a unitless (px) number. */ double number = g_ascii_strtod(str, (char **) &e); values.push_back( number ); @@ -1821,7 +1823,7 @@ SPIDashArray::read( gchar const *str ) { if (e != str) { str = e; } - while (str && *str && !isalnum(*str)) str += 1; + while (str && *str && !(isalnum(*str) || *str=='.')) str += 1; } if (LineSolid) { |
