summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2012-01-11 23:54:28 -0500
committerAugust Sodora <augsod@gmail.com>2012-01-11 23:54:28 -0500
commit5c445208a184fb88d8de0855be279e98d54dfad1 (patch)
tree607fc3a668cfa8194b6db1186e255180e69a7ca0 /sfx2/source/dialog
parent17964c4f5a3aa25099b62db0e7652905cdf051a1 (diff)
SvStringsDtor->std::vector
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r--sfx2/source/dialog/templdlg.cxx24
1 files changed, 11 insertions, 13 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 4e60a8689bbe..1c51c408b845 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1320,7 +1320,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
SfxStyleSheetBase *pStyle = pStyleSheetPool->First();
SvLBoxEntry* pEntry = aFmtLb.First();
- SvStringsDtor aStrings;
+ std::vector<rtl::OUString> aStrings;
comphelper::string::NaturalStringSorter aSorter(
::comphelper::getProcessComponentContext(),
@@ -1329,21 +1329,19 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
while( pStyle )
{
//Bubblesort
- sal_uInt16 nPos;
- for( nPos = aStrings.Count() ; nPos &&
- aSorter.compare(*(aStrings[nPos-1]), pStyle->GetName()) > 0 ; nPos--)
+ size_t nPos;
+ for(nPos = aStrings.size(); nPos && aSorter.compare(aStrings[nPos-1], pStyle->GetName()) > 0; --nPos)
{};
- aStrings.Insert( new String( pStyle->GetName() ), nPos );
+ aStrings.insert(aStrings.begin() + nPos, pStyle->GetName());
pStyle = pStyleSheetPool->Next();
}
-
- sal_uInt16 nCount = aStrings.Count();
- sal_uInt16 nPos = 0;
- while( nPos < nCount && pEntry &&
- *aStrings[ nPos ] == aFmtLb.GetEntryText( pEntry ) )
+ size_t nCount = aStrings.size();
+ size_t nPos = 0;
+ while(nPos < nCount && pEntry &&
+ aStrings[nPos] == rtl::OUString(aFmtLb.GetEntryText(pEntry)))
{
- nPos++;
+ ++nPos;
pEntry = aFmtLb.Next( pEntry );
}
@@ -1353,8 +1351,8 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
aFmtLb.SetUpdateMode(sal_False);
aFmtLb.Clear();
- for(nPos = 0 ; nPos < nCount ; ++nPos )
- aFmtLb.InsertEntry( *aStrings.GetObject( nPos ), 0, sal_False, nPos);
+ for(nPos = 0; nPos < nCount; ++nPos)
+ aFmtLb.InsertEntry(aStrings[nPos], 0, sal_False, nPos);
aFmtLb.SetUpdateMode(true);
}