Salome HOME
always store a field type of attribute even inside internal dbf-structure
authorisn <isn@opencascade.com>
Fri, 16 Oct 2015 14:26:21 +0000 (17:26 +0300)
committerisn <isn@opencascade.com>
Fri, 16 Oct 2015 14:26:21 +0000 (17:26 +0300)
src/HYDROData/HYDROData_ShapeFile.cxx
src/HYDROData/HYDROData_ShapeFile.h
src/HYDRO_tests/test_HYDROData_ShapeFile.cxx

index 69c6a2768556f2e72f2d1ed756c7f88bd95f321e..10b47b36b7bdf2585258cf640600f3d8d6e1e6d1 100644 (file)
@@ -737,6 +737,16 @@ void HYDROData_ShapeFile::DBF_GetAttributeList(int theIndexOfField, std::vector<
     if( DBFIsAttributeNULL( myHDBF, i, theIndexOfField ) )
     {
       anAttr.myIsNull = true;
+      DBF_FieldType FT = DBF_FieldType_None;
+      if( eType == FTString )
+        FT = DBF_FieldType_String;
+      else if( eType == FTInteger )
+        FT = DBF_FieldType_Integer;
+      else if( eType == FTDouble )
+        FT = DBF_FieldType_Double;
+      else if( eType == FTInvalid )
+        FT = DBF_FieldType_Invalid;
+      anAttr.myFieldType = FT;
     }
     else
     {
index 11517a6647d937b6106706dad2aae02b2a3c28f7..ad1df754ffb7140a0224ac98a606969553a5f952 100644 (file)
@@ -59,6 +59,7 @@ enum DBF_FieldType
   DBF_FieldType_Invalid
 };
 
+
 struct DBF_AttrValue
 {
   DBF_AttrValue() 
index 035d69144e9866b89f469abae4fabeff1e892ec4..ccbb8fad8c1249413f160f9117f8800f72285931 100644 (file)
@@ -98,7 +98,7 @@ void test_HYDROData_ShapeFile::test_GetAttrListIndex()
     //Null attr
     CPPUNIT_ASSERT_EQUAL( true, theAttrV[35].myIsNull);
     CPPUNIT_ASSERT_EQUAL( true, theAttrV[35].myRawValue.empty());
-    CPPUNIT_ASSERT_EQUAL( HYDROData_ShapeFile::DBF_FieldType_None, theAttrV[35].myFieldType);
+    CPPUNIT_ASSERT_EQUAL( HYDROData_ShapeFile::DBF_FieldType_String, theAttrV[35].myFieldType);
 
     theAttrV.clear();
     aSHPFile.DBF_GetAttributeList(1, theAttrV ); //second field