Kaydet (Commit) 2149e924 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1000600 Division or modulo by float zero

Change-Id: If39679b54ef1bb0a7af794c2f7a6186ebd69c2e0
üst 169bc7c6
...@@ -741,8 +741,14 @@ void DomainMapperTableManager::endOfRowAction() ...@@ -741,8 +741,14 @@ void DomainMapperTableManager::endOfRowAction()
sal_Int16 nLastRelPos = 0; sal_Int16 nLastRelPos = 0;
sal_uInt32 nBorderGridIndex = m_nGridBefore; sal_uInt32 nBorderGridIndex = m_nGridBefore;
size_t nWidthsBound = m_nCell.back( ) - 1;
if (nWidthsBound)
{
if (nFullWidthRelative == 0)
throw std::range_error("divide by zero");
::std::vector< sal_Int32 >::const_iterator aSpansIter = pCurrentSpans->begin( ); ::std::vector< sal_Int32 >::const_iterator aSpansIter = pCurrentSpans->begin( );
for( sal_uInt32 nBorder = 0; nBorder < m_nCell.back( ) - 1; ++nBorder ) for( sal_uInt32 nBorder = 0; nBorder < nWidthsBound; ++nBorder )
{ {
double fGridWidth = 0.; double fGridWidth = 0.;
for ( sal_Int32 nGridCount = *aSpansIter; nGridCount > 0; --nGridCount ) for ( sal_Int32 nGridCount = *aSpansIter; nGridCount > 0; --nGridCount )
...@@ -756,6 +762,7 @@ void DomainMapperTableManager::endOfRowAction() ...@@ -756,6 +762,7 @@ void DomainMapperTableManager::endOfRowAction()
nLastRelPos = nLastRelPos + nRelPos; nLastRelPos = nLastRelPos + nRelPos;
++aSpansIter; ++aSpansIter;
} }
}
TablePropertyMapPtr pPropMap( new TablePropertyMap ); TablePropertyMapPtr pPropMap( new TablePropertyMap );
pPropMap->Insert( PROP_TABLE_COLUMN_SEPARATORS, uno::makeAny( aSeparators ) ); pPropMap->Insert( PROP_TABLE_COLUMN_SEPARATORS, uno::makeAny( aSeparators ) );
......
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