From 7c5adc60527fbc236a500ca73723d158e459f1a9 Mon Sep 17 00:00:00 2001 From: dooglus Date: Sun, 13 Jan 2008 14:35:50 +0000 Subject: [PATCH] In the hex HTML code text entry box of the color dialog, ignore everything other than hex characters. Previously even stray whitespace would cause it to fail. git-svn-id: http://svn.voria.com/code@1342 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/color.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/synfig-core/trunk/src/synfig/color.cpp b/synfig-core/trunk/src/synfig/color.cpp index 81be9eb..1fa133c 100644 --- a/synfig-core/trunk/src/synfig/color.cpp +++ b/synfig-core/trunk/src/synfig/color.cpp @@ -79,9 +79,16 @@ Color::real2hex(ColorReal c) } void -Color::set_hex(String& hex) +Color::set_hex(String& str) { value_type r, g, b; + String hex; + + // use just the hex characters + for (String::const_iterator iter = str.begin(); iter != str.end(); iter++) + if (isxdigit(*iter)) + hex.push_back(*iter); + try { if (hex.size() == 1) -- 2.7.4