]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for removing of all sub-objects
authorvsv <vsv@opencascade.com>
Tue, 28 Aug 2018 13:58:33 +0000 (16:58 +0300)
committervsv <vsv@opencascade.com>
Tue, 28 Aug 2018 13:58:33 +0000 (16:58 +0300)
src/XGUI/XGUI_DataModel.cpp

index 31cb8d3822dc3527e489f8b418a3d10a215d09c7..b31e32f361e159232d2aaf780f8fb04d7b1f073b 100644 (file)
@@ -132,7 +132,10 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
             insertRows(aOldNb - 1, aNewNb - aOldNb, aFirstIdx);
           }
           else if (aNewNb < aOldNb) {
-            removeRows(aNewNb - 1, aOldNb - aNewNb, aFirstIdx);
+            if (aNewNb)
+              removeRows(aNewNb - 1, aOldNb - aNewNb, aFirstIdx);
+            else if (aOldNb)
+              removeRows(0, aOldNb, aFirstIdx);
           }
           dataChanged(aFirstIdx, aLastIdx);
         }
@@ -187,7 +190,10 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
           insertRows(aOldNb - 1, aNewNb - aOldNb, aFirstIdx);
         }
         else if (aNewNb < aOldNb) {
-          removeRows(aNewNb - 1, aOldNb - aNewNb, aFirstIdx);
+          if (aNewNb)
+            removeRows(aNewNb - 1, aOldNb - aNewNb, aFirstIdx);
+          else if (aOldNb)
+            removeRows(0, aOldNb, aFirstIdx);
         }
         dataChanged(aFirstIdx, aLastIdx);
       }