From e5dffc09faa29ad82b17823d2395f8dac902c54a Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Thu, 14 Feb 2013 22:12:58 +0000
Subject: [PATCH] Closed should be a float opt

---
 Common/GmshMessage.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp
index 65485795f3..d5b9f6d397 100644
--- a/Common/GmshMessage.cpp
+++ b/Common/GmshMessage.cpp
@@ -907,7 +907,10 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
   }
   if(noLoop && copt.count("Loop")) ps[0].setAttribute("Loop", copt["Loop"][0]);
   if(noGraph && copt.count("Graph")) ps[0].setAttribute("Graph", copt["Graph"][0]);
-  if(noClosed && copt.count("Closed")) ps[0].setAttribute("Closed", copt["Closed"][0]);
+  if(noClosed && copt.count("Closed")) // for backward compatibility
+    ps[0].setAttribute("Closed", copt["Closed"][0]);
+  if(noClosed && fopt.count("Closed"))
+    ps[0].setAttribute("Closed", fopt["Closed"][0] ? "1" : "0");
   _setStandardOptions(&ps[0], fopt, copt);
   _onelabClient->set(ps[0]);
 #endif
@@ -943,7 +946,10 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
   }
   if(copt.count("Kind")) ps[0].setKind(copt["Kind"][0]);
   if(noChoices && copt.count("Choices")) ps[0].setChoices(copt["Choices"]);
-  if(noClosed && copt.count("Closed")) ps[0].setAttribute("Closed", copt["Closed"][0]);
+  if(noClosed && copt.count("Closed")) // for backward compatibility
+    ps[0].setAttribute("Closed", copt["Closed"][0]);
+  if(noClosed && fopt.count("Closed"))
+    ps[0].setAttribute("Closed", fopt["Closed"][0] ? "1" : "0");
   if(noMultipleSelection && copt.count("MultipleSelection"))
     ps[0].setAttribute("MultipleSelection", copt["MultipleSelection"][0]);
   _setStandardOptions(&ps[0], fopt, copt);
-- 
GitLab