This commit is contained in:
Elena Subbotina
2024-08-25 18:34:30 +03:00
parent a72fcb705b
commit c87a043bd0

View File

@ -374,10 +374,13 @@ namespace DocFileFormat
if (m_nColumns) // there is at least one width set, so create the array
{
if (NULL == m_arrWidth)
m_arrWidth = new short [m_nColumns];
m_arrWidth = new short[m_nColumns];
unsigned char nInd = iter->Arguments[0];
m_arrWidth[nInd] = FormatUtils::BytesToInt16 (iter->Arguments, 1, iter->argumentsSize);
unsigned char nInd = iter->Arguments[0];
if (nInd < m_nColumns)
{
m_arrWidth[nInd] = FormatUtils::BytesToInt16(iter->Arguments, 1, iter->argumentsSize);
}
}
}
break;
@ -490,7 +493,7 @@ namespace DocFileFormat
appendValueAttribute( &pgNumType, L"w:start", wsSprmSPgnStart );
// build the columns
if (m_arrWidth)
if (m_arrWidth && m_nColumns > 0)
{
XMLTools::XMLAttribute equalWidth( L"w:equalWidth", L"0" );
cols.AppendAttribute( equalWidth );