From 35854bc3ade4875f801da907d69b168b97a56101 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 10 Nov 2015 21:24:08 +0100 Subject: sw: replace boost::ptr_vector with std::vector Change-Id: I6d4c9877b4fd0147d75260570cbca6b9a6333762 --- sw/source/filter/html/htmltab.cxx | 56 ++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 987340c06b89..5e1fc096469f 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -57,8 +57,6 @@ #include "swcss1.hxx" #include -#include - #define NETSCAPE_DFLT_BORDER 1 #define NETSCAPE_DFLT_CELLSPACING 2 @@ -362,7 +360,7 @@ public: // HTML table typedef std::vector> HTMLTableRows; -typedef boost::ptr_vector HTMLTableColumns; +typedef std::vector> HTMLTableColumns; typedef std::vector SdrObjects; @@ -377,7 +375,7 @@ class HTMLTable std::vector *pDrawObjPrcWidths; // column of draw object and its rel. width HTMLTableRows *m_pRows; ///< table rows - HTMLTableColumns *pColumns; // table columns + HTMLTableColumns *m_pColumns; ///< table columns sal_uInt16 nRows; // number of rows sal_uInt16 nCols; // number of columns @@ -929,7 +927,7 @@ void HTMLTable::InitCtor( const HTMLTableOptions *pOptions ) pDrawObjPrcWidths = nullptr; m_pRows = new HTMLTableRows; - pColumns = new HTMLTableColumns; + m_pColumns = new HTMLTableColumns; nRows = 0; nCurRow = 0; nCurCol = 0; @@ -1080,7 +1078,7 @@ HTMLTable::HTMLTable( SwHTMLParser* pPars, HTMLTable *pTopTab, InitCtor( pOptions ); for( sal_uInt16 i=0; ipush_back( new HTMLTableColumn ); + m_pColumns->push_back(o3tl::make_unique()); } HTMLTable::~HTMLTable() @@ -1089,7 +1087,7 @@ HTMLTable::~HTMLTable() delete pDrawObjPrcWidths; delete m_pRows; - delete pColumns; + delete m_pColumns; delete pBGBrush; delete pInhBGBrush; @@ -1105,7 +1103,7 @@ SwHTMLTableLayout *HTMLTable::CreateLayoutInfo() sal_uInt16 nBorderWidth = GetBorderWidth( aBorderLine, true ); sal_uInt16 nLeftBorderWidth = - ((*pColumns)[0]).bLeftBorder ? GetBorderWidth( aLeftBorderLine, true ) : 0; + (*m_pColumns)[0]->bLeftBorder ? GetBorderWidth(aLeftBorderLine, true) : 0; sal_uInt16 nRightBorderWidth = bRightBorder ? GetBorderWidth( aRightBorderLine, true ) : 0; sal_uInt16 nInhLeftBorderWidth = 0; @@ -1146,7 +1144,7 @@ SwHTMLTableLayout *HTMLTable::CreateLayoutInfo() pLayoutInfo->SetExportable( bExportable ); for( i=0; iSetColumn( ((*pColumns)[i]).CreateLayoutInfo(), i ); + pLayoutInfo->SetColumn( ((*m_pColumns)[i])->CreateLayoutInfo(), i ); return pLayoutInfo; } @@ -1345,7 +1343,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox, sal_uInt32 nNumFormat = 0; double nValue = 0.0; - HTMLTableColumn *pColumn = &(*pColumns)[nCol]; + HTMLTableColumn *const pColumn = (*m_pColumns)[nCol].get(); if( pBox->GetSttNd() ) { @@ -1450,7 +1448,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox, } bSet = true; } - if( ((*pColumns)[nCol]).bLeftBorder ) + if (((*m_pColumns)[nCol])->bLeftBorder) { const SvxBorderLine& rBorderLine = 0==nCol ? aLeftBorderLine : aBorderLine; @@ -1934,7 +1932,7 @@ void HTMLTable::InheritVertBorders( const HTMLTable *pParent, GetBorderWidth( aInhRightBorderLine, true ) + MIN_BORDER_DIST; } - if( ((*pParent->pColumns)[nCol]).bLeftBorder ) + if (((*pParent->m_pColumns)[nCol])->bLeftBorder) { bInhLeftBorder = true; // erstmal nur merken aInhLeftBorderLine = 0==nCol ? pParent->aLeftBorderLine @@ -1952,7 +1950,7 @@ void HTMLTable::InheritVertBorders( const HTMLTable *pParent, bRightAlwd = ( pParent->bRightAlwd && (nCol+nColSpan==pParent->nCols || - !((*pParent->pColumns)[nCol+nColSpan]).bLeftBorder) ); + !((*pParent->m_pColumns)[nCol+nColSpan])->bLeftBorder) ); } void HTMLTable::SetBorders() @@ -1961,8 +1959,10 @@ void HTMLTable::SetBorders() for( i=1; iIsEndOfGroup())) + { + ((*m_pColumns)[i])->bLeftBorder = true; + } for( i=0; ibLeftBorder = true; + } for( i=0; iGetAdjust() : SVX_ADJUST_END ); if( SVX_ADJUST_END==eAdjust ) eAdjust = (*m_pRows)[nCurRow]->GetAdjust(); @@ -2055,7 +2057,7 @@ sal_Int16 HTMLTable::GetInheritedVertOri() const // text::VertOrientation::TOP ist der default! sal_Int16 eVOri = (*m_pRows)[nCurRow]->GetVertOri(); if( text::VertOrientation::TOP==eVOri && nCurColGetVertOri(); if( text::VertOrientation::TOP==eVOri ) eVOri = eVertOri; @@ -2086,11 +2088,11 @@ void HTMLTable::InsertCell( HTMLTableCnts *pCnts, if( nCols < nColsReq ) { for( i=nCols; ipush_back( new HTMLTableColumn ); + m_pColumns->push_back(o3tl::make_unique()); for( i=0; iExpand( nColsReq, isize() == nCols, + OSL_ENSURE(m_pColumns->size() == nCols, "wrong number of columns after expanding"); } if( nColsReq > nFilledCols ) @@ -2266,7 +2268,7 @@ inline void HTMLTable::CloseColGroup( sal_uInt16 nSpan, sal_uInt16 _nWidth, OSL_ENSURE( nCurCol<=nCols, "ungueltige Spalte" ); if( nCurCol>0 && nCurCol<=nCols ) - ((*pColumns)[nCurCol-1]).SetEndOfGroup(); + ((*m_pColumns)[nCurCol-1])->SetEndOfGroup(); } void HTMLTable::InsertCol( sal_uInt16 nSpan, sal_uInt16 nColWidth, bool bRelWidth, @@ -2286,7 +2288,7 @@ void HTMLTable::InsertCol( sal_uInt16 nSpan, sal_uInt16 nColWidth, bool bRelWidt if( nCols < nColsReq ) { for( i=nCols; ipush_back( new HTMLTableColumn ); + m_pColumns->push_back(o3tl::make_unique()); nCols = nColsReq; } @@ -2299,7 +2301,7 @@ void HTMLTable::InsertCol( sal_uInt16 nSpan, sal_uInt16 nColWidth, bool bRelWidt for( i=nCurCol; iSetWidth( nTmp, bRelWidth ); pCol->SetAdjust( eAdjust ); @@ -2338,7 +2340,7 @@ void HTMLTable::CloseTable() // falls die Tabelle keine Spalte hat, muessen wir eine hinzufuegen if( 0==nCols ) { - pColumns->push_back( new HTMLTableColumn ); + m_pColumns->push_back(o3tl::make_unique()); for( i=0; iExpand(1); nCols = 1; @@ -2355,7 +2357,7 @@ void HTMLTable::CloseTable() if( nFilledCols < nCols ) { - pColumns->erase( pColumns->begin() + nFilledCols, pColumns->begin() + nCols ); + m_pColumns->erase(m_pColumns->begin() + nFilledCols, m_pColumns->begin() + nCols); for( i=0; iShrink( nFilledCols ); nCols = nFilledCols; @@ -2462,11 +2464,11 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail, } if( pLayoutInfo->GetRelLeftFill() == 0 && - !((*pColumns)[0]).bLeftBorder && + !((*m_pColumns)[0])->bLeftBorder && bInhLeftBorder ) { // ggf. rechte Umrandung von auesserer Tabelle uebernehmen - ((*pColumns)[0]).bLeftBorder = true; + ((*m_pColumns)[0])->bLeftBorder = true; aLeftBorderLine = aInhLeftBorderLine; } } -- cgit