Skip to content
Snippets Groups Projects
Commit bfe40bc6 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

BUG: VectorDataKeywordlist (only doing a shallow copy of the char* now...)

parent 1f253998
Branches
Tags
No related merge requests found
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
=========================================================================*/ =========================================================================*/
#include "otbVectorDataKeywordlist.h" #include "otbVectorDataKeywordlist.h"
#include <iomanip>
namespace otb namespace otb
{ {
...@@ -42,7 +43,7 @@ void VectorDataKeywordlist:: ...@@ -42,7 +43,7 @@ void VectorDataKeywordlist::
{ {
FieldType newField; FieldType newField;
newField.first = new OGRFieldDefn(fieldDefn); newField.first = new OGRFieldDefn(fieldDefn);
newField.second = *field; newField.second = *field; //FIXME this is only a shallow copy
m_FieldList.push_back(newField); m_FieldList.push_back(newField);
}; };
...@@ -54,7 +55,7 @@ VectorDataKeywordlist:: ...@@ -54,7 +55,7 @@ VectorDataKeywordlist::
{ {
FieldType newField; FieldType newField;
newField.first = new OGRFieldDefn(p.m_FieldList[i].first); newField.first = new OGRFieldDefn(p.m_FieldList[i].first);
newField.second = p.m_FieldList[i].second; newField.second = p.m_FieldList[i].second; //FIXME this is only a shallow copy
m_FieldList.push_back(newField); m_FieldList.push_back(newField);
} }
} }
...@@ -83,6 +84,7 @@ VectorDataKeywordlist:: ...@@ -83,6 +84,7 @@ VectorDataKeywordlist::
PrintField(FieldType field) const PrintField(FieldType field) const
{ {
std::stringstream output; std::stringstream output;
output << std::setprecision(15);
output << field.first->GetNameRef() << " ("; output << field.first->GetNameRef() << " (";
output << field.first->GetFieldTypeName(field.first->GetType()) << "): "; output << field.first->GetFieldTypeName(field.first->GetType()) << "): ";
switch(field.first->GetType()) switch(field.first->GetType())
...@@ -109,7 +111,10 @@ VectorDataKeywordlist:: ...@@ -109,7 +111,10 @@ VectorDataKeywordlist::
} }
case OFTString: case OFTString:
{ {
output << field.second.String; if (field.second.String != NULL)
{
output << field.second.String;
}
break; break;
} }
case OFTStringList: case OFTStringList:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment