From 1060f208f853d1996f796a94e0f9fc0a6504943e Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Mon, 7 Jun 2010 18:14:26 +0200 Subject: [PATCH] Use iostream operators for load palette member instead of atof. --- synfig-core/src/synfig/palette.cpp | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/synfig-core/src/synfig/palette.cpp b/synfig-core/src/synfig/palette.cpp index 427c4b6..0ce2717 100644 --- a/synfig-core/src/synfig/palette.cpp +++ b/synfig-core/src/synfig/palette.cpp @@ -333,25 +333,15 @@ Palette::load_from_file(const synfig::String& filename) while(!file.eof()) { PaletteItem item; + String n; + float r, g, b, a; getline(file,item.name); - if(file.eof())break; - - getline(file,line); - if(file.eof())break; - item.color.set_r(atof(line.c_str())); - - getline(file,line); - if(file.eof())break; - item.color.set_g(atof(line.c_str())); - - getline(file,line); - if(file.eof())break; - item.color.set_b(atof(line.c_str())); - - getline(file,line); - if(file.eof())break; - item.color.set_a(atof(line.c_str())); - + file>>r>>g>>b>>a; + item.color.set_r(r); + item.color.set_g(g); + item.color.set_b(b); + item.color.set_a(a); + if(file.eof()) break; ret.push_back(item); } -- 2.7.4