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

Caolán McNamara caolanm at redhat.com
Tue Jan 9 20:42:50 UTC 2018


 sw/source/filter/html/htmltab.cxx |  147 ++++++++++++++++++--------------------
 1 file changed, 71 insertions(+), 76 deletions(-)

New commits:
commit bac55d08211662b4efec8d3b477e8831b109e8e3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 9 10:31:55 2018 +0000

    just use a simple vector
    
    Change-Id: I4aeb611ba7e50c008a9d28d1f7efa308c77ba0a1
    Reviewed-on: https://gerrit.libreoffice.org/47647
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 50da2a0587c9..a92bd2212ab6 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -360,9 +360,9 @@ public:
 };
 
 // HTML table
-typedef std::vector<std::unique_ptr<HTMLTableRow>> HTMLTableRows;
+typedef std::vector<HTMLTableRow> HTMLTableRows;
 
-typedef std::vector<std::unique_ptr<HTMLTableColumn>> HTMLTableColumns;
+typedef std::vector<HTMLTableColumn> HTMLTableColumns;
 
 typedef std::vector<SdrObject *> SdrObjects;
 
@@ -1019,6 +1019,7 @@ HTMLTable::HTMLTable( SwHTMLParser* pPars, HTMLTable *pTopTab,
                       bool bParHead,
                       bool bHasParentSec, bool bHasToFlw,
                       const HTMLTableOptions *pOptions ) :
+    m_aColumns(pOptions->nCols),
     m_nCols( pOptions->nCols ),
     m_nFilledColumns( 0 ),
     m_nCellPadding( pOptions->nCellPadding ),
