diff options
author | Noel Grandin <noel@peralex.com> | 2012-04-25 12:12:51 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-04-25 12:35:35 +0200 |
commit | 11d40e46f1cfdf0532bf0612fd813d398dfd78d1 (patch) | |
tree | 7d9623cacd3553fd6881d10c141ba5fd8dbbffe5 /sw | |
parent | 36394723ac332424d4b74b69ce8d125da4c915fa (diff) |
Convert SV_DECL_PTRARR_DEL(TextBlockInfoArr) to boost::ptr_vector
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/dochdl/gloshdl.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx index 6e87f25d12e2..75dc1ea2b413 100644 --- a/sw/source/ui/dochdl/gloshdl.cxx +++ b/sw/source/ui/dochdl/gloshdl.cxx @@ -81,9 +81,7 @@ struct TextBlockInfo_Impl String sLongName; String sGroupName; }; -typedef TextBlockInfo_Impl* TextBlockInfo_ImplPtr; -SV_DECL_PTRARR_DEL( TextBlockInfoArr, TextBlockInfo_ImplPtr, 0 ) -SV_IMPL_PTRARR( TextBlockInfoArr, TextBlockInfo_ImplPtr ) +typedef boost::ptr_vector<TextBlockInfo_Impl> TextBlockInfoArr; SV_IMPL_REF( SwDocShell ) /*------------------------------------------------------------------------ @@ -466,17 +464,17 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, pData->sTitle = sTitle; pData->sLongName = sLongName; pData->sGroupName = sGroupName; - aFoundArr.Insert(pData, aFoundArr.Count()); + aFoundArr.push_back(pData); } } } } - if( aFoundArr.Count() ) // one was found + if( !aFoundArr.empty() ) // one was found { pGlossaries->PutGroupDoc(pGlossary); - if(1 == aFoundArr.Count()) + if(1 == aFoundArr.size()) { - TextBlockInfo_Impl* pData = aFoundArr.GetObject(0); + TextBlockInfo_Impl* pData = &aFoundArr.front(); pGlossary = (SwTextBlocks *)pGlossaries->GetGroupDoc(pData->sGroupName); nFound = pGlossary->GetIndex( aShortName ); } @@ -487,9 +485,9 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, AbstractSwSelGlossaryDlg* pDlg = pFact->CreateSwSelGlossaryDlg( 0, aShortName, DLG_SEL_GLOS ); OSL_ENSURE(pDlg, "Dialogdiet fail!"); - for(sal_uInt16 i = 0; i < aFoundArr.Count(); ++i) + for(sal_uInt16 i = 0; i < aFoundArr.size(); ++i) { - TextBlockInfo_Impl* pData = aFoundArr.GetObject(i); + TextBlockInfo_Impl* pData = &aFoundArr[i]; pDlg->InsertGlos(pData->sTitle, pData->sLongName); } pDlg->SelectEntryPos(0); @@ -499,7 +497,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, delete pDlg; if(LISTBOX_ENTRY_NOTFOUND != nRet) { - TextBlockInfo_Impl* pData = aFoundArr.GetObject(nRet); + TextBlockInfo_Impl* pData = &aFoundArr[nRet]; pGlossary = (SwTextBlocks *)pGlossaries->GetGroupDoc(pData->sGroupName); nFound = pGlossary->GetIndex( aShortName ); } |