Kaydet (Commit) 796cc06c authored tarafından Andre Fischer's avatar Andre Fischer

#i120102# Guard vector access by ensuring vector is not empty.

üst 12d9dd72
...@@ -507,6 +507,9 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl ...@@ -507,6 +507,9 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
CellPropertyValuesSeq_t aCellProperties( m_aCellProperties.size() ); CellPropertyValuesSeq_t aCellProperties( m_aCellProperties.size() );
if ( ! m_aCellProperties.empty())
{
// std::vector< std::vector<PropertyMapPtr> > m_aCellProperties // std::vector< std::vector<PropertyMapPtr> > m_aCellProperties
PropertyMapVector2::const_iterator aRowOfCellsIterator = m_aCellProperties.begin(); PropertyMapVector2::const_iterator aRowOfCellsIterator = m_aCellProperties.begin();
PropertyMapVector2::const_iterator aRowOfCellsIteratorEnd = m_aCellProperties.end(); PropertyMapVector2::const_iterator aRowOfCellsIteratorEnd = m_aCellProperties.end();
...@@ -516,6 +519,8 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl ...@@ -516,6 +519,8 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
//it's a uno::Sequence< beans::PropertyValues >* //it's a uno::Sequence< beans::PropertyValues >*
RowPropertyValuesSeq_t* pCellProperties = aCellProperties.getArray(); RowPropertyValuesSeq_t* pCellProperties = aCellProperties.getArray();
while( aRowOfCellsIterator != aRowOfCellsIteratorEnd ) while( aRowOfCellsIterator != aRowOfCellsIteratorEnd )
{
if ( ! aRowOfCellsIterator->empty())
{ {
//aRowOfCellsIterator points to a vector of PropertyMapPtr //aRowOfCellsIterator points to a vector of PropertyMapPtr
PropertyMapVector1::const_iterator aCellIterator = aRowOfCellsIterator->begin(); PropertyMapVector1::const_iterator aCellIterator = aRowOfCellsIterator->begin();
...@@ -646,6 +651,8 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl ...@@ -646,6 +651,8 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
++nRow; ++nRow;
++aRowOfCellsIterator; ++aRowOfCellsIterator;
} }
}
}
#ifdef DEBUG_DMAPPER_TABLE_HANDLER #ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement("getCellProperties"); dmapper_logger->endElement("getCellProperties");
......
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