summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-21 16:51:43 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-25 20:13:15 +0200
commitdfd96d4f6c4726f466ca62bc4a925086f69228dc (patch)
tree09c6e5f58b81b84f4b0244501cc4d11048b4bcf9
parent6c634b5565fac86e6be6fb65171d848d561f7d58 (diff)
Convert aTOXArr member from Svptrarr to std::vector
Change-Id: Ifc7ac28a99c642aac61f898cc65cdfbb0ba170a9
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx3
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx2
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx13
3 files changed, 10 insertions, 8 deletions
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 204c019e9fd7..4ba4538938c1 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2821,8 +2821,7 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )
pOutFmtNode = 0;
pEscher = 0;
pRedlAuthors = 0;
- if ( aTOXArr.Count() )
- aTOXArr.Remove( 0, aTOXArr.Count() );
+ aTOXArr.clear();
if ( !pOLEExp )
{
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index ad4f831c480c..830aebeb254e 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -450,7 +450,7 @@ public:
std::vector<sal_uLong> maChapterFieldLocs;
typedef std::vector<sal_uLong>::const_iterator mycCFIter;
String aMainStg;
- SvPtrarr aTOXArr;
+ std::vector<const SwTOXType*> aTOXArr;
const SfxItemSet* pISet; // fuer Doppel-Attribute
WW8_WrPct* pPiece; // Pointer auf Piece-Table
SwNumRuleTbl* pUsedNumTbl; // alle used NumRules
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 13550a3817f6..c87d9a7626b4 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1942,11 +1942,14 @@ void WW8Export::EndCommentOutput(const String& rName)
sal_uInt16 MSWordExportBase::GetId( const SwTOXType& rTOXType )
{
- void* p = (void*)&rTOXType;
- sal_uInt16 nRet = aTOXArr.GetPos( p );
- if( USHRT_MAX == nRet )
- aTOXArr.Insert( p, nRet = aTOXArr.Count() );
- return nRet;
+ std::vector<const SwTOXType*>::iterator it
+ = std::find( aTOXArr.begin(), aTOXArr.end(), &rTOXType );
+ if ( it != aTOXArr.end() )
+ {
+ return it - aTOXArr.begin();
+ }
+ aTOXArr.push_back( &rTOXType );
+ return aTOXArr.size() - 1;
}
// return values: 1 - no PageNum,