diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-15 18:49:54 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-20 19:46:40 +0200 |
commit | 05d46a4a5afc447ece8e4297b1a9b8e9e9b99b90 (patch) | |
tree | 2d1c751cf3b3dfeadde859db4c77070fca2a4a80 /sw | |
parent | 36387c8c793b969a3146904c650ef8a3d7fdc531 (diff) |
Convert SV_DECL_PTRARR(SwTOXMarks) to std::vector
Change-Id: Idffc8a90fcd4ada856339fc0be3e4a11478db6cc
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/tox.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/doctxm.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/edit/edtox.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/tox/tox.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unoidx.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/inc/toxmgr.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/index/toxmgr.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/shells/textidx.cxx | 2 |
8 files changed, 15 insertions, 17 deletions
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index 171ce842f6a2..229d9d3ec61a 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -57,7 +57,7 @@ class SwTOXMark; class SwTxtTOXMark; class SwDoc; -SV_DECL_PTRARR(SwTOXMarks, SwTOXMark*, 0) +class SwTOXMarks : public std::vector<SwTOXMark*> {}; /*-------------------------------------------------------------------- Description: Entry of content index, alphabetical index or user defined index diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index ffeb89cdcc4b..60a6e92c0e45 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -159,10 +159,10 @@ sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos, // the attributes are sorted by Start! break; - const SwTOXMark* pTMark = &pHt->GetTOXMark(); - rArr.Insert( pTMark, rArr.Count() ); + SwTOXMark* pTMark = (SwTOXMark*) &pHt->GetTOXMark(); + rArr.push_back( pTMark ); } - return rArr.Count(); + return rArr.size(); } /*-------------------------------------------------------------------- @@ -253,7 +253,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark, const SwTOXMark* pTOXMark; const SwCntntFrm* pCFrm; Point aPt; - for( sal_Int32 nMark=0; nMark<aMarks.Count(); nMark++ ) + for( sal_Int32 nMark=0; nMark<(sal_Int32)aMarks.size(); nMark++ ) { pTOXMark = aMarks[nMark]; if( pTOXMark != &rCurTOXMark && diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index 0e5edc1bdd04..f09b5e01af95 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -329,7 +329,7 @@ void SwEditShell::ApplyAutoMark() SwTOXMarks aMarks; SwTOXMark::InsertTOXMarks( aMarks, *pTOXType ); - for( sal_uInt16 nMark=0; nMark<aMarks.Count(); nMark++ ) + for( sal_uInt16 nMark=0; nMark<aMarks.size(); nMark++ ) { SwTOXMark* pMark = aMarks[nMark]; if(pMark->IsAutoGenerated() && pMark->GetTxtTOXMark()) diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 6a638c16e06a..c802c3aaee82 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -69,8 +69,6 @@ sal_uInt8 SwForm::nFormChapterMarkLen = 3; sal_uInt8 SwForm::nFormTextLen = 3; sal_uInt8 SwForm::nFormAuthLen = 5; -SV_IMPL_PTRARR(SwTOXMarks, SwTOXMark*) - TYPEINIT2( SwTOXMark, SfxPoolItem, SwClient ); // fuers rtti struct PatternIni @@ -263,7 +261,7 @@ void SwTOXMark::InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType ) while( pMark ) { if(pMark->GetTxtTOXMark()) - aMarks.C40_INSERT(SwTOXMark, pMark, aMarks.Count()); + aMarks.push_back(pMark); pMark = aIter.Next(); } } diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index c36ed8377d1c..b1fae476f182 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -1188,11 +1188,11 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, SwTOXMarks aMarks; const SwTOXType* pType = pTOXBase->GetTOXType(); SwTOXMark::InsertTOXMarks( aMarks, *pType ); - uno::Sequence< uno::Reference<text::XDocumentIndexMark> > aXMarks(aMarks.Count()); + uno::Sequence< uno::Reference<text::XDocumentIndexMark> > aXMarks(aMarks.size()); uno::Reference<text::XDocumentIndexMark>* pxMarks = aXMarks.getArray(); - for(sal_uInt16 i = 0; i < aMarks.Count(); i++) + for(sal_uInt16 i = 0; i < aMarks.size(); i++) { - SwTOXMark* pMark = aMarks.GetObject(i); + SwTOXMark* pMark = aMarks[i]; pxMarks[i] = SwXDocumentIndexMark::CreateXDocumentIndexMark( *m_pImpl->m_pDoc, *const_cast<SwTOXType*>(pType), *pMark); diff --git a/sw/source/ui/inc/toxmgr.hxx b/sw/source/ui/inc/toxmgr.hxx index 87eb6100a21f..3163109d47ba 100644 --- a/sw/source/ui/inc/toxmgr.hxx +++ b/sw/source/ui/inc/toxmgr.hxx @@ -313,7 +313,7 @@ public: Description: inlines --------------------------------------------------------------------*/ inline sal_uInt16 SwTOXMgr::GetTOXMarkCount() - { return aCurMarks.Count(); } + { return aCurMarks.size(); } inline SwTOXMark* SwTOXMgr::GetCurTOXMark() { return pCurTOXMark; } diff --git a/sw/source/ui/index/toxmgr.cxx b/sw/source/ui/index/toxmgr.cxx index 038345387bdc..7ef2bd18f4df 100644 --- a/sw/source/ui/index/toxmgr.cxx +++ b/sw/source/ui/index/toxmgr.cxx @@ -63,7 +63,7 @@ sal_uInt16 SwTOXMgr::GetTOXMarks() SwTOXMark* SwTOXMgr::GetTOXMark(sal_uInt16 nId) { - if(aCurMarks.Count() > 0) + if(!aCurMarks.empty()) return aCurMarks[nId]; return 0; } @@ -204,7 +204,7 @@ void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc) else { SwTOXMark aCpy( *pCurTOXMark ); - aCurMarks.Remove(0, aCurMarks.Count()); + aCurMarks.clear(); pSh->DeleteTOXMark(pCurTOXMark); aCpy.SetAlternativeText( *rDesc.GetAltStr() ); pSh->SwEditShell::Insert( aCpy ); @@ -283,7 +283,7 @@ const SwTOXType* SwTOXMgr::GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const void SwTOXMgr::SetCurTOXMark(sal_uInt16 nId) { - pCurTOXMark = (nId < aCurMarks.Count()) ? aCurMarks[nId] : 0; + pCurTOXMark = (nId < aCurMarks.size()) ? aCurMarks[nId] : 0; } sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc, diff --git a/sw/source/ui/shells/textidx.cxx b/sw/source/ui/shells/textidx.cxx index 614cffd3ed55..e45bffabe438 100644 --- a/sw/source/ui/shells/textidx.cxx +++ b/sw/source/ui/shells/textidx.cxx @@ -222,7 +222,7 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet) { SwTOXMarks aArr; rSh.GetCurTOXMarks( aArr ); - if( !aArr.Count()) + if( aArr.empty()) bEnableEdit = sal_False; } |