@@ -1043,10 +1044,6 @@ HTMLTable::HTMLTable( SwHTMLParser* pPars, HTMLTable *pTopTab,
     m_bFirstCell( !pTopTab )
 {
     InitCtor( pOptions );
-
-    for( sal_uInt16 i=0; i<m_nCols; i++ )
-        m_aColumns.push_back(o3tl::make_unique<HTMLTableColumn>());
-
     m_pParser->RegisterHTMLTable(this);
 }
 
@@ -1068,7 +1065,7 @@ const std::shared_ptr<SwHTMLTableLayout>& HTMLTable::CreateLayoutInfo()
 
     sal_uInt16 nBorderWidth = GetBorderWidth( m_aBorderLine, true );
     sal_uInt16 nLeftBorderWidth =
-        m_aColumns[0]->bLeftBorder ? GetBorderWidth(m_aLeftBorderLine, true) : 0;
+        m_aColumns[0].bLeftBorder ? GetBorderWidth(m_aLeftBorderLine, true) : 0;
     sal_uInt16 nRightBorderWidth =
         m_bRightBorder ? GetBorderWidth( m_aRightBorderLine, true ) : 0;
 
@@ -1084,10 +1081,10 @@ const std::shared_ptr<SwHTMLTableLayout>& HTMLTable::CreateLayoutInfo()
     sal_uInt16 i;
     for( i=0; i<m_nRows; i++ )
     {
-        HTMLTableRow *const pRow = m_aRows[i].get();
+        HTMLTableRow& rRow = m_aRows[i];
         for( sal_uInt16 j=0; j<m_nCols; j++ )
         {
-            m_xLayoutInfo->SetCell(pRow->GetCell(j).CreateLayoutInfo(), i, j);
+            m_xLayoutInfo->SetCell(rRow.GetCell(j).CreateLayoutInfo(), i, j);
             SwHTMLTableLayoutCell* pLayoutCell = m_xLayoutInfo->GetCell(i, j );
 
             if( bExportable )
@@ -1103,7 +1100,7 @@ const std::shared_ptr<SwHTMLTableLayout>& HTMLTable::CreateLayoutInfo()
     m_xLayoutInfo->SetExportable( bExportable );
 
     for( i=0; i<m_nCols; i++ )
-        m_xLayoutInfo->SetColumn( m_aColumns[i]->CreateLayoutInfo(), i );
+        m_xLayoutInfo->SetColumn(m_aColumns[i].CreateLayoutInfo(), i);
 
     return m_xLayoutInfo;
 }
@@ -1161,14 +1158,14 @@ const SwStartNode* HTMLTable::GetPrevBoxStartNode( sal_uInt16 nRow, sal_uInt16 n
     else
     {
         sal_uInt16 i;
-        HTMLTableRow *const pPrevRow = m_aRows[nRow-1].get();
+        const HTMLTableRow& rPrevRow = m_aRows[nRow-1];
 
         // maybe a cell in the current row
         i = nCol;
         while( i )
         {
             i--;
-            if( 1 == pPrevRow->GetCell(i).GetRowSpan() )
+            if( 1 == rPrevRow.GetCell(i).GetRowSpan() )
             {
                 pPrevCnts = GetCell(nRow, i).GetContents().get();
                 break;
@@ -1182,7 +1179,7 @@ const SwStartNode* HTMLTable::GetPrevBoxStartNode( sal_uInt16 nRow, sal_uInt16 n
             while( !pPrevCnts && i )
             {
                 i--;
-                pPrevCnts = pPrevRow->GetCell(i).GetContents().get();
+                pPrevCnts = rPrevRow.GetCell(i).GetContents().get();
             }
         }
     }
@@ -1262,7 +1259,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox,
     sal_uInt32 nNumFormat = 0;
     double nValue = 0.0;
 
-    HTMLTableColumn *const pColumn = m_aColumns[nCol].get();
+    const HTMLTableColumn& rColumn = m_aColumns[nCol];
 
     if( pBox->GetSttNd() )
     {
@@ -1278,7 +1275,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox,
             // since the line is gonna be GC-ed (correctly).
             if( nRowSpan > 1 || (this != m_pTopTable && nRowSpan==m_nRows) )
             {
-                pBGBrushItem = m_aRows[nRow]->GetBGBrush().get();
+                pBGBrushItem = m_aRows[nRow].GetBGBrush().get();
                 if( !pBGBrushItem && this != m_pTopTable )
                 {
                     pBGBrushItem = GetBGBrush().get();
@@ -1289,9 +1286,9 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox,
         }
 
         bTopLine = 0==nRow && m_bTopBorder && bFirstPara;
-        if (m_aRows[nRow+nRowSpan-1]->bBottomBorder && bLastPara)
+        if (m_aRows[nRow+nRowSpan-1].bBottomBorder && bLastPara)
         {
-            nEmptyRows = m_aRows[nRow+nRowSpan-1]->GetEmptyRows();
+            nEmptyRows = m_aRows[nRow+nRowSpan-1].GetEmptyRows();
             if( nRow+nRowSpan == m_nRows )
                 bLastBottomLine = true;
             else
@@ -1306,7 +1303,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox,
         if( nColSpan==1 && !bTopLine && !bLastBottomLine && !nEmptyRows &&
             !pBGBrushItem && !bHasNumFormat && !pBoxItem)
         {
-            pFrameFormat = pColumn->GetFrameFormat( bBottomLine, eVOri );
+            pFrameFormat = rColumn.GetFrameFormat( bBottomLine, eVOri );
             bReUsable = !pFrameFormat;
         }
     }
@@ -1361,7 +1358,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox,
                 }
                 bSet = true;
             }
-            if ((m_aColumns[nCol])->bLeftBorder)
+            if (m_aColumns[nCol].bLeftBorder)
             {
                 const SvxBorderLine& rBorderLine =
                     0==nCol ? m_aLeftBorderLine : m_aBorderLine;
@@ -1451,7 +1448,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox,
                 pFrameFormat->ResetFormatAttr( RES_VERT_ORIENT );
 
             if( bReUsable )
-                pColumn->SetFrameFormat( pFrameFormat, bBottomLine, eVOri );
+                const_cast<HTMLTableColumn&>(rColumn).SetFrameFormat(pFrameFormat, bBottomLine, eVOri);
         }
         else
         {
@@ -1544,14 +1541,14 @@ SwTableLine *HTMLTable::MakeTableLine( SwTableBox *pUpper,
                                                      : m_pLineFormat,
                                  0, pUpper );
 
-    HTMLTableRow *pTopRow = m_aRows[nTopRow].get();
-    sal_uInt16 nRowHeight = pTopRow->GetHeight();
+    const HTMLTableRow& rTopRow = m_aRows[nTopRow];
+    sal_uInt16 nRowHeight = rTopRow.GetHeight();
     const SvxBrushItem *pBGBrushItem = nullptr;
     if( this == m_pTopTable || nTopRow>0 || nBottomRow<m_nRows )
     {
         // It doesn't make sense to set a color on a line,
         // if it's the outermost and simultaneously sole line of a table in a table
-        pBGBrushItem = pTopRow->GetBGBrush().get();
+        pBGBrushItem = rTopRow.GetBGBrush().get();
 
         if( !pBGBrushItem && this != m_pTopTable )
         {
@@ -1782,9 +1779,9 @@ void HTMLTable::InheritBorders( const HTMLTable *pParent,
         m_bFillerTopBorder = true; // fillers get a border too
         m_aTopBorderLine = pParent->m_aTopBorderLine;
     }
-    if (pParent->m_aRows[nRow+nRowSpan-1]->bBottomBorder && bLastPara)
+    if (pParent->m_aRows[nRow+nRowSpan-1].bBottomBorder && bLastPara)
     {
-        m_aRows[m_nRows-1]->bBottomBorder = true;
+        m_aRows[m_nRows-1].bBottomBorder = true;
         m_bFillerBottomBorder = true; // fillers get a border too
         m_aBottomBorderLine =
             nRow+nRowSpan==pParent->m_nRows ? pParent->m_aBottomBorderLine
@@ -1794,7 +1791,7 @@ void HTMLTable::InheritBorders( const HTMLTable *pParent,
     // The child table mustn't get an upper or lower border, if that's already done by the surrounding table
     // It can get an upper border if the table is not the first paragraph in that cell
     m_bTopAllowed = ( !bFirstPara || (pParent->m_bTopAllowed &&
-                 (0==nRow || !(pParent->m_aRows[nRow-1])->bBottomBorder)) );
+                 (0==nRow || !pParent->m_aRows[nRow-1].bBottomBorder)) );
 
     // The child table has to inherit the color of the cell it's contained in, if it doesn't have one
     const SvxBrushItem *pInhBG = pParent->GetCell(nRow, nCol).GetBGBrush().get();
@@ -1803,7 +1800,7 @@ void HTMLTable::InheritBorders( const HTMLTable *pParent,
     {
         // the whole surrounding table is a table in a table and consists only of a single line
         // that's gonna be GC-ed (correctly). That's why the background of that line is copied.
-        pInhBG = pParent->m_aRows[nRow]->GetBGBrush().get();
+        pInhBG = pParent->m_aRows[nRow].GetBGBrush().get();
         if( !pInhBG )
             pInhBG = pParent->GetBGBrush().get();
         if( !pInhBG )
@@ -1827,7 +1824,7 @@ void HTMLTable::InheritVertBorders( const HTMLTable *pParent,
             GetBorderWidth( m_aInheritedRightBorderLine, true ) + MIN_BORDER_DIST;
     }
 
-    if ((pParent->m_aColumns[nCol])->bLeftBorder)
+    if (pParent->m_aColumns[nCol].bLeftBorder)
     {
         m_bInheritedLeftBorder = true;  // just remember for now
         m_aInheritedLeftBorderLine = 0==nCol ? pParent->m_aLeftBorderLine
@@ -1845,7 +1842,7 @@ void HTMLTable::InheritVertBorders( const HTMLTable *pParent,
 
     m_bRightAllowed = ( pParent->m_bRightAllowed &&
                   (nCol+nColSpan==pParent->m_nCols ||
-                   !(pParent->m_aColumns[nCol+nColSpan])->bLeftBorder) );
+                   !pParent->m_aColumns[nCol+nColSpan].bLeftBorder) );
 }
 
 void HTMLTable::SetBorders()
@@ -1854,17 +1851,17 @@ void HTMLTable::SetBorders()
     for( i=1; i<m_nCols; i++ )
         if( HTMLTableRules::All==m_eRules || HTMLTableRules::Cols==m_eRules ||
             ((HTMLTableRules::Rows==m_eRules || HTMLTableRules::Groups==m_eRules) &&
-             (m_aColumns[i-1])->IsEndOfGroup()))
+             m_aColumns[i-1].IsEndOfGroup()))
         {
-            (m_aColumns[i])->bLeftBorder = true;
+            m_aColumns[i].bLeftBorder = true;
         }
 
     for( i=0; i<m_nRows-1; i++ )
         if( HTMLTableRules::All==m_eRules || HTMLTableRules::Rows==m_eRules ||
             ((HTMLTableRules::Cols==m_eRules || HTMLTableRules::Groups==m_eRules) &&
-             m_aRows[i]->IsEndOfGroup()))
+             m_aRows[i].IsEndOfGroup()))
         {
-            m_aRows[i]->bBottomBorder = true;
+            m_aRows[i].bBottomBorder = true;
         }
 
     if( m_bTopAllowed && (HTMLTableFrame::Above==m_eFrame || HTMLTableFrame::HSides==m_eFrame ||
@@ -1873,22 +1870,22 @@ void HTMLTable::SetBorders()
     if( HTMLTableFrame::Below==m_eFrame || HTMLTableFrame::HSides==m_eFrame ||
         HTMLTableFrame::Box==m_eFrame )
     {
-        m_aRows[m_nRows-1]->bBottomBorder = true;
+        m_aRows[m_nRows-1].bBottomBorder = true;
     }
     if( HTMLTableFrame::RHS==m_eFrame || HTMLTableFrame::VSides==m_eFrame ||
                       HTMLTableFrame::Box==m_eFrame )
         m_bRightBorder = true;
     if( HTMLTableFrame::LHS==m_eFrame || HTMLTableFrame::VSides==m_eFrame || HTMLTableFrame::Box==m_eFrame )
     {
-        (m_aColumns[0])->bLeftBorder = true;
+        m_aColumns[0].bLeftBorder = true;
     }
 
     for( i=0; i<m_nRows; i++ )
     {
-        HTMLTableRow *const pRow = m_aRows[i].get();
-        for( sal_uInt16 j=0; j<m_nCols; j++ )
+        HTMLTableRow& rRow = m_aRows[i];
+        for (sal_uInt16 j=0; j<m_nCols; ++j)
         {
-            HTMLTableCell& rCell = pRow->GetCell(j);
+            HTMLTableCell& rCell = rRow.GetCell(j);
             if (rCell.GetContents())
             {
                 HTMLTableCnts *pCnts = rCell.GetContents().get();
@@ -1932,15 +1929,15 @@ sal_uInt16 HTMLTable::GetBorderWidth( const SvxBorderLine& rBLine,
 const HTMLTableCell& HTMLTable::GetCell(sal_uInt16 nRow, sal_uInt16 nCell) const
 {
     OSL_ENSURE(nRow < m_aRows.size(), "invalid row index in HTML table");
-    return m_aRows[nRow]->GetCell(nCell);
+    return m_aRows[nRow].GetCell(nCell);
 }
 
 SvxAdjust HTMLTable::GetInheritedAdjust() const
 {
-    SvxAdjust eAdjust = (m_nCurrentColumn<m_nCols ? (m_aColumns[m_nCurrentColumn])->GetAdjust()
+    SvxAdjust eAdjust = (m_nCurrentColumn<m_nCols ? m_aColumns[m_nCurrentColumn].GetAdjust()
                                        : SvxAdjust::End );
     if( SvxAdjust::End==eAdjust )
-        eAdjust = m_aRows[m_nCurrentRow]->GetAdjust();
+        eAdjust = m_aRows[m_nCurrentRow].GetAdjust();
 
     return eAdjust;
 }
@@ -1948,9 +1945,9 @@ SvxAdjust HTMLTable::GetInheritedAdjust() const
 sal_Int16 HTMLTable::GetInheritedVertOri() const
 {
     // text::VertOrientation::TOP is default!
-    sal_Int16 eVOri = m_aRows[m_nCurrentRow]->GetVertOri();
+    sal_Int16 eVOri = m_aRows[m_nCurrentRow].GetVertOri();
     if( text::VertOrientation::TOP==eVOri && m_nCurrentColumn<m_nCols )
-        eVOri = (m_aColumns[m_nCurrentColumn])->GetVertOri();
+        eVOri = m_aColumns[m_nCurrentColumn].GetVertOri();
     if( text::VertOrientation::TOP==eVOri )
         eVOri = m_eVertOrientation;
 
@@ -1979,10 +1976,9 @@ void HTMLTable::InsertCell( std::shared_ptr<HTMLTableCnts> const& rCnts,
     // if we need more columns than we currently have, we need to add cells for all rows
     if( m_nCols < nColsReq )
     {
-        for( i=m_nCols; i<nColsReq; i++ )
-            m_aColumns.push_back(o3tl::make_unique<HTMLTableColumn>());
+        m_aColumns.resize(nColsReq);
         for( i=0; i<m_nRows; i++ )
-            m_aRows[i]->Expand( nColsReq, i<m_nCurrentRow );
+            m_aRows[i].Expand( nColsReq, i<m_nCurrentRow );
         m_nCols = nColsReq;
         OSL_ENSURE(m_aColumns.size() == m_nCols,
                 "wrong number of columns after expanding");
@@ -1994,7 +1990,7 @@ void HTMLTable::InsertCell( std::shared_ptr<HTMLTableCnts> const& rCnts,
     if( m_nRows < nRowsReq )
     {
         for( i=m_nRows; i<nRowsReq; i++ )
-            m_aRows.push_back(o3tl::make_unique<HTMLTableRow>(m_nCols));
+            m_aRows.emplace_back(m_nCols);
         m_nRows = nRowsReq;
         OSL_ENSURE(m_nRows == m_aRows.size(), "wrong number of rows in Insert");
     }
@@ -2003,10 +1999,10 @@ void HTMLTable::InsertCell( std::shared_ptr<HTMLTableCnts> const& rCnts,
     sal_uInt16 nSpanedCols = 0;
     if( m_nCurrentRow>0 )
     {
-        HTMLTableRow *const pCurRow = m_aRows[m_nCurrentRow].get();
+        HTMLTableRow& rCurRow = m_aRows[m_nCurrentRow];
         for( i=m_nCurrentColumn; i<nColsReq; i++ )
         {
-            HTMLTableCell& rCell = pCurRow->GetCell(i);
+            HTMLTableCell& rCell = rCurRow.GetCell(i);
             if (rCell.GetContents())
             {
                 // A cell from a row further above overlaps this one.
@@ -2022,7 +2018,7 @@ void HTMLTable::InsertCell( std::shared_ptr<HTMLTableCnts> const& rCnts,
         for( i=nColsReq; i<nSpanedCols; i++ )
         {
             // These contents are anchored in the row above in any case
-            HTMLTableCell& rCell = pCurRow->GetCell(i);
+            HTMLTableCell& rCell = rCurRow.GetCell(i);
             FixRowSpan( m_nCurrentRow-1, i, rCell.GetContents().get() );
             ProtectRowSpan( m_nCurrentRow, i, rCell.GetRowSpan() );
         }
@@ -2057,7 +2053,7 @@ void HTMLTable::InsertCell( std::shared_ptr<HTMLTableCnts> const& rCnts,
     // Remember height
     if( nCellHeight && 1==nRowSpan )
     {
-        m_aRows[m_nCurrentRow]->SetHeight(static_cast<sal_uInt16>(aTwipSz.Height()));
+        m_aRows[m_nCurrentRow].SetHeight(static_cast<sal_uInt16>(aTwipSz.Height()));
     }
 
     // Set the column counter behind the new cells
@@ -2075,7 +2071,7 @@ inline void HTMLTable::CloseSection( bool bHead )
     // Close the preceding sections if there's already a row
     OSL_ENSURE( m_nCurrentRow<=m_nRows, "invalid current row" );
     if( m_nCurrentRow>0 && m_nCurrentRow<=m_nRows )
-        m_aRows[m_nCurrentRow-1]->SetEndOfGroup();
+        m_aRows[m_nCurrentRow-1].SetEndOfGroup();
     if( bHead )
         m_nHeadlineRepeat = m_nCurrentRow;
 }
@@ -2089,17 +2085,17 @@ void HTMLTable::OpenRow(SvxAdjust eAdjust, sal_Int16 eVertOrient,
     if( m_nRows<nRowsReq )
     {
         for( sal_uInt16 i=m_nRows; i<nRowsReq; i++ )
-            m_aRows.push_back(o3tl::make_unique<HTMLTableRow>(m_nCols));
+            m_aRows.emplace_back(m_nCols);
         m_nRows = nRowsReq;
         OSL_ENSURE( m_nRows == m_aRows.size(),
                 "Row number in OpenRow is wrong" );
     }
 
-    HTMLTableRow *const pCurRow = m_aRows[m_nCurrentRow].get();
-    pCurRow->SetAdjust( eAdjust );
-    pCurRow->SetVertOri( eVertOrient );
+    HTMLTableRow& rCurRow = m_aRows[m_nCurrentRow];
+    rCurRow.SetAdjust(eAdjust);
+    rCurRow.SetVertOri(eVertOrient);
     if (rBGBrushItem)
-        m_aRows[m_nCurrentRow]->SetBGBrush(rBGBrushItem);
+        m_aRows[m_nCurrentRow].SetBGBrush(rBGBrushItem);
 
     // reset the column counter
     m_nCurrentColumn=0;
@@ -2117,18 +2113,18 @@ void HTMLTable::CloseRow( bool bEmpty )
     if( bEmpty )
     {
         if( m_nCurrentRow > 0 )
-            m_aRows[m_nCurrentRow-1]->IncEmptyRows();
+            m_aRows[m_nCurrentRow-1].IncEmptyRows();
         return;
     }
 
-    HTMLTableRow *const pRow = m_aRows[m_nCurrentRow].get();
+    HTMLTableRow& rRow = m_aRows[m_nCurrentRow];
 
     // modify the COLSPAN of all empty cells at the row end in a way, that they're forming a single cell
     // that can be done here (and not earlier) since there's no more cells in that row
     sal_uInt16 i=m_nCols;
     while( i )
     {
-        HTMLTableCell& rCell = pRow->GetCell(--i);
+        HTMLTableCell& rCell = rRow.GetCell(--i);
         if (!rCell.GetContents())
         {
             sal_uInt16 nColSpan = m_nCols-i;
@@ -2151,7 +2147,7 @@ inline void HTMLTable::CloseColGroup( sal_uInt16 nSpan, sal_uInt16 _nWidth,
 
     OSL_ENSURE( m_nCurrentColumn<=m_nCols, "invalid column" );
     if( m_nCurrentColumn>0 && m_nCurrentColumn<=m_nCols )
-        (m_aColumns[m_nCurrentColumn-1])->SetEndOfGroup();
+        m_aColumns[m_nCurrentColumn-1].SetEndOfGroup();
 }
 
 void HTMLTable::InsertCol( sal_uInt16 nSpan, sal_uInt16 nColWidth, bool bRelWidth,
@@ -2170,8 +2166,7 @@ void HTMLTable::InsertCol( sal_uInt16 nSpan, sal_uInt16 nColWidth, bool bRelWidt
 
     if( m_nCols < nColsReq )
     {
-        for( i=m_nCols; i<nColsReq; i++ )
-            m_aColumns.push_back(o3tl::make_unique<HTMLTableColumn>());
+        m_aColumns.resize(nColsReq);
         m_nCols = nColsReq;
     }
 
@@ -2184,11 +2179,11 @@ void HTMLTable::InsertCol( sal_uInt16 nSpan, sal_uInt16 nColWidth, bool bRelWidt
 
     for( i=m_nCurrentColumn; i<nColsReq; i++ )
     {
-        HTMLTableColumn *const pCol = m_aColumns[i].get();
+        HTMLTableColumn& rCol = m_aColumns[i];
         sal_uInt16 nTmp = bRelWidth ? nColWidth : (sal_uInt16)aTwipSz.Width();
-        pCol->SetWidth( nTmp, bRelWidth );
-        pCol->SetAdjust( eAdjust );
-        pCol->SetVertOri( eVertOrient );
+        rCol.SetWidth( nTmp, bRelWidth );
+        rCol.SetAdjust( eAdjust );
+        rCol.SetVertOri( eVertOrient );
     }
 
     m_bColSpec = true;
@@ -2205,14 +2200,14 @@ void HTMLTable::CloseTable()
     // and we need to adjust the ROWSPAN in the rows above
     if( m_nRows>m_nCurrentRow )
     {
-        HTMLTableRow *const pPrevRow = m_aRows[m_nCurrentRow-1].get();
+        HTMLTableRow& rPrevRow = m_aRows[m_nCurrentRow-1];
         for( i=0; i<m_nCols; i++ )
         {
-            HTMLTableCell& rCell = pPrevRow->GetCell(i);
+            HTMLTableCell& rCell = rPrevRow.GetCell(i);
             if (rCell.GetRowSpan() > 1)
             {
                 FixRowSpan(m_nCurrentRow-1, i, rCell.GetContents().get());
-                ProtectRowSpan(m_nCurrentRow, i, m_aRows[m_nCurrentRow]->GetCell(i).GetRowSpan());
+                ProtectRowSpan(m_nCurrentRow, i, m_aRows[m_nCurrentRow].GetCell(i).GetRowSpan());
             }
         }
         for( i=m_nRows-1; i>=m_nCurrentRow; i-- )
@@ -2223,9 +2218,9 @@ void HTMLTable::CloseTable()
     // if the table has no column, we need to add one
     if( 0==m_nCols )
     {
-        m_aColumns.push_back(o3tl::make_unique<HTMLTableColumn>());
+        m_aColumns.resize(1);
         for( i=0; i<m_nRows; i++ )
-            m_aRows[i]->Expand(1);
+            m_aRows[i].Expand(1);
         m_nCols = 1;
         m_nFilledColumns = 1;
     }
@@ -2233,7 +2228,7 @@ void HTMLTable::CloseTable()
     // if the table has no row, we need to add one
     if( 0==m_nRows )
     {
-        m_aRows.push_back(o3tl::make_unique<HTMLTableRow>(m_nCols));
+        m_aRows.emplace_back(m_nCols);
         m_nRows = 1;
         m_nCurrentRow = 1;
     }
@@ -2242,7 +2237,7 @@ void HTMLTable::CloseTable()
     {
         m_aColumns.erase(m_aColumns.begin() + m_nFilledColumns, m_aColumns.begin() + m_nCols);
         for( i=0; i<m_nRows; i++ )
-            m_aRows[i]->Shrink( m_nFilledColumns );
+            m_aRows[i].Shrink( m_nFilledColumns );
         m_nCols = m_nFilledColumns;
     }
 }
@@ -2342,11 +2337,11 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail,
         }
 
         if( m_xLayoutInfo->GetRelLeftFill() == 0 &&
-            !m_aColumns[0]->bLeftBorder &&
+            !m_aColumns[0].bLeftBorder &&
             m_bInheritedLeftBorder )
         {
             // If applicable, inherit right border of outer table
-            m_aColumns[0]->bLeftBorder = true;
+            m_aColumns[0].bLeftBorder = true;
             m_aLeftBorderLine = m_aInheritedLeftBorderLine;
         }
     }


More information about the Libreoffice-commits mailing list