0026377: Passing Handle objects as arguments to functions as non-const reference...
[occt.git] / src / BinDrivers / BinDrivers_DocumentStorageDriver.cxx
index a6db487..730f7f1 100644 (file)
@@ -57,10 +57,14 @@ void BinDrivers_DocumentStorageDriver::WriteShapeSection
 {
   const Standard_Size aShapesSectionOffset = (Standard_Size) theOS.tellp();
   
-  Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver;
-  if (myDrivers->GetDriver(STANDARD_TYPE(TNaming_NamedShape), aNamedShapeDriver)) {   
+  Handle(BinMDF_ADriver) aDriver;
+  if (myDrivers->GetDriver(STANDARD_TYPE(TNaming_NamedShape), aDriver))
+  {
     try { 
-      OCC_CATCH_SIGNALS  aNamedShapeDriver->WriteShapeSection (theOS);
+      OCC_CATCH_SIGNALS
+      Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver =
+        Handle(BinMNaming_NamedShapeDriver)::DownCast (aDriver);
+      aNamedShapeDriver->WriteShapeSection (theOS);
     }
     catch(Standard_Failure) {
       TCollection_ExtendedString anErrorStr ("Error: ");