Skip to content

Commit

Permalink
minor modification in Checker for groupSize support
Browse files Browse the repository at this point in the history
issue #33
  • Loading branch information
Valentin Noel committed Dec 27, 2013
1 parent c1ed665 commit eeefec4
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions libraries/ElementChecker/src/ElementChecker/Checker/Checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,21 @@ void Checker::setParentGroupSize( const ShPtrElement element )
ShPtrElement parent = element->getParent();
ShPtrElement previous = element->getPrevious();


if( parent == nullptr || previous == nullptr || ! isLastInGroup( element ) || parent->_groupSizeExpr.empty() )
return;

parent->_specGroupSize = _exprParser->getExpressionResult< size_t >( parent->_groupSizeExpr );
LOG_TRACE( "[checker] set " << element->_id << "'s parent (" << parent->_id << ") groupSize (" << parent->_groupSizeExpr << "): " << parent->_specGroupSize );

while( true )
{
if( parent == nullptr || ( parent->_groupSizeExpr.size() && parent->_specGroupSize > 0 ) )
break;
if( parent->_groupSizeExpr.size() )
{
parent->_specGroupSize = _exprParser->getExpressionResult< size_t >( parent->_groupSizeExpr );
LOG_TRACE( "[checker] >>> set " << element->_id << "'s parent (" << parent->_id << ") groupSize (" << parent->_groupSizeExpr << "): " << parent->_specGroupSize );
}
parent = parent->getParent();
}
}

void Checker::updateParentSize( const ShPtrElement element )
Expand Down

0 comments on commit eeefec4

Please sign in to comment.