summaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-21 16:37:26 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-25 20:13:15 +0200
commit6c634b5565fac86e6be6fb65171d848d561f7d58 (patch)
tree7547a5f64504ab6fb1e412541d56244888207ce3 /sw
parentConvert aChrTxtAtrArr from Svptrarr to std::vector (diff)
downloadcore-6c634b5565fac86e6be6fb65171d848d561f7d58.tar.gz
core-6c634b5565fac86e6be6fb65171d848d561f7d58.zip
Convert aCntnt member from Svptrar to std::vector
Change-Id: I2150102701a650037173bd8497007aad05ee1439
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx9
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx11
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx11
3 files changed, 16 insertions, 15 deletions
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index afd9306c4a4d..54154a840cde 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -780,8 +780,7 @@ bool WW8_WrPlcTxtBoxes::WriteTxt( WW8Export& rWrt )
void WW8_WrPlcTxtBoxes::Append( const SdrObject& rObj, sal_uInt32 nShapeId )
{
- void* p = (void*)&rObj;
- aCntnt.Insert( p, aCntnt.Count() );
+ aCntnt.push_back( &rObj );
aShapeIds.push_back( nShapeId );
}
@@ -2564,8 +2563,7 @@ sal_Int32 SwEscherEx::WriteFlyFrm(const DrawObj &rObj, sal_uInt32 &rShapeId,
rShapeId = GetFlyShapeId(rFmt, rObj.mnHdFtIndex, rPVec);
if( !nOff )
{
- void* p = (void*)pObj;
- nTxtId = pTxtBxs->GetPos( p );
+ nTxtId = pTxtBxs->GetPos( pObj );
if( USHRT_MAX == nTxtId )
{
pTxtBxs->Append( *pObj, rShapeId );
@@ -2577,8 +2575,7 @@ sal_Int32 SwEscherEx::WriteFlyFrm(const DrawObj &rObj, sal_uInt32 &rShapeId,
else
{
const SdrObject* pPrevObj = pFmt->FindRealSdrObject();
- void* p = (void*)pPrevObj;
- nTxtId = pTxtBxs->GetPos( p );
+ nTxtId = pTxtBxs->GetPos( pPrevObj );
if( USHRT_MAX == nTxtId )
{
sal_uInt32 nPrevShapeId =
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index d31d291bef05..ac6c51493894 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1919,8 +1919,7 @@ WW8_WrPlcSubDoc::~WW8_WrPlcSubDoc()
void WW8_WrPlcFtnEdn::Append( WW8_CP nCp, const SwFmtFtn& rFtn )
{
aCps.push_back( nCp );
- void* p = (void*)&rFtn;
- aCntnt.Insert( p, aCntnt.Count() );
+ aCntnt.push_back( &rFtn );
}
WW8_Annotation::WW8_Annotation(const SwPostItField* pPostIt)
@@ -1948,7 +1947,7 @@ void WW8_WrPlcAnnotations::Append( WW8_CP nCp, const SwPostItField *pPostIt )
{
aCps.push_back( nCp );
WW8_Annotation* p = new WW8_Annotation(pPostIt);
- aCntnt.Insert( p, aCntnt.Count() );
+ aCntnt.push_back( p );
}
void WW8_WrPlcAnnotations::Append( WW8_CP nCp, const SwRedlineData *pRedline )
@@ -1956,7 +1955,7 @@ void WW8_WrPlcAnnotations::Append( WW8_CP nCp, const SwRedlineData *pRedline )
maProcessedRedlines.insert(pRedline);
aCps.push_back( nCp );
WW8_Annotation* p = new WW8_Annotation(pRedline);
- aCntnt.Insert( p, aCntnt.Count() );
+ aCntnt.push_back( p );
}
bool WW8_WrPlcAnnotations::IsNewRedlineComment( const SwRedlineData *pRedline )
@@ -1966,14 +1965,14 @@ bool WW8_WrPlcAnnotations::IsNewRedlineComment( const SwRedlineData *pRedline )
WW8_WrPlcAnnotations::~WW8_WrPlcAnnotations()
{
- for( sal_uInt16 n=0; n < aCntnt.Count(); n++ )
+ for( sal_uInt16 n=0; n < aCntnt.size(); n++ )
delete (WW8_Annotation*)aCntnt[n];
}
bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp,
WW8_CP& rCount )
{
- sal_uInt16 nLen = aCntnt.Count();
+ sal_uInt16 nLen = aCntnt.size();
if ( !nLen )
return false;
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 4d9e36c5e7a9..ad4f831c480c 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -1137,7 +1137,7 @@ private:
WW8_WrPlcSubDoc& operator=(const WW8_WrPlcSubDoc&);
protected:
std::vector<WW8_CP> aCps;
- SvPtrarr aCntnt; // PTRARR von SwFmtFtn/PostIts/..
+ std::vector<const void*> aCntnt; // PTRARR von SwFmtFtn/PostIts/..
WW8_WrPlc0* pTxtPos; // Pos der einzelnen Texte
WW8_WrPlcSubDoc();
@@ -1212,8 +1212,13 @@ public:
bool WriteTxt( WW8Export& rWrt );
void WritePlc( WW8Export& rWrt ) const;
void Append( const SdrObject& rObj, sal_uInt32 nShapeId );
- sal_uInt16 Count() const { return aCntnt.Count(); }
- sal_uInt16 GetPos( const VoidPtr& p ) const { return aCntnt.GetPos( p ); }
+ sal_uInt16 Count() const { return aCntnt.size(); }
+ sal_uInt16 GetPos( const void* p ) const
+ {
+ std::vector<const void*>::const_iterator it
+ = std::find( aCntnt.begin(), aCntnt.end(), p );
+ return it == aCntnt.end() ? USHRT_MAX : it - aCntnt.begin();
+ }
};
// Plc fuer Chpx und Papx ( incl PN-Plc )