diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-12 13:57:01 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-13 10:54:18 +0200 |
commit | 83a58be116762abeab4ec3a90b8aafa076484b4a (patch) | |
tree | b69fd3c05e992a5380d032209fe475b128270543 /sc | |
parent | 16877ccbd2dc227ab25f19914b9d453a082e405b (diff) |
sc: boost::ptr_vector->std::vector
Change-Id: If3fff7cec768be9ce4cad6064415c1739433e030
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/dif/difimp.cxx | 39 | ||||
-rw-r--r-- | sc/source/filter/inc/dif.hxx | 6 |
2 files changed, 22 insertions, 23 deletions
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx index e9775a8e7a40..1dd10d6fc16c 100644 --- a/sc/source/filter/dif/difimp.cxx +++ b/sc/source/filter/dif/difimp.cxx @@ -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!" ); diff --git a/sc/source/filter/inc/dif.hxx b/sc/source/filter/inc/dif.hxx index 2963e7d6e53e..0dd15511319d 100644 --- a/sc/source/filter/inc/dif.hxx +++ b/sc/source/filter/inc/dif.hxx @@ -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(); |