Commit c06c0d4b authored by js9's avatar js9
Browse files

merge from 2.0RC: fix for xml2atts and regen file open options use the fix


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@10532 18c085ea-50e0-402c-830e-de6fd14e8384
parent 9d36f5e5
/*****************************************************************************
*
* Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* All rights reserved.
......@@ -547,9 +547,9 @@ FileOpenOptions::SetFromNode(DataNode *parentNode)
SetTypeNames(node->AsStringVector());
if((node = searchNode->GetNode("typeIDs")) != 0)
SetTypeIDs(node->AsStringVector());
// Clear all the DBOptionsAttributess.
ClearOpenOptions();
// Clear all the DBOptionsAttributess if we got any.
bool clearedOpenOptions = false;
// Go through all of the children and construct a new
// DBOptionsAttributes for each one of them.
children = searchNode->GetChildren();
......@@ -559,6 +559,11 @@ FileOpenOptions::SetFromNode(DataNode *parentNode)
{
if(children[i]->GetKey() == std::string("DBOptionsAttributes"))
{
if (!clearedOpenOptions)
{
ClearOpenOptions();
clearedOpenOptions = true;
}
DBOptionsAttributes temp;
temp.SetFromNode(children[i]);
AddOpenOptions(temp);
......
......@@ -195,6 +195,11 @@ using std::vector;
// Jeremy Meredith, Thu Aug 7 14:34:01 EDT 2008
// Reorder constructor initializers to be the correct order.
//
// Jeremy Meredith, Thu Mar 25 14:13:10 EDT 2010
// For att vectors, if we don't get any new contents, then don't
// clear the old vector. This mirrors the behavior for other
// types of fields.
//
// ****************************************************************************
// ----------------------------------------------------------------------------
......@@ -1141,9 +1146,9 @@ class AttsGeneratorAttVector : public virtual AttVector , public virtual AttsGen
if(Name.right(1) != "s")
plural = "s";
c << " // Clear all the " << attType << "s." << Endl;
c << " Clear" << Name << plural << "();" << Endl;
c << Endl;
c << " // Clear all the " << attType << "s if we got any." << Endl;
c << " bool cleared" << Name << plural << " = false;" << Endl;
c << " // Go through all of the children and construct a new" << Endl;
c << " // " << attType << " for each one of them." << Endl;
......@@ -1154,6 +1159,11 @@ class AttsGeneratorAttVector : public virtual AttVector , public virtual AttsGen
c << " {" << Endl;
c << " if(children[i]->GetKey() == std::string(\"" << attType << "\"))" << Endl;
c << " {" << Endl;
c << " if (!cleared" << Name << plural << ")" << Endl;
c << " {" << Endl;
c << " Clear" << Name << plural << "();" << Endl;
c << " cleared" << Name << plural << " = true;" << Endl;
c << " }" << Endl;
c << " " << attType << " temp;" << Endl;
c << " temp.SetFromNode(children[i]);" << Endl;
c << " Add" << Name << "(temp);" << Endl;
......
Markdown is supported
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