Skip to content
Snippets Groups Projects
Commit c7659c6d authored by Ben Boeckel's avatar Ben Boeckel
Browse files

Merge remote-tracking branch 'gl/tjcorona/issue_0015525' into release

* gl/tjcorona/issue_0015525:
  XML data reader now throws an error when reading arrays with duplicate names.
parents bc5cce36 c3a86fd5
Branches
Tags
No related merge requests found
......@@ -272,8 +272,12 @@ void vtkXMLDataReader::SetupOutputData()
for (int i = 0; i < ePointData->GetNumberOfNestedElements(); i++)
{
vtkXMLDataElement* eNested = ePointData->GetNestedElement(i);
if (this->PointDataArrayIsEnabled(eNested) &&
!pointData->HasArray(eNested->GetAttribute("Name")))
if (pointData->HasArray(eNested->GetAttribute("Name")))
{
vtkErrorMacro("Duplicate array names.");
this->DataError = 1;
}
if (this->PointDataArrayIsEnabled(eNested))
{
this->NumberOfPointArrays++;
vtkAbstractArray* array = this->CreateArray(eNested);
......@@ -298,8 +302,12 @@ void vtkXMLDataReader::SetupOutputData()
for (int i = 0; i < eCellData->GetNumberOfNestedElements(); i++)
{
vtkXMLDataElement* eNested = eCellData->GetNestedElement(i);
if (this->CellDataArrayIsEnabled(eNested) &&
!cellData->HasArray(eNested->GetAttribute("Name")))
if (cellData->HasArray(eNested->GetAttribute("Name")))
{
vtkErrorMacro("Duplicate array names.");
this->DataError = 1;
}
if (this->CellDataArrayIsEnabled(eNested))
{
this->NumberOfCellArrays++;
vtkAbstractArray* array = this->CreateArray(eNested);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment