summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2011-05-21 18:24:08 -0430
committerJoseph Powers <jpowers27@cox.net>2011-05-22 22:52:43 -0700
commit6da3ad3fc84228effdd09221dd7d4c3a1755f8d4 (patch)
treeaa6c9a64ad393e1e7a46935f40a5da2d747e03c1
parenta78957fe6458ee5298c31ef5356fdcd6e6ea61b0 (diff)
Replace List for std::vector<String>.
-rw-r--r--sc/source/ui/view/cellsh.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 5d6c875c8..d79512886 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -735,8 +735,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
case SID_SELECT_SCENARIO:
{
- List aList;
-
+ std::vector<String> aList;
Color aDummyCol;
if ( !pDoc->IsScenario(nTab) )
@@ -750,12 +749,12 @@ void ScCellShell::GetState(SfxItemSet &rSet)
while ( pDoc->IsScenario(nScTab) )
{
pDoc->GetName( nScTab, aStr );
- aList.Insert( new String( aStr ), LIST_APPEND );
+ aList.push_back(aStr);
pDoc->GetScenarioData( nScTab, aStr, aDummyCol, nFlags );
- aList.Insert( new String( aStr ), LIST_APPEND );
+ aList.push_back(aStr);
// Protection is sal_True if both Sheet and Scenario are protected
aProtect = (bSheetProtected && (nFlags & SC_SCENARIO_PROTECT)) ? '1' : '0';
- aList.Insert( new String( aProtect), LIST_APPEND );
+ aList.push_back(aProtect);
++nScTab;
}
}
@@ -764,15 +763,11 @@ void ScCellShell::GetState(SfxItemSet &rSet)
String aComment;
sal_uInt16 nDummyFlags;
pDoc->GetScenarioData( nTab, aComment, aDummyCol, nDummyFlags );
- DBG_ASSERT( aList.Count() == 0, "List not empty!" );
- aList.Insert( new String( aComment ) );
+ DBG_ASSERT( aList.empty(), "List not empty!" );
+ aList.push_back(aComment);
}
rSet.Put( SfxStringListItem( nWhich, &aList ) );
-
- sal_uLong nCount = aList.Count();
- for ( sal_uLong i=0; i<nCount; i++ )
- delete (String*) aList.GetObject(i);
}
break;