diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-19 11:17:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-20 08:24:35 +0200 |
commit | d21d14c112312c639383ba9d9091380327dc0717 (patch) | |
tree | 6a145331fd999463c5aa63440cd34fd8930477e4 /sw/inc/htmltbl.hxx | |
parent | 4a553b9a5830ecc752efe0b0f2692bac0f0f3f8c (diff) |
loplugin:inlinefields in SwHTMLTableLayout
and make the memory management a little more obvious with
std::unique_ptr.
Change-Id: Ie0dad6a52f70896e144cc396d39c10e9cbff4316
Reviewed-on: https://gerrit.libreoffice.org/36667
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc/htmltbl.hxx')
-rw-r--r-- | sw/inc/htmltbl.hxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sw/inc/htmltbl.hxx b/sw/inc/htmltbl.hxx index 5dfb2eb56b57..4aec0834be6e 100644 --- a/sw/inc/htmltbl.hxx +++ b/sw/inc/htmltbl.hxx @@ -173,8 +173,8 @@ class SwHTMLTableLayout { Timer m_aResizeTimer; ///< Timer for DelayedResize. - SwHTMLTableLayoutColumn **m_aColumns; - SwHTMLTableLayoutCell **m_aCells; + std::vector<std::unique_ptr<SwHTMLTableLayoutColumn>> m_aColumns; + std::vector<std::unique_ptr<SwHTMLTableLayoutCell>> m_aCells; const SwTable *m_pSwTable; ///< SwTable (Top-Table only). SwTableBox *m_pLeftFillerBox; ///< Left filler-box (table in table only). @@ -278,10 +278,10 @@ public: sal_uInt16 nParentInhSpace=0 ); inline SwHTMLTableLayoutColumn *GetColumn( sal_uInt16 nCol ) const; - inline void SetColumn( SwHTMLTableLayoutColumn *pCol, sal_uInt16 nCol ); + inline void SetColumn( std::unique_ptr<SwHTMLTableLayoutColumn> pCol, sal_uInt16 nCol ); inline SwHTMLTableLayoutCell *GetCell( sal_uInt16 nRow, sal_uInt16 nCol ) const; - inline void SetCell( SwHTMLTableLayoutCell *pCell, sal_uInt16 nRow, sal_uInt16 nCol ); + inline void SetCell( std::unique_ptr<SwHTMLTableLayoutCell> pCell, sal_uInt16 nRow, sal_uInt16 nCol ); void SetLeftFillerBox( SwTableBox *pBox ) { m_pLeftFillerBox = pBox; } void SetRightFillerBox( SwTableBox *pBox ) { m_pRightFillerBox = pBox; } @@ -410,7 +410,7 @@ inline sal_uInt16 SwHTMLTableLayout::GetInhCellSpace( sal_uInt16 nCol, inline SwHTMLTableLayoutColumn *SwHTMLTableLayout::GetColumn( sal_uInt16 nCol ) const { - return m_aColumns[nCol]; + return m_aColumns[nCol].get(); } inline void SwHTMLTableLayoutColumn::SetWidthOption( sal_uInt16 nWidth ) @@ -419,20 +419,20 @@ inline void SwHTMLTableLayoutColumn::SetWidthOption( sal_uInt16 nWidth ) bRelWidthOption = true; } -inline void SwHTMLTableLayout::SetColumn( SwHTMLTableLayoutColumn *pCol, sal_uInt16 nCol ) +inline void SwHTMLTableLayout::SetColumn( std::unique_ptr<SwHTMLTableLayoutColumn> pCol, sal_uInt16 nCol ) { - m_aColumns[nCol] = pCol; + m_aColumns[nCol] = std::move(pCol); } inline SwHTMLTableLayoutCell *SwHTMLTableLayout::GetCell( sal_uInt16 nRow, sal_uInt16 nCol ) const { - return m_aCells[nRow*m_nCols+nCol]; + return m_aCells[nRow*m_nCols+nCol].get(); } -inline void SwHTMLTableLayout::SetCell( SwHTMLTableLayoutCell *pCell, +inline void SwHTMLTableLayout::SetCell( std::unique_ptr<SwHTMLTableLayoutCell> pCell, sal_uInt16 nRow, sal_uInt16 nCol ) { - m_aCells[nRow*m_nCols+nCol] = pCell; + m_aCells[nRow*m_nCols+nCol] = std::move(pCell); } inline long SwHTMLTableLayout::GetBrowseWidthMin() const |