From: szy Date: Tue, 9 Oct 2018 14:30:10 +0000 (+0300) Subject: 0030169: Application Framework - Document format version management improvement X-Git-Tag: V7_4_0_beta~363 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=b34d86cb28b03b7483f40d69b5c62c50a6807432 0030169: Application Framework - Document format version management improvement --- diff --git a/dox/dev_guides/upgrade/upgrade.md b/dox/dev_guides/upgrade/upgrade.md index b4bd2b0df2..b7a5856a52 100644 --- a/dox/dev_guides/upgrade/upgrade.md +++ b/dox/dev_guides/upgrade/upgrade.md @@ -1621,3 +1621,9 @@ Now methods *GeomConvert::ConcatG1*, *GeomConvert::ConcatC1*, *Geom2dConvert::Co *SelectBasics_PickResult* structure has been extended, so that it now defines 3D point on detected entity in addition to Depth value along picking ray. *SelectMgr_SelectingVolumeManager::Overlap()* methods have been corrected to fill in *SelectBasics_PickResult* structure (depth and 3D point) instead of only depth value, so that custom *Select3D_SensitiveEntity* implementation should be updated accordingly (including *Select3D_SensitiveSet* subclasses). + +@subsection upgrade_740_ocafpersistence Document format version management improvement. + +Previously Document format version after restoring by DocumentRetrievalDriver was propagated using static methods of corresponding units (like MDataStd or MNaming) to static variables of these units and after that became accessible to Drivers of these units. +Now Document format version is available to drivers via RelocationTable. The Relocation table now keeps HeaderData of the document and a format version can be extracted in next way: theRelocTable.GetHeaderData()->StorageVersion(). +Obsolete methods: *static void SetDocumentVersion (const Standard_Integer DocVersion)* and *static Standard_Integer DocumentVersion()* of *BinMDataStd*, *BinMNaming*, *XmlMDataStd* and *XmlMNaming* are removed. diff --git a/src/BinDrivers/BinDrivers_DocumentRetrievalDriver.cxx b/src/BinDrivers/BinDrivers_DocumentRetrievalDriver.cxx index 45e6a1ac1a..95263f98e0 100644 --- a/src/BinDrivers/BinDrivers_DocumentRetrievalDriver.cxx +++ b/src/BinDrivers/BinDrivers_DocumentRetrievalDriver.cxx @@ -106,14 +106,4 @@ void BinDrivers_DocumentRetrievalDriver::Clear() BinLDrivers_DocumentRetrievalDriver::Clear(); } -//======================================================================= -//function : PropagateDocumentVersion -//purpose : -//======================================================================= -void BinDrivers_DocumentRetrievalDriver::PropagateDocumentVersion( - const Standard_Integer theDocVersion ) -{ - BinMDataStd::SetDocumentVersion(theDocVersion); - BinMNaming::SetDocumentVersion(theDocVersion); -} diff --git a/src/BinDrivers/BinDrivers_DocumentRetrievalDriver.hxx b/src/BinDrivers/BinDrivers_DocumentRetrievalDriver.hxx index 2275a838b2..8d63cd86af 100644 --- a/src/BinDrivers/BinDrivers_DocumentRetrievalDriver.hxx +++ b/src/BinDrivers/BinDrivers_DocumentRetrievalDriver.hxx @@ -50,10 +50,6 @@ public: //! Clears the NamedShape driver Standard_EXPORT virtual void Clear() Standard_OVERRIDE; - - Standard_EXPORT virtual void PropagateDocumentVersion (const Standard_Integer theVersion) Standard_OVERRIDE; - - DEFINE_STANDARD_RTTIEXT(BinDrivers_DocumentRetrievalDriver,BinLDrivers_DocumentRetrievalDriver) diff --git a/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx b/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx index 434a971a7b..662cf954ef 100644 --- a/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx +++ b/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx @@ -215,11 +215,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream& myMsgDriver->Send (aTypeNames(i), Message_Warning); } - // propagate the opened document version to data drivers - PropagateDocumentVersion(aFileVer); - // 2. Read document contents - // 2a. Retrieve data from the stream: myRelocTable.Clear(); myRelocTable.SetHeaderData(aHeaderData); @@ -232,7 +228,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream& if (aFileVer >= 3) { BinLDrivers_DocumentSection aSection; do { - BinLDrivers_DocumentSection::ReadTOC (aSection, theIStream); + BinLDrivers_DocumentSection::ReadTOC (aSection, theIStream, aFileVer); mySections.Append(aSection); } while(!aSection.Name().IsEqual((Standard_CString)SHAPESECTION_POS) && !theIStream.eof()); @@ -338,7 +334,7 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree const TDF_Label& theLabel) { Standard_Integer nbRead = 0; - static TCollection_ExtendedString aMethStr + TCollection_ExtendedString aMethStr ("BinLDrivers_DocumentRetrievalDriver: "); // Read attributes: @@ -511,15 +507,6 @@ void BinLDrivers_DocumentRetrievalDriver::Clear() myMapUnsupported.Clear(); } -//======================================================================= -//function : PropagateDocumentVersion -//purpose : -//======================================================================= -void BinLDrivers_DocumentRetrievalDriver::PropagateDocumentVersion(const Standard_Integer theDocVersion ) -{ - BinMDataStd::SetDocumentVersion(theDocVersion); -} - //======================================================================= //function : CheckDocumentVersion //purpose : diff --git a/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.hxx b/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.hxx index b9705779d9..0bbd0045ee 100644 --- a/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.hxx +++ b/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.hxx @@ -91,9 +91,6 @@ protected: //! clears the reading-cash data in drivers if any. Standard_EXPORT virtual void Clear(); - - //! provides the version of document to all drivers - Standard_EXPORT virtual void PropagateDocumentVersion (const Standard_Integer theVersion); //! Check a file version(in which file was written) with a current version. //! Redefining this method is a chance for application to read files diff --git a/src/BinLDrivers/BinLDrivers_DocumentSection.cxx b/src/BinLDrivers/BinLDrivers_DocumentSection.cxx index b527ca568a..e3a7c90dcf 100644 --- a/src/BinLDrivers/BinLDrivers_DocumentSection.cxx +++ b/src/BinLDrivers/BinLDrivers_DocumentSection.cxx @@ -185,7 +185,8 @@ void BinLDrivers_DocumentSection::Write (Standard_OStream& theStream, void BinLDrivers_DocumentSection::ReadTOC (BinLDrivers_DocumentSection& theSection, - Standard_IStream& theStream) + Standard_IStream& theStream, + const Standard_Integer theDocFormatVersion) { char aBuf[512]; Standard_Integer aNameBufferSize; @@ -198,7 +199,7 @@ void BinLDrivers_DocumentSection::ReadTOC theSection.myName = (Standard_CString)&aBuf[0]; uint64_t aValue[3]; - if (BinMDataStd::DocumentVersion() <= 9) + if (theDocFormatVersion <= 9) { // Old documents stored file position as 4-bytes values. Standard_Integer aValInt[3]; diff --git a/src/BinLDrivers/BinLDrivers_DocumentSection.hxx b/src/BinLDrivers/BinLDrivers_DocumentSection.hxx index 0fd63f2b5d..0fa488839e 100644 --- a/src/BinLDrivers/BinLDrivers_DocumentSection.hxx +++ b/src/BinLDrivers/BinLDrivers_DocumentSection.hxx @@ -72,7 +72,8 @@ public: //! Fill a DocumentSection instance from the data that are read //! from TOC. - Standard_EXPORT static void ReadTOC (BinLDrivers_DocumentSection& theSection, Standard_IStream& theIS); + Standard_EXPORT static void ReadTOC (BinLDrivers_DocumentSection& theSection, Standard_IStream& theIS, + const Standard_Integer theDocFormatVersion); diff --git a/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx b/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx index 5249b056de..4c7d91fdd9 100644 --- a/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx +++ b/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx @@ -187,7 +187,7 @@ void BinLDrivers_DocumentStorageDriver::UnsupportedAttrMsg (const Handle(Standard_Type)& theType) { #ifdef OCCT_DEBUG - static TCollection_ExtendedString aMsg + TCollection_ExtendedString aMsg ("BinDrivers_DocumentStorageDriver: warning: attribute driver for type "); #endif if (!myMapUnsupported.Contains(theType)) { diff --git a/src/BinMDataStd/BinMDataStd.cxx b/src/BinMDataStd/BinMDataStd.cxx index c0c361157d..a407dd0cf0 100644 --- a/src/BinMDataStd/BinMDataStd.cxx +++ b/src/BinMDataStd/BinMDataStd.cxx @@ -44,7 +44,6 @@ #include #include -static Standard_Integer myDocumentVersion = -1; //======================================================================= //function : AddDrivers //purpose : @@ -81,20 +80,3 @@ void BinMDataStd::AddDrivers (const Handle(BinMDF_ADriverTable)& theDriverTable, theDriverTable->AddDriver (new BinMDataStd_AsciiStringDriver (theMsgDriver) ); theDriverTable->AddDriver (new BinMDataStd_IntPackedMapDriver (theMsgDriver) ); } - -//======================================================================= -//function : SetDocumentVersion -//purpose : Sets current document version -//======================================================================= -void BinMDataStd::SetDocumentVersion(const Standard_Integer theVersion) -{ - myDocumentVersion = theVersion; -} -//======================================================================= -//function : DocumentVersion -//purpose : Retrieved document version -//======================================================================= -Standard_Integer BinMDataStd::DocumentVersion() -{ - return myDocumentVersion; -} diff --git a/src/BinMDataStd/BinMDataStd.hxx b/src/BinMDataStd/BinMDataStd.hxx index 659ef2fdda..64db29aa4f 100644 --- a/src/BinMDataStd/BinMDataStd.hxx +++ b/src/BinMDataStd/BinMDataStd.hxx @@ -25,32 +25,6 @@ class BinMDF_ADriverTable; class Message_Messenger; -class BinMDataStd_NameDriver; -class BinMDataStd_IntegerDriver; -class BinMDataStd_RealDriver; -class BinMDataStd_IntegerArrayDriver; -class BinMDataStd_RealArrayDriver; -class BinMDataStd_UAttributeDriver; -class BinMDataStd_DirectoryDriver; -class BinMDataStd_CommentDriver; -class BinMDataStd_VariableDriver; -class BinMDataStd_ExpressionDriver; -class BinMDataStd_RelationDriver; -class BinMDataStd_NoteBookDriver; -class BinMDataStd_TreeNodeDriver; -class BinMDataStd_ExtStringArrayDriver; -class BinMDataStd_TickDriver; -class BinMDataStd_AsciiStringDriver; -class BinMDataStd_IntPackedMapDriver; -class BinMDataStd_IntegerListDriver; -class BinMDataStd_RealListDriver; -class BinMDataStd_ExtStringListDriver; -class BinMDataStd_BooleanListDriver; -class BinMDataStd_ReferenceListDriver; -class BinMDataStd_BooleanArrayDriver; -class BinMDataStd_ReferenceArrayDriver; -class BinMDataStd_ByteArrayDriver; -class BinMDataStd_NamedDataDriver; //! Storage and Retrieval drivers for modelling attributes. class BinMDataStd @@ -62,16 +36,12 @@ public: //! Adds the attribute drivers to . Standard_EXPORT static void AddDrivers (const Handle(BinMDF_ADriverTable)& theDriverTable, const Handle(Message_Messenger)& aMsgDrv); - - Standard_EXPORT static void SetDocumentVersion (const Standard_Integer DocVersion); - - Standard_EXPORT static Standard_Integer DocumentVersion(); template -static void SetAttributeID(const BinObjMgt_Persistent& theSource, const Handle(T)& anAtt) +static void SetAttributeID(const BinObjMgt_Persistent& theSource, const Handle(T)& anAtt, const Standard_Integer aDocFormatVersion) { Standard_Boolean ok = Standard_True; - if(BinMDataStd::DocumentVersion() > 9) { // process user defined guid + if(aDocFormatVersion > 9) { // process user defined guid const Standard_Integer& aPos = theSource.Position(); Standard_GUID aGuid; ok = theSource >> aGuid; diff --git a/src/BinMDataStd/BinMDataStd_AsciiStringDriver.cxx b/src/BinMDataStd/BinMDataStd_AsciiStringDriver.cxx index c4346df6e9..cc17b78067 100644 --- a/src/BinMDataStd/BinMDataStd_AsciiStringDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_AsciiStringDriver.cxx @@ -55,14 +55,14 @@ Handle(TDF_Attribute) BinMDataStd_AsciiStringDriver::NewEmpty() const Standard_Boolean BinMDataStd_AsciiStringDriver::Paste (const BinObjMgt_Persistent& Source, const Handle(TDF_Attribute)& Target, - BinObjMgt_RRelocationTable& /*RelocTable*/) const + BinObjMgt_RRelocationTable& RelocTable) const { Handle(TDataStd_AsciiString) aStrAtt = Handle(TDataStd_AsciiString)::DownCast(Target); TCollection_AsciiString aString; Standard_Boolean ok = Source >> aString; if (ok) aStrAtt->Set( aString ); - if(BinMDataStd::DocumentVersion() > 8) { // process user defined guid + if(RelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 8) { // process user defined guid const Standard_Integer& aPos = Source.Position(); Standard_GUID aGuid; ok = Source >> aGuid; diff --git a/src/BinMDataStd/BinMDataStd_BooleanArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_BooleanArrayDriver.cxx index 347ce54cf1..aa856f6b4b 100644 --- a/src/BinMDataStd/BinMDataStd_BooleanArrayDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_BooleanArrayDriver.cxx @@ -51,7 +51,7 @@ Handle(TDF_Attribute) BinMDataStd_BooleanArrayDriver::NewEmpty() const //======================================================================= Standard_Boolean BinMDataStd_BooleanArrayDriver::Paste(const BinObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, - BinObjMgt_RRelocationTable& ) const + BinObjMgt_RRelocationTable& theRelocTable) const { Standard_Integer aFirstInd, aLastInd; if (! (theSource >> aFirstInd >> aLastInd)) @@ -71,7 +71,7 @@ Standard_Boolean BinMDataStd_BooleanArrayDriver::Paste(const BinObjMgt_Persisten bytes->SetValue(i, aTargetArray.Value(i)); } anAtt->SetInternalArray(bytes); - BinMDataStd::SetAttributeID(theSource, anAtt); + BinMDataStd::SetAttributeID(theSource, anAtt, theRelocTable.GetHeaderData()->StorageVersion().IntegerValue()); return Standard_True; } diff --git a/src/BinMDataStd/BinMDataStd_BooleanListDriver.cxx b/src/BinMDataStd/BinMDataStd_BooleanListDriver.cxx index f07a5b36e8..0821b8c738 100644 --- a/src/BinMDataStd/BinMDataStd_BooleanListDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_BooleanListDriver.cxx @@ -51,7 +51,7 @@ Handle(TDF_Attribute) BinMDataStd_BooleanListDriver::NewEmpty() const //======================================================================= Standard_Boolean BinMDataStd_BooleanListDriver::Paste(const BinObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, - BinObjMgt_RRelocationTable& ) const + BinObjMgt_RRelocationTable& theRelocTable) const { Standard_Integer aIndex, aFirstInd, aLastInd; if (! (theSource >> aFirstInd >> aLastInd)) @@ -71,7 +71,7 @@ Standard_Boolean BinMDataStd_BooleanListDriver::Paste(const BinObjMgt_Persistent } } - BinMDataStd::SetAttributeID(theSource, anAtt); + BinMDataStd::SetAttributeID(theSource, anAtt, theRelocTable.GetHeaderData()->StorageVersion().IntegerValue()); return Standard_True; } @@ -101,4 +101,4 @@ void BinMDataStd_BooleanListDriver::Paste(const Handle(TDF_Attribute)& theSource // process user defined guid if(anAtt->ID() != TDataStd_BooleanList::GetID()) theTarget << anAtt->ID(); -} \ No newline at end of file +} diff --git a/src/BinMDataStd/BinMDataStd_ByteArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_ByteArrayDriver.cxx index 6f0cc7d92d..5572d807c8 100644 --- a/src/BinMDataStd/BinMDataStd_ByteArrayDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_ByteArrayDriver.cxx @@ -51,7 +51,7 @@ Handle(TDF_Attribute) BinMDataStd_ByteArrayDriver::NewEmpty() const //======================================================================= Standard_Boolean BinMDataStd_ByteArrayDriver::Paste(const BinObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, - BinObjMgt_RRelocationTable& ) const + BinObjMgt_RRelocationTable& theRelocTable) const { Standard_Integer aFirstInd, aLastInd; if (! (theSource >> aFirstInd >> aLastInd)) @@ -71,7 +71,7 @@ Standard_Boolean BinMDataStd_ByteArrayDriver::Paste(const BinObjMgt_Persistent& anAtt->ChangeArray(bytes); Standard_Boolean aDelta(Standard_False); - if(BinMDataStd::DocumentVersion() > 2) { + if(theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 2) { Standard_Byte aDeltaValue; if (! (theSource >> aDeltaValue)) return Standard_False; @@ -80,7 +80,7 @@ Standard_Boolean BinMDataStd_ByteArrayDriver::Paste(const BinObjMgt_Persistent& } anAtt->SetDelta(aDelta); - BinMDataStd::SetAttributeID(theSource, anAtt); + BinMDataStd::SetAttributeID(theSource, anAtt, theRelocTable.GetHeaderData()->StorageVersion().IntegerValue()); return Standard_True; } diff --git a/src/BinMDataStd/BinMDataStd_ExtStringArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_ExtStringArrayDriver.cxx index 32140aff6b..089e2cf160 100644 --- a/src/BinMDataStd/BinMDataStd_ExtStringArrayDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_ExtStringArrayDriver.cxx @@ -54,7 +54,7 @@ Handle(TDF_Attribute) BinMDataStd_ExtStringArrayDriver::NewEmpty() const Standard_Boolean BinMDataStd_ExtStringArrayDriver::Paste (const BinObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, - BinObjMgt_RRelocationTable& ) const + BinObjMgt_RRelocationTable& theRelocTable) const { Standard_Integer aFirstInd, aLastInd; if (! (theSource >> aFirstInd >> aLastInd)) @@ -81,7 +81,7 @@ Standard_Boolean BinMDataStd_ExtStringArrayDriver::Paste if(ok) { Standard_Boolean aDelta(Standard_False); - if(BinMDataStd::DocumentVersion() > 2) { + if(theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 2) { Standard_Byte aDeltaValue; if (! (theSource >> aDeltaValue)) { return Standard_False; @@ -92,7 +92,7 @@ Standard_Boolean BinMDataStd_ExtStringArrayDriver::Paste anAtt->SetDelta(aDelta); } - BinMDataStd::SetAttributeID(theSource, anAtt); + BinMDataStd::SetAttributeID(theSource, anAtt, theRelocTable.GetHeaderData()->StorageVersion().IntegerValue()); return ok; } diff --git a/src/BinMDataStd/BinMDataStd_ExtStringListDriver.cxx b/src/BinMDataStd/BinMDataStd_ExtStringListDriver.cxx index 35c3724dad..87d7beda85 100644 --- a/src/BinMDataStd/BinMDataStd_ExtStringListDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_ExtStringListDriver.cxx @@ -52,7 +52,7 @@ Handle(TDF_Attribute) BinMDataStd_ExtStringListDriver::NewEmpty() const Standard_Boolean BinMDataStd_ExtStringListDriver::Paste (const BinObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, - BinObjMgt_RRelocationTable& ) const + BinObjMgt_RRelocationTable& theRelocTable) const { Standard_Integer aFirstInd, aLastInd; if (! (theSource >> aFirstInd >> aLastInd)) @@ -74,7 +74,7 @@ Standard_Boolean BinMDataStd_ExtStringListDriver::Paste } } - BinMDataStd::SetAttributeID(theSource, anAtt); + BinMDataStd::SetAttributeID(theSource, anAtt, theRelocTable.GetHeaderData()->StorageVersion().IntegerValue()); return Standard_True; } diff --git a/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx b/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx index ce8004c716..5d2dd63fef 100644 --- a/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx @@ -59,7 +59,7 @@ Handle(TDF_Attribute) BinMDataStd_IntPackedMapDriver::NewEmpty() const Standard_Boolean BinMDataStd_IntPackedMapDriver::Paste (const BinObjMgt_Persistent& Source, const Handle(TDF_Attribute)& Target, - BinObjMgt_RRelocationTable& /*RelocTable*/) const + BinObjMgt_RRelocationTable& RelocTable) const { Handle(TDataStd_IntPackedMap) aTagAtt = Handle(TDataStd_IntPackedMap)::DownCast(Target); if(aTagAtt.IsNull()) { @@ -87,7 +87,7 @@ Standard_Boolean BinMDataStd_IntPackedMapDriver::Paste } Standard_Boolean aDelta(Standard_False); - if(BinMDataStd::DocumentVersion() > 2) { + if(RelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 2) { Standard_Byte aDeltaValue; if (! (Source >> aDeltaValue)) return Standard_False; diff --git a/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx b/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx index 408410c9b2..e9c8b28358 100644 --- a/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_IntegerArrayDriver.cxx @@ -53,7 +53,7 @@ Handle(TDF_Attribute) BinMDataStd_IntegerArrayDriver::NewEmpty() const Standard_Boolean BinMDataStd_IntegerArrayDriver::Paste (const BinObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, - BinObjMgt_RRelocationTable& ) const + BinObjMgt_RRelocationTable& theRelocTable) const { Standard_Integer aFirstInd, aLastInd; if (! (theSource >> aFirstInd >> aLastInd)) @@ -69,7 +69,7 @@ Standard_Boolean BinMDataStd_IntegerArrayDriver::Paste if(!theSource.GetIntArray (&aTargetArray(aFirstInd), aLength)) return Standard_False; Standard_Boolean aDelta(Standard_False); - if(BinMDataStd::DocumentVersion() > 2) { + if(theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 2) { Standard_Byte aDeltaValue; if (! (theSource >> aDeltaValue)) return Standard_False; @@ -77,12 +77,11 @@ Standard_Boolean BinMDataStd_IntegerArrayDriver::Paste aDelta = (aDeltaValue != 0); } #ifdef OCCT_DEBUG - else if(BinMDataStd::DocumentVersion() == -1) - cout << "Current DocVersion field is not initialized. " <StorageFormatVersion() << "\n"; + return 0; + } + return 1; } //======================================================================= @@ -565,9 +572,9 @@ void DDocStd::ApplicationCommands(Draw_Interpretor& theCommands) __FILE__, DDocStd_PrintComments, g); theCommands.Add("GetStorageVersion", - "GetStorageVersion", + "GetStorageVersion Doc", __FILE__, DDocStd_GetStorageVersion, g); theCommands.Add("SetStorageVersion", - "SetStorageVersion Version", + "SetStorageVersion Doc Version", __FILE__, DDocStd_SetStorageVersion, g); } diff --git a/src/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.cxx b/src/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.cxx index 5c5d4ab54a..2b0a1b8fb7 100644 --- a/src/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.cxx +++ b/src/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.cxx @@ -19,10 +19,8 @@ #include #include #include -#include #include #include -#include #include #include @@ -46,17 +44,6 @@ Handle(XmlMDF_ADriverTable) XmlDrivers_DocumentRetrievalDriver::AttributeDrivers return XmlDrivers::AttributeDrivers (theMessageDriver); } -//======================================================================= -//function : PropagateDocumentVersion -//purpose : -//======================================================================= -void XmlDrivers_DocumentRetrievalDriver::PropagateDocumentVersion( - const Standard_Integer theDocVersion ) -{ - XmlMDataStd::SetDocumentVersion(theDocVersion); - XmlMNaming::SetDocumentVersion(theDocVersion); -} - //======================================================================= //function : ReadShapeSection //purpose : Implementation of ReadShapeSection diff --git a/src/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.hxx b/src/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.hxx index 2c45e89837..f73d511c71 100644 --- a/src/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.hxx +++ b/src/XmlDrivers/XmlDrivers_DocumentRetrievalDriver.hxx @@ -43,10 +43,7 @@ public: Standard_EXPORT virtual Handle(XmlMDF_ADriver) ReadShapeSection (const XmlObjMgt_Element& thePDoc, const Handle(Message_Messenger)& theMsgDriver) Standard_OVERRIDE; - Standard_EXPORT virtual void ShapeSetCleaning (const Handle(XmlMDF_ADriver)& theDriver) Standard_OVERRIDE; - - Standard_EXPORT virtual void PropagateDocumentVersion (const Standard_Integer theDocVersion) Standard_OVERRIDE; - + Standard_EXPORT virtual void ShapeSetCleaning (const Handle(XmlMDF_ADriver)& theDriver) Standard_OVERRIDE; diff --git a/src/XmlLDrivers/XmlLDrivers.cxx b/src/XmlLDrivers/XmlLDrivers.cxx index 7f7ca1d115..ab1adbdef7 100644 --- a/src/XmlLDrivers/XmlLDrivers.cxx +++ b/src/XmlLDrivers/XmlLDrivers.cxx @@ -132,10 +132,6 @@ int XmlLDrivers::StorageVersion() { return CURRENT_DOCUMENT_VERSION; } -void XmlLDrivers::SetStorageVersion(const int version) -{ - CURRENT_DOCUMENT_VERSION = version; -} // Declare entry point PLUGINFACTORY PLUGIN(XmlLDrivers) diff --git a/src/XmlLDrivers/XmlLDrivers.hxx b/src/XmlLDrivers/XmlLDrivers.hxx index 767799a693..1714262173 100644 --- a/src/XmlLDrivers/XmlLDrivers.hxx +++ b/src/XmlLDrivers/XmlLDrivers.hxx @@ -43,7 +43,6 @@ public: Standard_EXPORT static Handle(XmlMDF_ADriverTable) AttributeDrivers (const Handle(Message_Messenger)& theMsgDriver); Standard_EXPORT static int StorageVersion(); - Standard_EXPORT static void SetStorageVersion (const int version); }; #endif // _XmlLDrivers_HeaderFile diff --git a/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx b/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx index 499acd7bba..e4d888def2 100644 --- a/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx +++ b/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -280,9 +279,6 @@ void XmlLDrivers_DocumentRetrievalDriver::ReadFromDomDocument } if( aCurDocVersion < 2) aCurDocVersion = 2; - - PropagateDocumentVersion(aCurDocVersion); - Standard_Boolean isRef = Standard_False; for (LDOM_Node aNode = anInfoElem.getFirstChild(); aNode != NULL; aNode = aNode.getNextSibling()) { @@ -438,6 +434,12 @@ void XmlLDrivers_DocumentRetrievalDriver::ReadFromDomDocument if(!aNSDriver.IsNull()) ::take_time (0, " +++++ Fin reading Shapes : ", aMsgDriver); + // 2.1. Keep document format version in RT + Handle(Storage_HeaderData) aHeaderData = new Storage_HeaderData(); + aHeaderData->SetStorageVersion(aCurDocVersion); + myRelocTable.Clear(); + myRelocTable.SetHeaderData(aHeaderData); + // 5. Read document contents try { @@ -477,7 +479,6 @@ Standard_Boolean XmlLDrivers_DocumentRetrievalDriver::MakeDocument { Standard_Boolean aResult = Standard_False; Handle(TDocStd_Document) TDOC = Handle(TDocStd_Document)::DownCast(theTDoc); - myRelocTable.Clear(); if (!TDOC.IsNull()) { Handle(TDF_Data) aTDF = new TDF_Data(); @@ -533,16 +534,6 @@ static void take_time (const Standard_Integer isReset, const char * aHeader, } #endif -//======================================================================= -//function : PropagateDocumentVersion -//purpose : -//======================================================================= -void XmlLDrivers_DocumentRetrievalDriver::PropagateDocumentVersion( - const Standard_Integer theDocVersion ) -{ - XmlMDataStd::SetDocumentVersion(theDocVersion); -} - //======================================================================= //function : ReadShapeSection //purpose : definition of ReadShapeSection diff --git a/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.hxx b/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.hxx index cbb66a0ffe..9262ddadf7 100644 --- a/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.hxx +++ b/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.hxx @@ -73,12 +73,10 @@ protected: Standard_EXPORT virtual Handle(XmlMDF_ADriver) ReadShapeSection (const XmlObjMgt_Element& thePDoc, const Handle(Message_Messenger)& theMsgDriver); Standard_EXPORT virtual void ShapeSetCleaning (const Handle(XmlMDF_ADriver)& theDriver); - - Standard_EXPORT virtual void PropagateDocumentVersion (const Standard_Integer theDocVersion); Handle(XmlMDF_ADriverTable) myDrivers; - XmlObjMgt_RRelocationTable myRelocTable; - TCollection_ExtendedString myFileName; + XmlObjMgt_RRelocationTable myRelocTable; + TCollection_ExtendedString myFileName; private: diff --git a/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx b/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx index 91274b5a9b..61c86beb1a 100644 --- a/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx +++ b/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx @@ -264,7 +264,18 @@ Standard_Boolean XmlLDrivers_DocumentStorageDriver::WriteToDomDocument (const Ha // anInfoElem.setAttribute("appv", anAppVersion.ToCString()); // Document version - anInfoElem.setAttribute("DocVersion", XmlLDrivers::StorageVersion()); + Standard_Integer aFormatVersion(XmlLDrivers::StorageVersion());// the last version of the format + if (theDocument->StorageFormatVersion() > 0) + { + if (XmlLDrivers::StorageVersion() < theDocument->StorageFormatVersion()) + { + TCollection_ExtendedString anErrorString("Unacceptable storage format version, the last verson is used"); + aMessageDriver->Send(anErrorString.ToExtString(), Message_Warning); + } + else + aFormatVersion = theDocument->StorageFormatVersion(); + } + anInfoElem.setAttribute("DocVersion", aFormatVersion); // User info with Copyright TColStd_SequenceOfAsciiString aUserInfo; @@ -282,6 +293,12 @@ Standard_Boolean XmlLDrivers_DocumentStorageDriver::WriteToDomDocument (const Ha for(i = 1; i <= aRefs.Length(); i++) aUserInfo.Append(aRefs.Value(i)); + // Keep fomat version in Reloc. table + Handle(Storage_HeaderData) aHeaderData = theData->HeaderData(); + aHeaderData->SetStorageVersion(aFormatVersion); + myRelocTable.Clear(); + myRelocTable.SetHeaderData(aHeaderData); + for (i = 1; i <= aUserInfo.Length(); i++) { XmlObjMgt_Element aUIItem = aDOMDoc.createElement ("iitem"); @@ -351,7 +368,6 @@ Standard_Integer XmlLDrivers_DocumentStorageDriver::MakeDocument { TCollection_ExtendedString aMessage; Handle(TDocStd_Document) TDOC = Handle(TDocStd_Document)::DownCast(theTDoc); - myRelocTable.Clear(); if (!TDOC.IsNull()) { // myRelocTable.SetDocument (theElement.getOwnerDocument()); diff --git a/src/XmlMDataStd/XmlMDataStd.cxx b/src/XmlMDataStd/XmlMDataStd.cxx index da793d45a9..76b1f6bd17 100644 --- a/src/XmlMDataStd/XmlMDataStd.cxx +++ b/src/XmlMDataStd/XmlMDataStd.cxx @@ -45,7 +45,6 @@ #include #include -static Standard_Integer myDocumentVersion = -1; //======================================================================= //function : AddDrivers //purpose : @@ -81,20 +80,3 @@ void XmlMDataStd::AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable, aDriverTable-> AddDriver (new XmlMDataStd_AsciiStringDriver (anMsgDrv)); aDriverTable-> AddDriver (new XmlMDataStd_IntPackedMapDriver (anMsgDrv)); } - -//======================================================================= -//function : SetDocumentVersion -//purpose : Sets current document version -//======================================================================= -void XmlMDataStd::SetDocumentVersion(const Standard_Integer theVersion) -{ - myDocumentVersion = theVersion; -} -//======================================================================= -//function : DocumentVersion -//purpose : Retrieved document version -//======================================================================= -Standard_Integer XmlMDataStd::DocumentVersion() -{ - return myDocumentVersion; -} diff --git a/src/XmlMDataStd/XmlMDataStd.hxx b/src/XmlMDataStd/XmlMDataStd.hxx index a526ab9d42..7aaa859c7b 100644 --- a/src/XmlMDataStd/XmlMDataStd.hxx +++ b/src/XmlMDataStd/XmlMDataStd.hxx @@ -60,12 +60,6 @@ public: //! Adds the attribute drivers to . Standard_EXPORT static void AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable, const Handle(Message_Messenger)& anMsgDrv); - - Standard_EXPORT static void SetDocumentVersion (const Standard_Integer DocVersion); - - Standard_EXPORT static Standard_Integer DocumentVersion(); - - protected: diff --git a/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx index 3423e9afb2..b4ae0aec4d 100644 --- a/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx @@ -55,7 +55,7 @@ Handle(TDF_Attribute) XmlMDataStd_ByteArrayDriver::NewEmpty() const //======================================================================= Standard_Boolean XmlMDataStd_ByteArrayDriver::Paste(const XmlObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, - XmlObjMgt_RRelocationTable& ) const + XmlObjMgt_RRelocationTable& theRelocTable) const { Standard_Integer aFirstInd, aLastInd, aValue; const XmlObjMgt_Element& anElement = theSource; @@ -129,7 +129,7 @@ Standard_Boolean XmlMDataStd_ByteArrayDriver::Paste(const XmlObjMgt_Persistent& Standard_Boolean aDelta(Standard_False); - if(XmlMDataStd::DocumentVersion() > 2) { + if(theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 2) { Standard_Integer aDeltaValue; if (!anElement.getAttribute(::IsDeltaOn()).GetInteger(aDeltaValue)) { @@ -144,8 +144,7 @@ Standard_Boolean XmlMDataStd_ByteArrayDriver::Paste(const XmlObjMgt_Persistent& aDelta = aDeltaValue != 0; } #ifdef OCCT_DEBUG - else if(XmlMDataStd::DocumentVersion() == -1) - cout << "Current DocVersion field is not initialized. " <SetDelta(aDelta); return Standard_True; @@ -224,7 +221,7 @@ Standard_Boolean XmlMDataStd_ExtStringArrayDriver::Paste //======================================================================= void XmlMDataStd_ExtStringArrayDriver::Paste (const Handle(TDF_Attribute)& theSource, XmlObjMgt_Persistent& theTarget, - XmlObjMgt_SRelocationTable& ) const + XmlObjMgt_SRelocationTable& theRelocTable) const { Handle(TDataStd_ExtStringArray) aExtStringArray = Handle(TDataStd_ExtStringArray)::DownCast(theSource); @@ -243,7 +240,7 @@ void XmlMDataStd_ExtStringArrayDriver::Paste (const Handle(TDF_Attribute)& theSo // So, if the user wants to save the document under the 7th or earlier versions, // don't apply this improvement. Standard_Character c = '-'; - if (XmlLDrivers::StorageVersion() > 7) + if (theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 7) { // Preferrable symbols for the separator: - _ . : ^ ~ // Don't use a space as a separator: XML low-level parser sometimes "eats" it. diff --git a/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx b/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx index eb814a4349..576e4bbef3 100644 --- a/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_IntPackedMapDriver.cxx @@ -59,7 +59,7 @@ Handle(TDF_Attribute) XmlMDataStd_IntPackedMapDriver::NewEmpty () const Standard_Boolean XmlMDataStd_IntPackedMapDriver::Paste (const XmlObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, - XmlObjMgt_RRelocationTable& ) const + XmlObjMgt_RRelocationTable& theRelocTable) const { Handle(TDataStd_IntPackedMap) aPackedMap = Handle(TDataStd_IntPackedMap)::DownCast(theTarget); @@ -106,7 +106,7 @@ Standard_Boolean XmlMDataStd_IntPackedMapDriver::Paste if(Ok) { Standard_Boolean aDelta(Standard_False); - if(XmlMDataStd::DocumentVersion() > 2) { + if(theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 2) { Standard_Integer aDeltaValue; if (!anElement.getAttribute(::IsDeltaOn()).GetInteger(aDeltaValue)) { @@ -120,10 +120,6 @@ Standard_Boolean XmlMDataStd_IntPackedMapDriver::Paste else aDelta = aDeltaValue != 0; } -#ifdef OCCT_DEBUG - else if(XmlMDataStd::DocumentVersion() == -1) - cout << "Current DocVersion field is not initialized. " <SetDelta(aDelta); return Standard_True; } diff --git a/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx index 9c5cc69d5f..a82d818092 100644 --- a/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx @@ -57,7 +57,7 @@ Handle(TDF_Attribute) XmlMDataStd_IntegerArrayDriver::NewEmpty() const Standard_Boolean XmlMDataStd_IntegerArrayDriver::Paste (const XmlObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, - XmlObjMgt_RRelocationTable& ) const + XmlObjMgt_RRelocationTable& theRelocTable) const { Standard_Integer aFirstInd, aLastInd, aValue, ind; const XmlObjMgt_Element& anElement = theSource; @@ -129,7 +129,7 @@ Standard_Boolean XmlMDataStd_IntegerArrayDriver::Paste } Standard_Boolean aDelta(Standard_False); - if(XmlMDataStd::DocumentVersion() > 2) { + if(theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 2) { Standard_Integer aDeltaValue; if (!anElement.getAttribute(::IsDeltaOn()).GetInteger(aDeltaValue)) { @@ -143,10 +143,7 @@ Standard_Boolean XmlMDataStd_IntegerArrayDriver::Paste else aDelta = aDeltaValue != 0; } -#ifdef OCCT_DEBUG - else if(XmlMDataStd::DocumentVersion() == -1) - cout << "Current DocVersion field is not initialized. " <SetDelta(aDelta); return Standard_True; diff --git a/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx index bcc3c43fc8..e238276e6f 100644 --- a/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx @@ -60,7 +60,7 @@ Handle(TDF_Attribute) XmlMDataStd_RealArrayDriver::NewEmpty() const Standard_Boolean XmlMDataStd_RealArrayDriver::Paste (const XmlObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, - XmlObjMgt_RRelocationTable& ) const + XmlObjMgt_RRelocationTable& theRelocTable) const { Handle(TDataStd_RealArray) aRealArray = Handle(TDataStd_RealArray)::DownCast(theTarget); @@ -136,7 +136,7 @@ Standard_Boolean XmlMDataStd_RealArrayDriver::Paste } Standard_Boolean aDelta(Standard_False); - if(XmlMDataStd::DocumentVersion() > 2) { + if(theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 2) { Standard_Integer aDeltaValue; if (!anElement.getAttribute(::IsDeltaOn()).GetInteger(aDeltaValue)) { @@ -150,10 +150,6 @@ Standard_Boolean XmlMDataStd_RealArrayDriver::Paste else aDelta = aDeltaValue != 0; } -#ifdef OCCT_DEBUG - else if(XmlMDataStd::DocumentVersion() == -1) - cout << "Current DocVersion field is not initialized. " <SetDelta(aDelta); return Standard_True; diff --git a/src/XmlMDataStd/XmlMDataStd_TreeNodeDriver.cxx b/src/XmlMDataStd/XmlMDataStd_TreeNodeDriver.cxx index d8dcc7972e..c5004b5057 100644 --- a/src/XmlMDataStd/XmlMDataStd_TreeNodeDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_TreeNodeDriver.cxx @@ -118,7 +118,7 @@ void XmlMDataStd_TreeNodeDriver::Paste // tree id // A not default ID is skipped for storage version 8 and newer. if (aS->ID() != TDataStd_TreeNode::GetDefaultTreeID() || - XmlLDrivers::StorageVersion() < 8) + theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() < 8) { Standard_Character aGuidStr [40]; Standard_PCharacter pGuidStr=aGuidStr; diff --git a/src/XmlMNaming/XmlMNaming.cxx b/src/XmlMNaming/XmlMNaming.cxx index 1aedabda60..c2538e7e8f 100644 --- a/src/XmlMNaming/XmlMNaming.cxx +++ b/src/XmlMNaming/XmlMNaming.cxx @@ -20,7 +20,6 @@ #include #include -static Standard_Integer myDocumentVersion = -1; //======================================================================= //function : AddStorageDrivers //purpose : @@ -31,20 +30,3 @@ void XmlMNaming::AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable, aDriverTable->AddDriver (new XmlMNaming_NamedShapeDriver(aMessageDriver)); aDriverTable->AddDriver (new XmlMNaming_NamingDriver(aMessageDriver)); } - -//======================================================================= -//function : SetDocumentVersion -//purpose : Sets current document version -//======================================================================= -void XmlMNaming::SetDocumentVersion(const Standard_Integer theVersion) -{ - myDocumentVersion = theVersion; -} -//======================================================================= -//function : DocumentVersion -//purpose : Retrieved document version -//======================================================================= -Standard_Integer XmlMNaming::DocumentVersion() -{ - return myDocumentVersion; -} diff --git a/src/XmlMNaming/XmlMNaming.hxx b/src/XmlMNaming/XmlMNaming.hxx index c7971fa148..2f697ab390 100644 --- a/src/XmlMNaming/XmlMNaming.hxx +++ b/src/XmlMNaming/XmlMNaming.hxx @@ -38,12 +38,6 @@ public: //! Adds the attribute drivers to . Standard_EXPORT static void AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable, const Handle(Message_Messenger)& aMessageDriver); - - Standard_EXPORT static void SetDocumentVersion (const Standard_Integer DocVersion); - - Standard_EXPORT static Standard_Integer DocumentVersion(); - - protected: diff --git a/src/XmlMNaming/XmlMNaming_NamingDriver.cxx b/src/XmlMNaming/XmlMNaming_NamingDriver.cxx index 6f4710aee9..7fde8593dc 100644 --- a/src/XmlMNaming/XmlMNaming_NamingDriver.cxx +++ b/src/XmlMNaming/XmlMNaming_NamingDriver.cxx @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -175,7 +174,7 @@ Standard_Boolean XmlMNaming_NamingDriver::Paste } aNgName.Index(aNb); // - if(XmlMNaming::DocumentVersion() > 3) { + if(theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 3) { XmlObjMgt_DOMString aDomEntry = anElem.getAttribute(::ContextLabelString()); if (aDomEntry != NULL) { @@ -204,7 +203,8 @@ Standard_Boolean XmlMNaming_NamingDriver::Paste cout << "Retrieving Context Label is NULL" < 4 && XmlMNaming::DocumentVersion() < 7) { + if(theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 4 && + theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() < 7) { // Orientation processing - converting from old format Handle(TNaming_NamedShape) aNS; if (aNg->Label().FindAttribute(TNaming_NamedShape::GetID(), aNS)) { @@ -223,7 +223,7 @@ Standard_Boolean XmlMNaming_NamingDriver::Paste } } } - if(XmlMNaming::DocumentVersion() > 6) { + if(theRelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 6) { aDOMStr = anElem.getAttribute(::OrientString()); if (!aDOMStr.GetInteger(aNb)) { @@ -238,10 +238,8 @@ Standard_Boolean XmlMNaming_NamingDriver::Paste // or. end } #ifdef OCCT_DEBUG - else if(XmlMNaming::DocumentVersion() == -1) - cout << "Current DocVersion field is not initialized. " <