+
+void Model_Document::appendTransactionToPrevious()
+{
+ Transaction anAppended = myTransactions.back();
+ myTransactions.pop_back();
+ if (!myTransactions.empty()) { // if it is empty, just forget the appended
+ myTransactions.back().myOCAFNum += anAppended.myOCAFNum;
+ }
+ // propagate the same action to sub-documents
+ const std::set<int> aSubs = subDocuments();
+ for (std::set<int>::iterator aSubIter = aSubs.begin(); aSubIter != aSubs.end(); aSubIter++) {
+ subDoc(*aSubIter)->appendTransactionToPrevious();
+ }
+}
+
+/// GUID for keeping information about the auto-recomputation state
+static const Standard_GUID kAutoRecomputationID("8493fb74-0674-4912-a100-1cf46c7cfab3");
+
+void Model_Document::setAutoRecomutationState(const bool theState)
+{
+ if (theState)
+ generalLabel().FindChild(TAG_CURRENT_TRANSACTION).ForgetAttribute(kAutoRecomputationID);
+ else
+ TDataStd_UAttribute::Set(
+ generalLabel().FindChild(TAG_CURRENT_TRANSACTION), kAutoRecomputationID);
+}
+
+bool Model_Document::autoRecomutationState() const
+{
+ return !generalLabel().FindChild(TAG_CURRENT_TRANSACTION).IsAttribute(kAutoRecomputationID);
+}