Commit 8d3fb9aa authored by Bob Obara's avatar Bob Obara
Browse files

ENH: Removed NumberOfRequiredValues being mandatory in attribute files

- This attribute is no longer required in an Item Definition if the number of required values
is the default.

- Changed the default number of required values for Attribute Reference Items to be 1 instead of 0
to make it match the other Items

- Fixed bug in reading Date/Time Item Definitions when the Number Of Required Values is not specified
parent abf0864b
......@@ -24,7 +24,7 @@ RefItemDefinition(const std::string &myName):
ItemDefinition(myName), m_definition()
{
this->m_useCommonLabel = false;
this->m_numberOfRequiredValues = 0;
this->m_numberOfRequiredValues = 1;
}
RefItemDefinition::~RefItemDefinition()
......
......@@ -992,12 +992,6 @@ void XmlDocV1Parser::processModelEntityDef(pugi::xml_node &node,
{
idef->setNumberOfRequiredValues(xatt.as_int());
}
else
{
smtkErrorMacro(this->m_logger,
"Missing XML Attribute NumberOfRequiredValues for Item Definition : "
<< idef->name());
}
xatt = node.attribute("Extensible");
if (xatt)
......@@ -1073,7 +1067,7 @@ void XmlDocV1Parser::processValueDef(pugi::xml_node &node,
this->processItemDef(node, idef);
xatt = node.attribute("NumberOfRequiredValues");
std::size_t numberOfComponents = 0;
std::size_t numberOfComponents = idef->numberOfRequiredValues();
if (xatt)
{
numberOfComponents = xatt.as_uint();
......@@ -1331,12 +1325,6 @@ void XmlDocV1Parser::processRefDef(pugi::xml_node &node,
{
idef->setNumberOfRequiredValues(xatt.as_int());
}
else
{
smtkErrorMacro(this->m_logger,
"Missing XML Attribute NumberOfRequiredValues for Item Definition : "
<< idef->name());
}
// Lets see if there are labels
if(node.child("Labels"))
......@@ -1377,12 +1365,6 @@ void XmlDocV1Parser::processDirectoryDef(pugi::xml_node &node,
{
idef->setNumberOfRequiredValues(xatt.as_int());
}
else
{
smtkErrorMacro(this->m_logger,
"Missing XML Attribute NumberOfRequiredValues for Item Definition : "
<< idef->name());
}
xatt = node.attribute("ShouldExist");
if (xatt)
......@@ -1429,12 +1411,6 @@ void XmlDocV1Parser::processFileDef(pugi::xml_node &node,
{
idef->setNumberOfRequiredValues(xatt.as_int());
}
else
{
smtkErrorMacro(this->m_logger,
"Missing XML Attribute NumberOfRequiredValues for Item Definition : "
<< idef->name());
}
xatt = node.attribute("ShouldExist");
if (xatt)
......
......@@ -580,12 +580,6 @@ void XmlDocV2Parser::processMeshEntityDef(pugi::xml_node &node,
{
idef->setNumberOfRequiredValues(xatt.as_int());
}
else
{
smtkErrorMacro(this->m_logger,
"Missing XML Attribute NumberOfRequiredValues for Item Definition : "
<< idef->name());
}
xatt = node.attribute("Extensible");
if (xatt)
......
......@@ -108,7 +108,7 @@ void XmlDocV3Parser::processDateTimeDef(
xml_attribute xatt;
xatt = node.attribute("NumberOfRequiredValues");
std::size_t numberOfComponents = 0;
std::size_t numberOfComponents = idef->numberOfRequiredValues();
if (xatt)
{
numberOfComponents = xatt.as_uint();
......
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