summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-15 18:49:54 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-20 19:46:40 +0200
commit05d46a4a5afc447ece8e4297b1a9b8e9e9b99b90 (patch)
tree2d1c751cf3b3dfeadde859db4c77070fca2a4a80 /sw/source
parent36387c8c793b969a3146904c650ef8a3d7fdc531 (diff)
Convert SV_DECL_PTRARR(SwTOXMarks) to std::vector
Change-Id: Idffc8a90fcd4ada856339fc0be3e4a11478db6cc
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/doc/doctxm.cxx8
-rw-r--r--sw/source/core/edit/edtox.cxx2
-rw-r--r--sw/source/core/tox/tox.cxx4
-rw-r--r--sw/source/core/unocore/unoidx.cxx6
-rw-r--r--sw/source/ui/inc/toxmgr.hxx2
-rw-r--r--sw/source/ui/index/toxmgr.cxx6
-rw-r--r--sw/source/ui/shells/textidx.cxx2
7 files changed, 14 insertions, 16 deletions
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;
}