From d95a6284a9554ab70e790fd6b16feb2ab903ed66 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sun, 5 Aug 2018 10:20:31 +0200
Subject: [PATCH] up

---
 PendulumC++/onelab.h | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/PendulumC++/onelab.h b/PendulumC++/onelab.h
index 1bf5c35..422e65b 100644
--- a/PendulumC++/onelab.h
+++ b/PendulumC++/onelab.h
@@ -504,7 +504,14 @@ namespace onelab{
       setVisible(p.getVisible());
       setReadOnly(p.getReadOnly());
       setAttributes(p.getAttributes());
-      if(p.getValue() != getValue()){ // FIXME change this
+      bool changed = false;
+      for(unsigned int i = 0; i < p.getValues().size(); i++){
+        if(p.getValues()[i] != getValues()[i]){
+          changed = true;
+          break;
+        }
+      }
+      if(changed){
         setValues(p.getValues());
         setChanged(getChangedValue());
       }
@@ -685,7 +692,14 @@ namespace onelab{
       setVisible(p.getVisible());
       setReadOnly(p.getReadOnly());
       setAttributes(p.getAttributes());
-      if(p.getValue() != getValue()){ // FIXME: change this
+      bool changed = false;
+      for(unsigned int i = 0; i < p.getValues().size(); i++){
+        if(p.getValues()[i] != getValues()[i]){
+          changed = true;
+          break;
+        }
+      }
+      if(changed){
         setValues(p.getValues());
         setChanged(getChangedValue());
       }
@@ -908,11 +922,13 @@ namespace onelab{
     {
       return _get(ps, name, client, _strings);
     }
-    void getPtr(number **ptr, const std::string name, const std::string client="")
+    void getPtr(number **ptr, const std::string &name,
+                const std::string &client = "")
     {
       *ptr = _getPtr(name, client, _numbers);
     }
-    void getPtr(string **ptr, const std::string name, const std::string client="")
+    void getPtr(string **ptr, const std::string &name,
+                const std::string &client = "")
     {
       *ptr = _getPtr(name, client, _strings);
     }
-- 
GitLab