]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for the TestCompositeFeaturesOnCompSolids.py test passing: after commit of nested...
authormpv <mpv@opencascade.com>
Wed, 17 Aug 2016 15:01:00 +0000 (18:01 +0300)
committermpv <mpv@opencascade.com>
Wed, 17 Aug 2016 15:01:00 +0000 (18:01 +0300)
src/Model/Model_Document.cpp
src/Model/Model_Expression.cpp

index c392492fcebbe13ff8c2da96774ffa9a817d452a..61ba6e53feb7c741b0336e98001de39200cdb50c 100755 (executable)
@@ -490,6 +490,11 @@ bool Model_Document::finishOperation()
   bool isNestedClosed = !myDoc->HasOpenCommand() && !myNestedNum.empty();
   static std::shared_ptr<Model_Session> aSession = 
     std::static_pointer_cast<Model_Session>(Model_Session::get());
+
+  // open transaction if nested is closed to fit inside all synchronizeBackRefs and flushed consequences
+  if (isNestedClosed) {
+    myDoc->OpenCommand();
+  }
   // do it before flashes to enable and recompute nesting features correctly
   if (myNestedNum.empty() || (isNestedClosed && myNestedNum.size() == 1)) {
     // if all nested operations are closed, make current the higher level objects (to perform 
@@ -509,6 +514,12 @@ bool Model_Document::finishOperation()
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED));
+
+  if (isNestedClosed) {
+    if (myDoc->CommitCommand())
+      myTransactions.rbegin()->myOCAFNum++;
+  }
+  
   // this must be here just after everything is finished but before real transaction stop
   // to avoid messages about modifications outside of the transaction
   // and to rebuild everything after all updates and creates
index 1cd6501014edb81131e4bdf32e939248ed2c61af..1624e8d02ddc21250a80bfb5093dcab14f9e570a 100644 (file)
@@ -14,6 +14,7 @@
 #include <TDataStd_RealArray.hxx>
 #include <TDataStd_ExtStringArray.hxx>
 
+#include <limits>
 
 static Standard_GUID kInvalidGUID("caee5ce4-34b1-4b29-abcb-685287d18096");
 
@@ -117,7 +118,7 @@ double Model_ExpressionDouble::value()
 {
   if (myIsInitialized)
     return myReal->Get();
-  return -1.; // error
+  return std::numeric_limits<double>::max(); // error
 }
 
 void Model_ExpressionDouble::setInvalid(const bool theFlag)
@@ -158,7 +159,7 @@ int Model_ExpressionInteger::value()
 {
   if (myIsInitialized)
     return myInteger->Get();
-  return -1; // error
+  return std::numeric_limits<int>::max(); // error
 }
 
 void Model_ExpressionInteger::setInvalid(const bool theFlag)