0027277: geom/extruded_00/A0: OCAF document is not opened correctly
authorabv <abv@opencascade.com>
Thu, 17 Mar 2016 12:04:19 +0000 (15:04 +0300)
committerabv <abv@opencascade.com>
Thu, 17 Mar 2016 12:08:03 +0000 (15:08 +0300)
Reading of attribute TDataStd_ExtStringList from CSFDB format is corrected for null strings: empty value is used.

Test bugs caf bug27277 added.

src/StdLPersistent/StdLPersistent_Collection.cxx
tests/bugs/caf/bug27277 [new file with mode: 0644]

index 3deffb8..52029b2 100644 (file)
@@ -40,14 +40,12 @@ struct StdLPersistent_Collection::stringConverter
   const TCollection_ExtendedString& operator()
     (const Handle(StdObjMgt_Persistent)& theValue) const
   {
-    Handle(TCollection_HExtendedString) aString = theValue->ExtString();
-    if (aString)
-      return aString->String();
-    else
-    {
-      static TCollection_ExtendedString anEmptyString;
+    static TCollection_ExtendedString anEmptyString;
+    if (theValue.IsNull())
       return anEmptyString;
-    }
+
+    Handle(TCollection_HExtendedString) aString = theValue->ExtString();
+    return aString ? aString->String() : anEmptyString;
   }
 };
 
diff --git a/tests/bugs/caf/bug27277 b/tests/bugs/caf/bug27277
new file mode 100644 (file)
index 0000000..6a16420
--- /dev/null
@@ -0,0 +1,12 @@
+puts "==========="
+puts "0027277: geom/extruded_00/A0: OCAF document is not opened correctly"
+puts "==========="
+
+
+Open [locate_data_file bug27277_GEOM.sgd] D
+
+# check result of reading by number of attributes in dump
+set dump [XDumpDF D]
+if { ! [regexp {418 attributes dumped between 418} $dump] } {
+  puts "Error: expected 418 attributes in resulting document"
+}