diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-06-23 11:03:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-06-23 17:54:09 +0200 |
commit | 5ff95b16cf9fb2ac7b2b970614e3b98f55978dc0 (patch) | |
tree | a32efb8cb69c721dcb0fc93c6e935d2b4da07643 | |
parent | 2db34a069901cd0149d04c275df19afba728cdcc (diff) |
coverity#1399034 rework to avoid 'Unrecoverable parse warning'
emit.cpp:1472: assertion failure: emit-ast.cpp:1123: assertion failed: Ran out of fields in aggregate initializer
Change-Id: Ib17de1917aa19bf171663c1077e9e9c3bed96d33
Reviewed-on: https://gerrit.libreoffice.org/39160
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sd/source/ui/table/TableDesignPane.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index a1356f40d83e..acfd3a18515b 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -484,7 +484,7 @@ CellInfo::CellInfo( const Reference< XStyle >& xStyle ) } typedef std::vector< std::shared_ptr< CellInfo > > CellInfoVector; -typedef std::shared_ptr< CellInfo > CellInfoMatrix[nPreviewColumns][nPreviewRows]; +typedef std::shared_ptr< CellInfo > CellInfoMatrix[nPreviewColumns * nPreviewRows]; struct TableStyleSettings { @@ -594,7 +594,7 @@ static void FillCellInfoMatrix( const CellInfoVector& rStyle, const TableStyleSe xCellInfo = rStyle[sdr::table::body_style]; } - rMatrix[nCol][nRow] = xCellInfo; + rMatrix[(nCol * nPreviewColumns) + nRow] = xCellInfo; } } } @@ -629,7 +629,7 @@ const Bitmap CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle, sal_Int32 nX = 0; for( sal_Int32 nCol = 0; nCol < nPreviewColumns; ++nCol, nX += nCellWidth-1 ) { - std::shared_ptr< CellInfo > xCellInfo( aMatrix[nCol][nRow] ); + std::shared_ptr< CellInfo > xCellInfo(aMatrix[(nCol * nPreviewColumns) + nRow]); Color aTextColor( COL_AUTO ); if( xCellInfo.get() ) @@ -663,7 +663,7 @@ const Bitmap CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle, sal_Int32 nX = 0; for( sal_Int32 nCol = 0; nCol < nPreviewColumns; ++nCol, nX += nCellWidth-1 ) { - std::shared_ptr< CellInfo > xCellInfo( aMatrix[nCol][nRow] ); + std::shared_ptr< CellInfo > xCellInfo(aMatrix[(nCol * nPreviewColumns) + nRow]); if( xCellInfo.get() ) { @@ -687,7 +687,7 @@ const Bitmap CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle, if( (nBorderCol >= 0) && (nBorderCol < nPreviewColumns) && (nBorderRow >= 0) && (nBorderRow < nPreviewRows) ) { // check border - std::shared_ptr< CellInfo > xBorderInfo( aMatrix[nBorderCol][nBorderRow] ); + std::shared_ptr< CellInfo > xBorderInfo(aMatrix[(nBorderCol * nPreviewColumns) + nBorderRow]); if( xBorderInfo.get() ) { const ::editeng::SvxBorderLine* pBorderLine2 = xBorderInfo->maBorder.GetLine(static_cast<SvxBoxItemLine>(static_cast<int>(nLine)^1)); |