From: srn Date: Mon, 22 Aug 2005 11:47:49 +0000 (+0000) Subject: Added a method Modify to Study and a method SetModifyFlag to GenericAttribute. Now... X-Git-Tag: T_3_0_2a1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d4afa72fc8fd3f884c850b5a069e66df066c44f8;p=modules%2Fkernel.git Added a method Modify to Study and a method SetModifyFlag to GenericAttribute. Now all attributes calls the method SetModifyFlag when they change their state --- diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx index 6f87a6d34..d31c4b4fb 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx @@ -30,6 +30,7 @@ Handle(SALOMEDSImpl_AttributeComment) SALOMEDSImpl_AttributeComment::Set (const } A->SetValue(Val); + return A; } @@ -46,6 +47,8 @@ void SALOMEDSImpl_AttributeComment::SetValue (const TCollection_ExtendedString& Backup(); myString = S; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx index 29e743acb..68564dfd9 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx @@ -60,6 +60,8 @@ void SALOMEDSImpl_AttributeExternalFileDef::SetValue (const TCollection_Extended Backup(); myString = S; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx index d880e387e..004592bb0 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx @@ -64,6 +64,8 @@ void SALOMEDSImpl_AttributeFileType::SetValue (const TCollection_ExtendedString& Backup(); myString = S; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx index 6bfd42ec5..bf9599366 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx @@ -62,6 +62,8 @@ void SALOMEDSImpl_AttributeIOR::SetValue(const TCollection_ExtendedString& theVa myString = theValue; SALOMEDSImpl_Study::IORUpdated(this); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx index 895347903..7b80aa4e6 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx @@ -43,6 +43,8 @@ void SALOMEDSImpl_AttributeInteger::SetValue(const Standard_Integer v) Backup(); myValue = v; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx index 0349e53b5..240a95380 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx @@ -64,6 +64,8 @@ void SALOMEDSImpl_AttributeLocalID::SetValue(const Standard_Integer theValue) Backup(); myValue = theValue; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx index 1bddef5b4..55718b771 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx @@ -46,6 +46,8 @@ void SALOMEDSImpl_AttributeName::SetValue (const TCollection_ExtendedString& S) Backup(); myString = S; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx index 99dbd8506..2db2b4088 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx @@ -73,6 +73,8 @@ void SALOMEDSImpl_AttributePersistentRef::SetValue (const TCollection_ExtendedSt Backup(); myString = S; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx index a05e411f9..6b9b3a3b8 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx @@ -66,6 +66,8 @@ void SALOMEDSImpl_AttributePixMap::SetPixMap (const TCollection_ExtendedString& Backup(); myString = S; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx index 1963e5379..a6f9db1ef 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx @@ -39,6 +39,8 @@ void SALOMEDSImpl_AttributePythonObject::SetObject(const TCollection_AsciiString Backup(); mySequence = theSequence; myIsScript = theScript; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } TCollection_AsciiString SALOMEDSImpl_AttributePythonObject::GetObject() const diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx index e2f5ec902..45ddd227a 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx @@ -43,6 +43,8 @@ void SALOMEDSImpl_AttributeReal::SetValue(const Standard_Real v) Backup(); myValue = v; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx index 4d3250b2a..019835cbc 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx @@ -48,6 +48,8 @@ void SALOMEDSImpl_AttributeReference::Set(const TDF_Label& Origin) Backup(); myLabel = Origin; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx index 3a0b50c2c..ca1667702 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx @@ -106,6 +106,8 @@ void SALOMEDSImpl_AttributeSequenceOfInteger::Assign(const Handle(TColStd_HSeque Backup(); if (myValue.IsNull()) myValue = new TColStd_HSequenceOfInteger; myValue->ChangeSequence() = other->Sequence(); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeSequenceOfInteger::ChangeValue(const Standard_Integer Index,const Standard_Integer Value) @@ -113,6 +115,8 @@ void SALOMEDSImpl_AttributeSequenceOfInteger::ChangeValue(const Standard_Integer CheckLocked(); Backup(); myValue->SetValue(Index, Value); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeSequenceOfInteger::Add(const Standard_Integer Value) @@ -120,6 +124,8 @@ void SALOMEDSImpl_AttributeSequenceOfInteger::Add(const Standard_Integer Value) CheckLocked(); Backup(); myValue->Append(Value); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeSequenceOfInteger::Remove(const Standard_Integer Index) @@ -127,6 +133,8 @@ void SALOMEDSImpl_AttributeSequenceOfInteger::Remove(const Standard_Integer Inde CheckLocked(); Backup(); myValue->Remove(Index); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Standard_Integer SALOMEDSImpl_AttributeSequenceOfInteger::Length() diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx index 9ef1fafba..fa7caff51 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx @@ -105,6 +105,8 @@ void SALOMEDSImpl_AttributeSequenceOfReal::Assign(const Handle(TColStd_HSequence Backup(); if (myValue.IsNull()) myValue = new TColStd_HSequenceOfReal; myValue->ChangeSequence() = other->Sequence(); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeSequenceOfReal::ChangeValue(const Standard_Integer Index,const Standard_Real Value) @@ -112,6 +114,8 @@ void SALOMEDSImpl_AttributeSequenceOfReal::ChangeValue(const Standard_Integer In CheckLocked(); Backup(); myValue->SetValue(Index, Value); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeSequenceOfReal::Add(const Standard_Real Value) @@ -119,6 +123,8 @@ void SALOMEDSImpl_AttributeSequenceOfReal::Add(const Standard_Real Value) CheckLocked(); Backup(); myValue->Append(Value); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeSequenceOfReal::Remove(const Standard_Integer Index) @@ -126,6 +132,8 @@ void SALOMEDSImpl_AttributeSequenceOfReal::Remove(const Standard_Integer Index) CheckLocked(); Backup(); myValue->Remove(Index); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Standard_Integer SALOMEDSImpl_AttributeSequenceOfReal::Length() diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx index c5a0e9fde..33c6cd971 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx @@ -82,6 +82,9 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetNbColumns(const Standard_Integer t while (myCols->Length() < myNbColumns) { // append empty columns titles myCols->Append(TCollection_ExtendedString("")); } + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved + } void SALOMEDSImpl_AttributeTableOfInteger::SetTitle(const TCollection_ExtendedString& theTitle) @@ -89,6 +92,8 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetTitle(const TCollection_ExtendedSt CheckLocked(); Backup(); myTitle = theTitle; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfInteger::GetTitle() const @@ -114,6 +119,8 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetRowData(const Standard_Integer the } if(theRow > myNbRows) myNbRows = theRow; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Handle(TColStd_HSequenceOfInteger) SALOMEDSImpl_AttributeTableOfInteger::GetRowData(const Standard_Integer theRow) @@ -141,6 +148,8 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetRowTitle(const Standard_Integer th aTitle += aUnit; } myRows->SetValue(theRow, aTitle); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnit(const Standard_Integer theRow, @@ -153,6 +162,8 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnit(const Standard_Integer the aTitle += theUnit; myRows->SetValue(theRow, aTitle); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnits(const Handle(TColStd_HSequenceOfExtendedString)& theUnits) @@ -160,6 +171,8 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnits(const Handle(TColStd_HSeq if (theUnits->Length() != GetNbRows()) Standard_Failure::Raise("Invalid number of rows"); int aLength = theUnits->Length(), i; for(i = 1; i <= aLength; i++) SetRowUnit(i, theUnits->Value(i)); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfInteger::GetRowUnits() @@ -175,6 +188,8 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetRowTitles(const Handle(TColStd_HSe if (theTitles->Length() != GetNbRows()) Standard_Failure::Raise("Invalid number of rows"); int aLength = theTitles->Length(), i; for(i = 1; i <= aLength; i++) SetRowTitle(i, theTitles->Value(i)); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfInteger::GetRowTitles() @@ -217,6 +232,8 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetColumnData(const Standard_Integer myRows->Append(TCollection_ExtendedString("")); } } + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } @@ -243,6 +260,8 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitle(const Standard_Integer Backup(); while(myCols->Length() < theColumn) myCols->Append(TCollection_ExtendedString("")); myCols->SetValue(theColumn,theTitle); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfInteger::GetColumnTitle(const Standard_Integer theColumn) const @@ -257,6 +276,8 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitles(const Handle(TColStd_ if (theTitles->Length() != myNbColumns) Standard_Failure::Raise("Invalid number of columns"); int aLength = theTitles->Length(), i; for(i = 1; i <= aLength; i++) myCols->SetValue(i, theTitles->Value(i)); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfInteger::GetColumnTitles() @@ -293,6 +314,8 @@ void SALOMEDSImpl_AttributeTableOfInteger::PutValue(const Standard_Integer theVa } myNbRows = theRow; } + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Standard_Boolean SALOMEDSImpl_AttributeTableOfInteger::HasValue(const Standard_Integer theRow, diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx index 32b20050f..a57676472 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx @@ -83,6 +83,8 @@ void SALOMEDSImpl_AttributeTableOfReal::SetNbColumns(const Standard_Integer theN while (myCols->Length() < myNbColumns) { // append empty columns titles myCols->Append(TCollection_ExtendedString("")); } + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeTableOfReal::SetTitle(const TCollection_ExtendedString& theTitle) @@ -90,6 +92,8 @@ void SALOMEDSImpl_AttributeTableOfReal::SetTitle(const TCollection_ExtendedStrin CheckLocked(); Backup(); myTitle = theTitle; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfReal::GetTitle() const @@ -115,6 +119,8 @@ void SALOMEDSImpl_AttributeTableOfReal::SetRowData(const Standard_Integer theRow } if(theRow > myNbRows) myNbRows = theRow; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Handle(TColStd_HSequenceOfReal) SALOMEDSImpl_AttributeTableOfReal::GetRowData(const Standard_Integer theRow) @@ -143,6 +149,8 @@ void SALOMEDSImpl_AttributeTableOfReal::SetRowTitle(const Standard_Integer theRo aTitle += aUnit; } myRows->SetValue(theRow, aTitle); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeTableOfReal::SetRowUnit(const Standard_Integer theRow, @@ -155,6 +163,8 @@ void SALOMEDSImpl_AttributeTableOfReal::SetRowUnit(const Standard_Integer theRow aTitle += theUnit; myRows->SetValue(theRow, aTitle); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeTableOfReal::SetRowUnits(const Handle(TColStd_HSequenceOfExtendedString)& theUnits) @@ -162,6 +172,8 @@ void SALOMEDSImpl_AttributeTableOfReal::SetRowUnits(const Handle(TColStd_HSequen if (theUnits->Length() != GetNbRows()) Standard_Failure::Raise("Invalid number of rows"); int aLength = theUnits->Length(), i; for(i = 1; i <= aLength; i++) SetRowUnit(i, theUnits->Value(i)); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfReal::GetRowUnits() @@ -177,6 +189,8 @@ void SALOMEDSImpl_AttributeTableOfReal::SetRowTitles(const Handle(TColStd_HSeque if (theTitles->Length() != GetNbRows()) Standard_Failure::Raise("Invalid number of rows"); int aLength = theTitles->Length(), i; for(i = 1; i <= aLength; i++) SetRowTitle(i, theTitles->Value(i)); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfReal::GetRowTitles() @@ -218,6 +232,8 @@ void SALOMEDSImpl_AttributeTableOfReal::SetColumnData(const Standard_Integer the myRows->Append(TCollection_ExtendedString("")); } } + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } @@ -244,6 +260,8 @@ void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitle(const Standard_Integer th Backup(); while(myCols->Length() < theColumn) myCols->Append(TCollection_ExtendedString("")); myCols->SetValue(theColumn,theTitle); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfReal::GetColumnTitle(const Standard_Integer theColumn) const @@ -258,6 +276,8 @@ void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitles(const Handle(TColStd_HSe if (theTitles->Length() != myNbColumns) Standard_Failure::Raise("Invalid number of columns"); int aLength = theTitles->Length(), i; for(i = 1; i <= aLength; i++) myCols->SetValue(i, theTitles->Value(i)); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfReal::GetColumnTitles() @@ -294,6 +314,8 @@ void SALOMEDSImpl_AttributeTableOfReal::PutValue(const Standard_Real theValue, } myNbRows = theRow; } + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Standard_Boolean SALOMEDSImpl_AttributeTableOfReal::HasValue(const Standard_Integer theRow, diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx index 3ca69a22f..9aca85190 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx @@ -84,6 +84,8 @@ void SALOMEDSImpl_AttributeTableOfString::SetNbColumns(const Standard_Integer th while (myCols->Length() < myNbColumns) { // append empty columns titles myCols->Append(TCollection_ExtendedString("")); } + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeTableOfString::SetRowTitle(const Standard_Integer theRow, @@ -97,6 +99,8 @@ void SALOMEDSImpl_AttributeTableOfString::SetRowTitle(const Standard_Integer the aTitle += aUnit; } myRows->SetValue(theRow, aTitle); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeTableOfString::SetRowUnit(const Standard_Integer theRow, @@ -109,6 +113,8 @@ void SALOMEDSImpl_AttributeTableOfString::SetRowUnit(const Standard_Integer theR aTitle += theUnit; myRows->SetValue(theRow, aTitle); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeTableOfString::SetRowUnits(const Handle(TColStd_HSequenceOfExtendedString)& theUnits) @@ -131,6 +137,8 @@ void SALOMEDSImpl_AttributeTableOfString::SetRowTitles(const Handle(TColStd_HSeq if (theTitles->Length() != GetNbRows()) Standard_Failure::Raise("Invalid number of rows"); int aLength = theTitles->Length(), i; for(i = 1; i <= aLength; i++) SetRowTitle(i, theTitles->Value(i)); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfString::GetRowTitles() @@ -171,6 +179,8 @@ void SALOMEDSImpl_AttributeTableOfString::SetRowData(const Standard_Integer theR } if(theRow > myNbRows) myNbRows = theRow; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } void SALOMEDSImpl_AttributeTableOfString::SetTitle(const TCollection_ExtendedString& theTitle) @@ -178,6 +188,8 @@ void SALOMEDSImpl_AttributeTableOfString::SetTitle(const TCollection_ExtendedStr CheckLocked(); Backup(); myTitle = theTitle; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfString::GetTitle() const @@ -218,6 +230,8 @@ void SALOMEDSImpl_AttributeTableOfString::SetColumnData(const Standard_Integer t myRows->Append(TCollection_ExtendedString("")); } } + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } @@ -244,6 +258,8 @@ void SALOMEDSImpl_AttributeTableOfString::SetColumnTitle(const Standard_Integer Backup(); while(myCols->Length() < theColumn) myCols->Append(TCollection_ExtendedString("")); myCols->SetValue(theColumn,theTitle); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfString::GetColumnTitle(const Standard_Integer theColumn) const @@ -259,6 +275,8 @@ void SALOMEDSImpl_AttributeTableOfString::SetColumnTitles(const Handle(TColStd_H if (theTitles->Length() != myNbColumns) Standard_Failure::Raise("Invalid number of columns"); int aLength = theTitles->Length(), i; for(i = 1; i <= aLength; i++) myCols->SetValue(i, theTitles->Value(i)); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfString::GetColumnTitles() @@ -296,6 +314,8 @@ void SALOMEDSImpl_AttributeTableOfString::PutValue(const TCollection_ExtendedStr } myNbRows = theRow; } + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } Standard_Boolean SALOMEDSImpl_AttributeTableOfString::HasValue(const Standard_Integer theRow, diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx index 4b472467d..b12c6537f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx @@ -60,6 +60,8 @@ void SALOMEDSImpl_AttributeTarget::SetRelation(const TCollection_ExtendedString& Backup(); myRelation = theRelation; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= @@ -76,6 +78,8 @@ void SALOMEDSImpl_AttributeTarget::Add(const Handle(SALOMEDSImpl_SObject)& theSO for(;anIter.More();anIter.Next()) if(anIter.Value()->Label() == aRefLabel) return; //BugID: PAL6192 GetVariables().Append(aReference); } + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= @@ -109,6 +113,8 @@ void SALOMEDSImpl_AttributeTarget::Remove(const Handle(SALOMEDSImpl_SObject)& th return; } } + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx index 473d83853..8fd46859d 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx @@ -46,6 +46,8 @@ void SALOMEDSImpl_AttributeTextColor::SetTextColor(const Standard_Real R, const myValue->SetValue(1, R); myValue->SetValue(2, G); myValue->SetValue(3, B); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= @@ -67,6 +69,8 @@ void SALOMEDSImpl_AttributeTextColor::ChangeArray(const Handle(TColStd_HArray1Of for(int i = 1; i <= 3; i++) myValue->SetValue(i, newArray->Value(i)); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx index cde769bc8..fd9615b7a 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx @@ -57,6 +57,8 @@ void SALOMEDSImpl_AttributeTextHighlightColor::SetTextHighlightColor(const Stand myValue->SetValue(1, R); myValue->SetValue(2, G); myValue->SetValue(3, B); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= @@ -78,6 +80,8 @@ void SALOMEDSImpl_AttributeTextHighlightColor::ChangeArray(const Handle(TColStd_ for(int i = 1; i <= 3; i++) myValue->SetValue(i, newArray->Value(i)); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx index 51a2b23a4..9e825814f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx @@ -86,6 +86,9 @@ Standard_Boolean SALOMEDSImpl_AttributeTreeNode::Append (const Handle(SALOMEDSIm } // Set Father TN->SetFather(this); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved + return !TN.IsNull(); } @@ -111,6 +114,9 @@ Standard_Boolean SALOMEDSImpl_AttributeTreeNode::Prepend (const Handle(SALOMEDSI } TN->SetFather(this); SetFirst(TN); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved + return !TN.IsNull(); } @@ -136,6 +142,9 @@ Standard_Boolean SALOMEDSImpl_AttributeTreeNode::InsertBefore (const Handle(SALO GetPrevious()->SetNext(TN); SetPrevious(TN); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved + return !TN.IsNull(); } @@ -157,6 +166,9 @@ Standard_Boolean SALOMEDSImpl_AttributeTreeNode::InsertAfter (const Handle(SALOM if (HasNext()) GetNext()->SetPrevious(TN); SetNext(TN); + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved + return !TN.IsNull(); } @@ -197,6 +209,8 @@ Standard_Boolean SALOMEDSImpl_AttributeTreeNode::Remove () SetNext(bid); SetPrevious(bid); + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved + return Standard_True; } @@ -223,6 +237,8 @@ Standard_Integer SALOMEDSImpl_AttributeTreeNode::Depth () const void SALOMEDSImpl_AttributeTreeNode::SetTreeID (const Standard_GUID& explicitID) { myTreeID = explicitID; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } @@ -306,6 +322,8 @@ void SALOMEDSImpl_AttributeTreeNode::SetFather(const Handle(SALOMEDSImpl_Attribu CheckLocked(); Backup(); myFather = F; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= @@ -317,6 +335,8 @@ void SALOMEDSImpl_AttributeTreeNode::SetNext(const Handle(SALOMEDSImpl_Attribute CheckLocked(); Backup(); myNext = F; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } @@ -329,6 +349,8 @@ void SALOMEDSImpl_AttributeTreeNode::SetPrevious(const Handle(SALOMEDSImpl_Attri CheckLocked(); Backup(); myPrevious = F; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= @@ -340,6 +362,8 @@ void SALOMEDSImpl_AttributeTreeNode::SetFirst(const Handle(SALOMEDSImpl_Attribut CheckLocked(); Backup(); myFirst = F; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.cxx index 5b5e8685c..41fcd0c8f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.cxx @@ -40,6 +40,8 @@ void SALOMEDSImpl_AttributeUserID::SetValue( const Standard_GUID& guid) Backup(); myID = guid; + + SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } //======================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx index 9c8f1f2bd..6f2384fb6 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx @@ -55,3 +55,13 @@ Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_GenericAttribute::GetSObject() if(aLabel.IsNull()) return NULL; return SALOMEDSImpl_Study::SObject(aLabel); } + +void SALOMEDSImpl_GenericAttribute::SetModifyFlag() +{ + TDF_Label aLabel = Label(); + if(aLabel.IsNull()) return; + + Handle(SALOMEDSImpl_Study) aStudy = SALOMEDSImpl_Study::GetStudy(aLabel); + if(!aStudy.IsNull()) aStudy->Modify(); +} + diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx index 9ed1f341f..47c1cc9e9 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx @@ -37,6 +37,7 @@ Standard_EXPORT virtual TCollection_AsciiString Type(); Standard_EXPORT virtual void CheckLocked(); Standard_EXPORT TCollection_AsciiString GetClassType() { return _type; } Standard_EXPORT Handle(SALOMEDSImpl_SObject) GetSObject(); +Standard_EXPORT void SetModifyFlag(); Standard_EXPORT static char* Impl_GetType(const Handle(TDF_Attribute)& theAttr); Standard_EXPORT static char* Impl_GetClassType(const Handle(TDF_Attribute)& theAttr); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 6f63d4d5a..703e44a08 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -1464,3 +1464,9 @@ void dumpSO(const Handle(SALOMEDSImpl_SObject)& theSO, return; } + +void SALOMEDSImpl_Study::Modify() +{ + _errorCode = ""; + _doc->Modify(); +} diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx index a39ebf1e2..dd986a7ff 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx @@ -246,6 +246,9 @@ public: //The method dump creates a txt file that contain a dump of the study, for debug use Standard_EXPORT void dump(const TCollection_AsciiString& theFileName); + //This method marks the study as being modified + Standard_EXPORT void Modify(); + public: DEFINE_STANDARD_RTTI( SALOMEDSImpl_Study ) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index 80f42b132..c2f21e3e5 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -565,8 +565,6 @@ bool SALOMEDSImpl_StudyBuilder::Addreference(const Handle(SALOMEDSImpl_SObject)& if(!_callbackOnRemove.IsNull() && Lab.IsDescendant(_doc->Main())) _callbackOnRemove->OnRemoveSObject(me); - _doc->Modify(); - return true; }