Kaydet (Commit) 83a58be1 authored tarafından Noel Grandin's avatar Noel Grandin

sc: boost::ptr_vector->std::vector

Change-Id: If3fff7cec768be9ce4cad6064415c1739433e030
üst 16877ccb
......@@ -807,7 +807,7 @@ bool DifParser::ScanFloatVal( const sal_Unicode* pStart )
}
DifColumn::DifColumn ()
: pAkt(nullptr)
: mpAkt(nullptr)
{
}
......@@ -815,23 +815,22 @@ void DifColumn::SetLogical( SCROW nRow )
{
OSL_ENSURE( ValidRow(nRow), "*DifColumn::SetLogical(): Row too big!" );
if( pAkt )
if( mpAkt )
{
OSL_ENSURE( nRow > 0, "*DifColumn::SetLogical(): more cannot be zero!" );
nRow--;
if( pAkt->nEnd == nRow )
pAkt->nEnd++;
if( mpAkt->nEnd == nRow )
mpAkt->nEnd++;
else
pAkt = nullptr;
mpAkt = nullptr;
}
else
{
pAkt = new ENTRY;
pAkt->nStart = pAkt->nEnd = nRow;
aEntries.push_back(pAkt);
maEntries.push_back(ENTRY());
mpAkt = &maEntries.back();
mpAkt->nStart = mpAkt->nEnd = nRow;
}
}
......@@ -841,15 +840,15 @@ void DifColumn::SetNumFormat( SCROW nRow, const sal_uInt32 nNumFormat )
if( nNumFormat > 0 )
{
if(pAkt)
if(mpAkt)
{
OSL_ENSURE( nRow > 0,
"*DifColumn::SetNumFormat(): more cannot be zero!" );
OSL_ENSURE( nRow > pAkt->nEnd,
OSL_ENSURE( nRow > mpAkt->nEnd,
"*DifColumn::SetNumFormat(): start from scratch?" );
if( pAkt->nNumFormat == nNumFormat && pAkt->nEnd == nRow - 1 )
pAkt->nEnd = nRow;
if( mpAkt->nNumFormat == nNumFormat && mpAkt->nEnd == nRow - 1 )
mpAkt->nEnd = nRow;
else
NewEntry( nRow, nNumFormat );
}
......@@ -857,21 +856,21 @@ void DifColumn::SetNumFormat( SCROW nRow, const sal_uInt32 nNumFormat )
NewEntry(nRow,nNumFormat );
}
else
pAkt = nullptr;
mpAkt = nullptr;
}
void DifColumn::NewEntry( const SCROW nPos, const sal_uInt32 nNumFormat )
{
pAkt = new ENTRY;
pAkt->nStart = pAkt->nEnd = nPos;
pAkt->nNumFormat = nNumFormat;
maEntries.push_back(ENTRY());
mpAkt = &maEntries.back();
mpAkt->nStart = mpAkt->nEnd = nPos;
mpAkt->nNumFormat = nNumFormat;
aEntries.push_back(pAkt);
}
void DifColumn::Apply( ScDocument& rDoc, const SCCOL nCol, const SCTAB nTab, const ScPatternAttr& rPattAttr )
{
for (boost::ptr_vector<ENTRY>::const_iterator it = aEntries.begin(); it != aEntries.end(); ++it)
for (std::vector<ENTRY>::const_iterator it = maEntries.begin(); it != maEntries.end(); ++it)
rDoc.ApplyPatternAreaTab( nCol, it->nStart, nCol, it->nEnd, nTab, rPattAttr );
}
......@@ -880,7 +879,7 @@ void DifColumn::Apply( ScDocument& rDoc, const SCCOL nCol, const SCTAB nTab )
ScPatternAttr aAttr( rDoc.GetPool() );
SfxItemSet &rItemSet = aAttr.GetItemSet();
for (boost::ptr_vector<ENTRY>::const_iterator it = aEntries.begin(); it != aEntries.end(); ++it)
for (std::vector<ENTRY>::const_iterator it = maEntries.begin(); it != maEntries.end(); ++it)
{
OSL_ENSURE( it->nNumFormat > 0,
"+DifColumn::Apply(): Number format must not be 0!" );
......
......@@ -20,7 +20,7 @@
#ifndef INCLUDED_SC_SOURCE_FILTER_INC_DIF_HXX
#define INCLUDED_SC_SOURCE_FILTER_INC_DIF_HXX
#include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
#include <rtl/ustring.hxx>
......@@ -153,8 +153,8 @@ class DifColumn
SCROW nEnd;
};
ENTRY *pAkt;
boost::ptr_vector<ENTRY> aEntries;
ENTRY *mpAkt;
std::vector<ENTRY> maEntries;
DifColumn();
......
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