Commit b657cdef authored by David Cole's avatar David Cole
Browse files

ENH: Merge changes from main tree into VTK-5-0 branch. (cvs -q up -j1.67...

ENH: Merge changes from main tree into VTK-5-0 branch. (cvs -q up -j1.67 -j1.68 IO/vtkXMLWriter.cxx)
parent 59a53aed
......@@ -33,6 +33,8 @@
#include "vtkOffsetsManagerArray.h"
#undef vtkOffsetsManager_DoNotInclude
#include <vtksys/ios/sstream>
#include <assert.h>
#include <vtkstd/string>
......@@ -42,7 +44,7 @@
# include <io.h> /* unlink */
#endif
vtkCxxRevisionMacro(vtkXMLWriter, "1.58.2.3");
vtkCxxRevisionMacro(vtkXMLWriter, "1.58.2.4");
vtkCxxSetObjectMacro(vtkXMLWriter, Compressor, vtkDataCompressor);
//----------------------------------------------------------------------------
......@@ -1543,13 +1545,17 @@ void vtkXMLWriter::WriteDataArrayHeader(vtkDataArray* a, vtkIndent indent,
{
this->WriteStringAttribute("Name", alternateName);
}
else if(const char* arrayName = a->GetName())
{
this->WriteStringAttribute("Name", arrayName);
}
else
{
const char* arrayName = a->GetName();
if(arrayName)
{
this->WriteStringAttribute("Name", arrayName);
}
// Generate a name for this array.
vtksys_ios::ostringstream name;
void* p = a;
name << "Array " << p;
this->WriteStringAttribute("Name", name.str().c_str());
}
if(a->GetNumberOfComponents() > 1)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment