summaryrefslogtreecommitdiff
path: root/sw/source/filter/html/htmltab.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-09 09:32:07 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-01-09 14:29:54 +0100
commita79bcb2c4615be6ef53635ed52bab0b7655a2d4a (patch)
tree8dc73ec8eaa5e998c932de752bbe9cb1adffe139 /sw/source/filter/html/htmltab.cxx
parent84392651d2731cce91c3b2e144bed4ac07e4ddf1 (diff)
doesn't have to be dynamically allocated
Change-Id: I6d66a93a8cb2b0b2cfae108cc285996e9aa9063f Reviewed-on: https://gerrit.libreoffice.org/47643 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/filter/html/htmltab.cxx')
-rw-r--r--sw/source/filter/html/htmltab.cxx31
1 files changed, 15 insertions, 16 deletions
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 1f44e0bd138c..b84f5c2fccbb 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -270,7 +270,7 @@ typedef std::vector<std::unique_ptr<HTMLTableCell>> HTMLTableCells;
class HTMLTableRow
{
- std::unique_ptr<HTMLTableCells> m_xCells; ///< cells of the row
+ HTMLTableCells m_aCells; ///< cells of the row
bool bIsEndOfGroup : 1;
@@ -756,8 +756,7 @@ std::unique_ptr<SwHTMLTableLayoutCell> HTMLTableCell::CreateLayoutInfo()
}
HTMLTableRow::HTMLTableRow(sal_uInt16 const nCells)
- : m_xCells(new HTMLTableCells),
- bIsEndOfGroup(false),
+ : bIsEndOfGroup(false),
nHeight(0),
nEmptyRows(0),
eAdjust(SvxAdjust::End),
@@ -766,10 +765,10 @@ HTMLTableRow::HTMLTableRow(sal_uInt16 const nCells)
{
for( sal_uInt16 i=0; i<nCells; i++ )
{
- m_xCells->push_back(o3tl::make_unique<HTMLTableCell>());
+ m_aCells.push_back(o3tl::make_unique<HTMLTableCell>());
}
- OSL_ENSURE(nCells == m_xCells->size(),
+ OSL_ENSURE(nCells == m_aCells.size(),
"wrong Cell count in new HTML table row");
}
@@ -781,9 +780,9 @@ inline void HTMLTableRow::SetHeight( sal_uInt16 nHght )
inline HTMLTableCell *HTMLTableRow::GetCell( sal_uInt16 nCell ) const
{
- OSL_ENSURE( nCell < m_xCells->size(),
+ OSL_ENSURE( nCell < m_aCells.size(),
"invalid cell index in HTML table row" );
- return m_xCells->at(nCell).get();
+ return m_aCells.at(nCell).get();
}
void HTMLTableRow::Expand( sal_uInt16 nCells, bool bOneCell )
@@ -791,34 +790,34 @@ void HTMLTableRow::Expand( sal_uInt16 nCells, bool bOneCell )
// This row will be filled with a single cell if bOneCell is set.
// This will only work for rows that don't allow adding cells!
- sal_uInt16 nColSpan = nCells - m_xCells->size();
- for (sal_uInt16 i = m_xCells->size(); i < nCells; ++i)
+ sal_uInt16 nColSpan = nCells - m_aCells.size();
+ for (sal_uInt16 i = m_aCells.size(); i < nCells; ++i)
{
std::unique_ptr<HTMLTableCell> pCell(new HTMLTableCell);
if( bOneCell )
pCell->SetColSpan( nColSpan );
- m_xCells->push_back(std::move(pCell));
+ m_aCells.push_back(std::move(pCell));
nColSpan--;
}
- OSL_ENSURE(nCells == m_xCells->size(),
+ OSL_ENSURE(nCells == m_aCells.size(),
"wrong Cell count in expanded HTML table row");
}
void HTMLTableRow::Shrink( sal_uInt16 nCells )
{
- OSL_ENSURE(nCells < m_xCells->size(), "number of cells too large");
+ OSL_ENSURE(nCells < m_aCells.size(), "number of cells too large");
#if OSL_DEBUG_LEVEL > 0
- sal_uInt16 const nEnd = m_xCells->size();
+ sal_uInt16 const nEnd = m_aCells.size();
#endif
// The colspan of empty cells at the end has to be fixed to the new
// number of cells.
sal_uInt16 i=nCells;
while( i )
{
- HTMLTableCell *pCell = (*m_xCells)[--i].get();
+ HTMLTableCell *pCell = m_aCells[--i].get();
if( !pCell->GetContents() )
{
#if OSL_DEBUG_LEVEL > 0
@@ -833,7 +832,7 @@ void HTMLTableRow::Shrink( sal_uInt16 nCells )
#if OSL_DEBUG_LEVEL > 0
for( i=nCells; i<nEnd; i++ )
{
- HTMLTableCell *pCell = (*m_xCells)[i].get();
+ HTMLTableCell *pCell = m_aCells[i].get();
OSL_ENSURE( pCell->GetRowSpan() == 1,
"RowSpan of to be deleted cell is wrong" );
OSL_ENSURE( pCell->GetColSpan() == nEnd - i,
@@ -842,7 +841,7 @@ void HTMLTableRow::Shrink( sal_uInt16 nCells )
}
#endif
- m_xCells->erase(m_xCells->begin() + nCells, m_xCells->end());
+ m_aCells.erase(m_aCells.begin() + nCells, m_aCells.end());
}
HTMLTableColumn::HTMLTableColumn():