Kaydet (Commit) 05d46a4a authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert SV_DECL_PTRARR(SwTOXMarks) to std::vector

Change-Id: Idffc8a90fcd4ada856339fc0be3e4a11478db6cc
üst 36387c8c
......@@ -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
......
......@@ -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 &&
......
......@@ -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())
......
......@@ -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();
}
}
......
......@@ -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);
......
......@@ -313,7 +313,7 @@ public:
Description: inlines
--------------------------------------------------------------------*/
inline sal_uInt16 SwTOXMgr::GetTOXMarkCount()
{ return aCurMarks.Count(); }
{ return aCurMarks.size(); }
inline SwTOXMark* SwTOXMgr::GetCurTOXMark()
{ return pCurTOXMark; }
......
......@@ -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,
......
......@@ -222,7 +222,7 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet)
{
SwTOXMarks aArr;
rSh.GetCurTOXMarks( aArr );
if( !aArr.Count())
if( aArr.empty())
bEnableEdit = sal_False;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment