Code

fix pasting style after copying a text span
[inkscape.git] / src / helper-fns.h
index a4ce8e3b5add02b4229fc4c5780140b071f7d000..43c90063b28252cb2a6ca1eeca2c47e2a640fcc9 100644 (file)
@@ -13,6 +13,8 @@
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
 
+#include <string.h>
+#include <vector>
 #include <sstream>
 
 // calling helperfns_read_number(string, false), it's not obvious, what
@@ -55,7 +57,17 @@ inline bool helperfns_read_bool(gchar const *value, bool default_value){
 inline std::vector<gdouble> helperfns_read_vector(const gchar* value, int size){
         std::vector<gdouble> v(size, (gdouble) 0);
         std::istringstream is(value);
-        for(int i = 0; i < size && (is >> v[i]); i++);
+        for(int i = 0; i < size && (is >> v[i]); i++){};
+        return v;
+}
+
+inline std::vector<gdouble> helperfns_read_vector(const gchar* value){
+        std::vector<gdouble> v;
+        std::istringstream is(value);
+        gdouble d;
+        while (is >> d){
+            v.push_back(d);
+        }
         return v;
 }