insertion of GraphicHandle fixed 40/16840/3
Cedric Delamarre [Fri, 10 Jul 2015 16:05:04 +0000 (18:05 +0200)]
a = tlist(["toto", "ui"], []);
a.ui
a.ui = uicontrol();
a.ui

Change-Id: I144cd31c271626599ecc38667026260fa1646dee

scilab/modules/ast/includes/ast/expHistory.hxx
scilab/modules/ast/src/cpp/ast/expHistory.cpp
scilab/modules/ast/src/cpp/ast/visitor_common.cpp

index 26e9f19..2a8f382 100644 (file)
@@ -54,7 +54,7 @@ public :
     ExpHistory*             getParent();
 
     // use to know if we have to reinsert current in there parent and where
-    void                    setReinsertion();
+    void                    setReinsertion(bool bForce = false);
     void                    resetReinsertion();
     bool                    reinsertMe();
     int                     getWhereReinsert();
index 5eb1930..011625f 100644 (file)
@@ -316,12 +316,12 @@ ExpHistory* ExpHistory::getParent()
     return m_pParent;
 }
 
-void ExpHistory::setReinsertion()
+void ExpHistory::setReinsertion(bool bForce)
 {
     // special case for handle, we have not to reinsert
     // the handle in this parent after insertion of something
     // in handle by overload.
-    if (m_pITCurrent != NULL && m_pITCurrent->isHandle() == false)
+    if (bForce || (m_pITCurrent != NULL && m_pITCurrent->isHandle() == false))
     {
         m_bReinsertMe = true;
     }
index 9e1c62b..829cc33 100644 (file)
@@ -917,7 +917,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                         // a.x where x is the last field
                         // insert directly in x instead of extract then insert
                         ExpHistory* pEHNext = new ExpHistory(pEH, (*iterFields)->getExp(), (*iterFields)->getArgs(), (*iterFields)->getLevel(), (*iterFields)->isCellExp(), _pAssignValue);
-                        pEHNext->setReinsertion();
+                        pEHNext->setReinsertion(true);
                         evalFields.push_back(pEHNext);
                         if (workFields.empty())
                         {
@@ -1054,7 +1054,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                         // a.x where x is the last field
                         // insert directly in x instead of extract then insert
                         ExpHistory* pEHNext = new ExpHistory(pEH, (*iterFields)->getExp(), (*iterFields)->getArgs(), (*iterFields)->getLevel(), (*iterFields)->isCellExp(), _pAssignValue);
-                        pEHNext->setReinsertion();
+                        pEHNext->setReinsertion(true);
                         evalFields.push_back(pEHNext);
                         if (workFields.empty())
                         {
@@ -1195,7 +1195,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                             // a.x where x is the last field
                             // insert directly in x instead of extract then insert
                             ExpHistory* pEHNext = new ExpHistory(pEH, (*iterFields)->getExp(), (*iterFields)->getArgs(), (*iterFields)->getLevel(), (*iterFields)->isCellExp(), _pAssignValue);
-                            pEHNext->setReinsertion();
+                            pEHNext->setReinsertion(true);
                             evalFields.push_back(pEHNext);
                             if (workFields.empty())
                             {
@@ -1270,7 +1270,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                         // a.x where x is the last field
                         // insert directly in x instead of extract then insert
                         ExpHistory* pEHNext = new ExpHistory(pEH, (*iterFields)->getExp(), (*iterFields)->getArgs(), (*iterFields)->getLevel(), (*iterFields)->isCellExp(), _pAssignValue);
-                        pEHNext->setReinsertion();
+                        pEHNext->setReinsertion(true);
                         evalFields.push_back(pEHNext);
                         if (workFields.empty())
                         {
@@ -1422,7 +1422,7 @@ InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fiel
                         // a.x where x is the last field
                         // insert directly in x instead of extract then insert
                         ExpHistory* pEHNext = new ExpHistory(pEH, (*iterFields)->getExp(), (*iterFields)->getArgs(), (*iterFields)->getLevel(), (*iterFields)->isCellExp(), _pAssignValue);
-                        pEHNext->setReinsertion();
+                        pEHNext->setReinsertion(true);
                         evalFields.push_back(pEHNext);
                         if (workFields.empty())
                         {