Xcos MVC: implement clone / delete on the Model side
[scilab.git] / scilab / modules / scicos / src / cpp / view_scilab / ParamsAdapter.cpp
index baad6ef..2d46589 100644 (file)
@@ -129,8 +129,11 @@ struct tol
 
         std::vector<double> tol;
         controller.getObjectProperty(adaptee->id(), adaptee->kind(), PROPERTIES, tol);
-
+#ifdef _MSC_VER
+        std::copy(tol.begin() + 1, tol.end(), stdext::checked_array_iterator<double*>( data, 7 ));
+#else
         std::copy(tol.begin() + 1, tol.end(), data);
+#endif
 
         return o;
     }
@@ -308,14 +311,8 @@ struct doc
 
 template<> property<ParamsAdapter>::props_t property<ParamsAdapter>::fields = property<ParamsAdapter>::props_t();
 
-ParamsAdapter::ParamsAdapter(const ParamsAdapter& o) :
-    BaseAdapter<ParamsAdapter, org_scilab_modules_scicos::model::Diagram>(o)
-{
-    doc_content = new types::List();
-}
-
-ParamsAdapter::ParamsAdapter(org_scilab_modules_scicos::model::Diagram* o) :
-    BaseAdapter<ParamsAdapter, org_scilab_modules_scicos::model::Diagram>(o)
+ParamsAdapter::ParamsAdapter(bool ownAdaptee, org_scilab_modules_scicos::model::Diagram* adaptee) :
+    BaseAdapter<ParamsAdapter, org_scilab_modules_scicos::model::Diagram>(ownAdaptee, adaptee)
 {
     if (property<ParamsAdapter>::properties_have_not_been_set())
     {
@@ -351,7 +348,7 @@ std::wstring ParamsAdapter::getShortTypeStr()
 
 types::InternalType* ParamsAdapter::getDocContent() const
 {
-    return doc_content;
+    return doc_content->clone();
 }
 
 void ParamsAdapter::setDocContent(types::InternalType* v)