#include <TDataStd_Integer.hxx>
+#include <TDF_Delta.hxx>
+
IMPLEMENT_STANDARD_HANDLE(HYDROData_Document,MMgt_TShared)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Document,MMgt_TShared)
myDoc->NewCommand();
}
-void HYDROData_Document::CommitOperation()
+void HYDROData_Document::CommitOperation(const TCollection_ExtendedString& theName)
{
- myDoc->CommitCommand();
+ if( !myDoc->CommitCommand() ) // it means that there were no modifications done
+ {
+ myDoc->NewCommand();
+ NewID(); // workaround: do something just to modify the document
+ myDoc->CommitCommand();
+ }
myTransactionsAfterSave++;
+
+ if( theName.Length() != 0 )
+ {
+ const TDF_DeltaList& aList = GetUndos();
+ if( !aList.IsEmpty() )
+ {
+ Handle(TDF_Delta) aDelta = aList.Last();
+ if( !aDelta.IsNull() )
+ aDelta->SetName( theName );
+ }
+ }
}
void HYDROData_Document::AbortOperation()
return myDoc->GetAvailableUndos() > 0;
}
+const TDF_DeltaList& HYDROData_Document::GetUndos()
+{
+ return myDoc->GetUndos();
+}
+
+void HYDROData_Document::ClearUndos()
+{
+ return myDoc->ClearUndos();
+}
+
void HYDROData_Document::Undo()
{
myDoc->Undo();
return myDoc->GetAvailableRedos() > 0;
}
+const TDF_DeltaList& HYDROData_Document::GetRedos()
+{
+ return myDoc->GetRedos();
+}
+
+void HYDROData_Document::ClearRedos()
+{
+ return myDoc->ClearRedos();
+}
+
void HYDROData_Document::Redo()
{
myDoc->Redo();