Kaydet (Commit) 6d7dc74b authored tarafından Jan Holesovsky's avatar Jan Holesovsky

n#382137: Do run out of bounds (& consequently crash) when we have 0 spans.

Maybe just works around the root issue (I did not debug deeper if this is
correct to have 0 here), but improves the code overall, so why not to do this.

Change-Id: I7c2b7f7e410faea5c1d6f3c15f1bc0f155dfb1f4
üst 211dae4f
......@@ -551,12 +551,9 @@ void DomainMapperTableManager::endOfRowAction()
::std::vector< sal_Int32 >::const_iterator aSpansIter = pCurrentSpans->begin( );
for( sal_uInt32 nBorder = 0; nBorder < m_nCell.back( ) - 1; ++nBorder )
{
sal_Int32 nGridCount = *aSpansIter;
double fGridWidth = 0.;
do
{
for ( sal_Int32 nGridCount = *aSpansIter; nGridCount > 0; --nGridCount )
fGridWidth += (*pTableGrid.get())[nBorderGridIndex++];
}while( --nGridCount );
sal_Int16 nRelPos =
sal::static_int_cast< sal_Int16 >((fGridWidth * 10000) / nFullWidthRelative);
......
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