Kaydet (Commit) 637b9d4f authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert SV_DECL_PTRARR_SORT_DEL(SwWriteTableRows) to o3tl::sorted_vector

Change-Id: I1731eae553e1bc47cbb01d47622b047693a6a194
üst 4991bd87
......@@ -589,9 +589,9 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
// Wert fuer FRAME bestimmen
sal_uInt16 nFrameMask = 15;
if( !(aRows[0])->bTopBorder )
if( !(aRows.front())->bTopBorder )
nFrameMask &= ~1;
if( !(aRows[aRows.Count()-1])->bBottomBorder )
if( !(aRows.back())->bBottomBorder )
nFrameMask &= ~2;
if( !(aCols.front())->bLeftBorder )
nFrameMask &= ~4;
......@@ -602,7 +602,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
sal_Bool bRowsHaveBorder = sal_False;
sal_Bool bRowsHaveBorderOnly = sal_True;
SwWriteTableRow *pRow = aRows[0];
for( nRow=1; nRow < aRows.Count(); nRow++ )
for( nRow=1; nRow < aRows.size(); nRow++ )
{
SwWriteTableRow *pNextRow = aRows[nRow];
sal_Bool bBorder = ( pRow->bBottomBorder || pNextRow->bTopBorder );
......@@ -841,7 +841,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
// Zeile nur ausgegeben werden, wenn unter der Zeile eine Linie ist
if( bTHead &&
(bTSections || bColGroups) &&
nHeadEndRow<aRows.Count()-1 && !aRows[nHeadEndRow]->bBottomBorder )
nHeadEndRow<aRows.size()-1 && !aRows[nHeadEndRow]->bBottomBorder )
bTHead = sal_False;
// <TBODY> aus ausgeben, wenn <THEAD> ausgegeben wird.
......@@ -856,12 +856,12 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
rWrt.IncIndentLevel(); // Inhalt von <THEAD>/<TDATA> einr.
}
for( nRow = 0; nRow < aRows.Count(); nRow++ )
for( nRow = 0; nRow < aRows.size(); nRow++ )
{
const SwWriteTableRow *pRow2 = aRows[nRow];
OutTableCells( rWrt, pRow2->GetCells(), pRow2->GetBackground() );
if( !nCellSpacing && nRow < aRows.Count()-1 && pRow2->bBottomBorder &&
if( !nCellSpacing && nRow < aRows.size()-1 && pRow2->bBottomBorder &&
pRow2->nBottomBorder > DEF_LINE_WIDTH_1 )
{
sal_uInt16 nCnt = (pRow2->nBottomBorder / DEF_LINE_WIDTH_1) - 1;
......@@ -876,7 +876,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
}
if( ( (bTHead && nRow==nHeadEndRow) ||
(bTBody && pRow2->bBottomBorder) ) &&
nRow < aRows.Count()-1 )
nRow < aRows.size()-1 )
{
rWrt.DecIndentLevel(); // Inhalt von <THEAD>/<TDATA> einr.
rWrt.OutNewLine(); // </THEAD>/</TDATA> in neue Zeile
......
......@@ -30,7 +30,6 @@
#include <tools/solar.h>
#include <tools/color.hxx>
#include <svl/svarray.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
#include <o3tl/sorted_vector.hxx>
......@@ -173,8 +172,10 @@ inline int SwWriteTableRow::operator<( const SwWriteTableRow& rRow ) const
return nPos < rRow.nPos - (mbUseLayoutHeights ? 0 : ROWFUZZY);
}
typedef SwWriteTableRow *SwWriteTableRowPtr;
SV_DECL_PTRARR_SORT_DEL( SwWriteTableRows, SwWriteTableRowPtr, 5 )
class SwWriteTableRows : public o3tl::sorted_vector<SwWriteTableRow*, o3tl::less_ptr_to<SwWriteTableRow> > {
public:
~SwWriteTableRows() { DeleteAndDestroyAll(); }
};
//-----------------------------------------------------------------------
......
......@@ -41,8 +41,6 @@
using ::editeng::SvxBorderLine;
using namespace ::com::sun::star;
SV_IMPL_OP_PTRARR_SORT( SwWriteTableRows, SwWriteTableRowPtr )
//-----------------------------------------------------------------------
sal_Int16 SwWriteTableCell::GetVertOri() const
......@@ -269,7 +267,7 @@ sal_uInt16 SwWriteTable::MergeBoxBorders( const SwTableBox *pBox,
if( rBoxItem.GetBottom() )
{
nBorderMask |= 2;
MergeBorders( rBoxItem.GetBottom(), nRow+nRowSpan==aRows.Count() );
MergeBorders( rBoxItem.GetBottom(), nRow+nRowSpan==aRows.size() );
rBottomBorder = rBoxItem.GetBottom()->GetOutWidth();
}
......@@ -396,7 +394,7 @@ long SwWriteTable::GetAbsHeight( long nRawHeight, sal_uInt16 nRow,
}
// In der letzten Zeile noch die Liniendicke abziehen
if( nRow+nRowSpan==aRows.Count() )
if( nRow+nRowSpan==aRows.size() )
{
if( !pRow || nRowSpan > 1 )
pRow = aRows[nRow+nRowSpan-1];
......@@ -452,11 +450,8 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
nRPos += nLineHeight;
}
SwWriteTableRow *pRow = new SwWriteTableRow( nRPos, bUseLayoutHeights);
sal_uInt16 nRow;
if( aRows.Seek_Entry( pRow, &nRow ) )
if( !aRows.insert( pRow ).second )
delete pRow;
else
aRows.Insert( pRow );
}
else
{
......@@ -465,9 +460,8 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
#endif
nRPos = nStartRPos + nParentLineHeight;
#if OSL_DEBUG_LEVEL > 0
SwWriteTableRow aRow( nStartRPos + nParentLineHeight, bUseLayoutHeights );
OSL_ENSURE( aRows.Seek_Entry(&aRow),
"Parent-Zeile nicht gefunden" );
SwWriteTableRow aSrchRow( nRPos, bUseLayoutHeights );
OSL_ENSURE( aRows.find( &aSrchRow ) != aRows.end(), "Parent-Zeile nicht gefunden" );
SwWriteTableRow aRowCheckPos(nCheckPos,bUseLayoutHeights);
SwWriteTableRow aRowRPos(nRPos,bUseLayoutHeights);
OSL_ENSURE( !bUseLayoutHeights ||
......@@ -584,10 +578,10 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
// Und ihren Index
sal_uInt16 nOldRow = nRow;
SwWriteTableRow aRow( nRPos,bUseLayoutHeights );
bool const bFound = aRows.Seek_Entry( &aRow, &nRow );
OSL_ENSURE( bFound, "missing row" );
(void) bFound; // unused in non-debug
SwWriteTableRow aSrchRow( nRPos,bUseLayoutHeights );
SwWriteTableRows::const_iterator it2 = aRows.find( &aSrchRow );
OSL_ENSURE( it2 != aRows.end(), "missing row" );
nRow = it2 - aRows.begin();
OSL_ENSURE( nOldRow <= nRow, "Don't look back!" );
if( nOldRow > nRow )
......@@ -818,7 +812,7 @@ SwWriteTable::SwWriteTable( const SwHTMLTableLayout *pLayoutInfo )
new SwWriteTableRow( (nRow+1)*ROW_DFLT_HEIGHT, bUseLayoutHeights );
pRow->nTopBorder = 0;
pRow->nBottomBorder = 0;
aRows.Insert( pRow );
aRows.insert( pRow );
}
// Und jetzt mit leben fuellen
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment