[Libreoffice-commits] core.git: sd/source

Caolán McNamara caolanm at redhat.com
Fri Jun 23 15:54:29 UTC 2017


 sd/source/ui/table/TableDesignPane.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 5ff95b16cf9fb2ac7b2b970614e3b98f55978dc0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jun 23 11:03:35 2017 +0100

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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));


More information about the Libreoffice-commits mailing list