View | Details | Raw Unified | Return to issue 103588
Collapse All | Expand All

(-)source/chart/SchXMLTableContext.cxx (-2 / +10 lines)
Lines 967-973 Link Here
967
        sal_Int32 nColumnCount = 0;
967
        sal_Int32 nColumnCount = 0;
968
        sal_Int32 nCol = 0, nRow = 0;
968
        sal_Int32 nCol = 0, nRow = 0;
969
        if( nRowCount )
969
        if( nRowCount )
970
            nColumnCount = rTable.aData[ 0 ].size();
970
        {
971
            ::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin();
972
            while( iRow != rTable.aData.end() )
973
            {
974
                nColumnCount = ::std::max( nColumnCount, static_cast<sal_Int32>(iRow->size()) );
975
                iRow++;
976
            }
977
        }
971
978
972
        // #i27909# avoid illegal index access for empty tables
979
        // #i27909# avoid illegal index access for empty tables
973
        if( nColumnCount == 0 || nRowCount == 0 )
980
        if( nColumnCount == 0 || nRowCount == 0 )
Lines 981-987 Link Here
981
988
982
        // set labels
989
        // set labels
983
        ::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin();
990
        ::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin();
984
        for( nCol = 1; nCol < nColumnCount; nCol++ )
991
        sal_Int32 nColumnCountOnFirstRow = iRow->size();
992
        for( nCol = 1; nCol < nColumnCountOnFirstRow; nCol++ )
985
        {
993
        {
986
            aLabels[ nCol - 1 ] = (*iRow)[ nCol ].aString;
994
            aLabels[ nCol - 1 ] = (*iRow)[ nCol ].aString;
987
        }
995
        }

Return to issue 103588