Index: source/chart/SchXMLTableContext.cxx =================================================================== --- source/chart/SchXMLTableContext.cxx (revision 273925) +++ source/chart/SchXMLTableContext.cxx (working copy) @@ -967,7 +967,14 @@ sal_Int32 nColumnCount = 0; sal_Int32 nCol = 0, nRow = 0; if( nRowCount ) - nColumnCount = rTable.aData[ 0 ].size(); + { + ::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin(); + while( iRow != rTable.aData.end() ) + { + nColumnCount = ::std::max( nColumnCount, static_cast(iRow->size()) ); + iRow++; + } + } // #i27909# avoid illegal index access for empty tables if( nColumnCount == 0 || nRowCount == 0 ) @@ -981,7 +988,8 @@ // set labels ::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin(); - for( nCol = 1; nCol < nColumnCount; nCol++ ) + sal_Int32 nColumnCountOnFirstRow = iRow->size(); + for( nCol = 1; nCol < nColumnCountOnFirstRow; nCol++ ) { aLabels[ nCol - 1 ] = (*iRow)[ nCol ].aString; }