summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2011-06-03 19:37:52 -0430
committerPetr Mladek <pmladek@suse.cz>2011-06-09 21:40:06 +0200
commitbb694eb1405684cb73c36e01c528f16e07ba488a (patch)
tree340bd1ac199230831005b608fe658c45f38a0501
parent174773e150e9feb88221ce4ccc372bb188cc59b4 (diff)
Replace List with std::vector<String>.
-rw-r--r--sc/inc/scabstdlg.hxx2
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx4
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx2
-rw-r--r--sc/source/ui/inc/lbseldlg.hxx2
-rw-r--r--sc/source/ui/miscdlgs/lbseldlg.cxx11
-rw-r--r--sc/source/ui/view/cellsh2.cxx11
6 files changed, 11 insertions, 21 deletions
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index 2e17107fb..01d8d3123 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -394,7 +394,7 @@ public:
sal_uInt16 nResId,
const String& aTitle,
const String& aLbTitle,
- List& aEntryList,
+ const std::vector<String> &rEntryList,
int nId ) = 0;
virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg ( Window* pParent, int nId) = 0; //add for ScLinkedAreaDlg
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index faf0f29c1..8d2e54ea1 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1062,14 +1062,14 @@ AbstractScSelEntryDlg * ScAbstractDialogFactory_Impl::CreateScSelEntryDlg ( Wind
sal_uInt16 nResId,
const String& aTitle,
const String& aLbTitle,
- List& aEntryList,
+ const std::vector<String> &rEntryList,
int nId )
{
ScSelEntryDlg * pDlg=NULL;
switch ( nId )
{
case RID_SCDLG_SELECTDB :
- pDlg = new ScSelEntryDlg( pParent, nResId,aTitle, aLbTitle, aEntryList );
+ pDlg = new ScSelEntryDlg( pParent, nResId,aTitle, aLbTitle, rEntryList );
break;
default:
break;
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 9ee357599..b8090b493 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -476,7 +476,7 @@ public:
sal_uInt16 nResId,
const String& aTitle,
const String& aLbTitle,
- List& aEntryList,
+ const std::vector<String> &rEntryList,
int nId );
virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg ( Window* pParent, //add for ScLinkedAreaDlg
diff --git a/sc/source/ui/inc/lbseldlg.hxx b/sc/source/ui/inc/lbseldlg.hxx
index ff07478de..58d3f512c 100644
--- a/sc/source/ui/inc/lbseldlg.hxx
+++ b/sc/source/ui/inc/lbseldlg.hxx
@@ -56,7 +56,7 @@ public:
sal_uInt16 nResId,
const String& aTitle,
const String& aLbTitle,
- List& aEntryList );
+ const std::vector<String> &rEntryList );
~ScSelEntryDlg();
String GetSelectEntry() const;
diff --git a/sc/source/ui/miscdlgs/lbseldlg.cxx b/sc/source/ui/miscdlgs/lbseldlg.cxx
index 291449d1c..fca6b1868 100644
--- a/sc/source/ui/miscdlgs/lbseldlg.cxx
+++ b/sc/source/ui/miscdlgs/lbseldlg.cxx
@@ -48,7 +48,7 @@ ScSelEntryDlg::ScSelEntryDlg( Window* pParent,
sal_uInt16 nResId,
const String& aTitle,
const String& aLbTitle,
- List& aEntryList ) :
+ const std::vector<String> &rEntryList ) :
ModalDialog ( pParent, ScResId( nResId ) ),
//
aFlLbTitle ( this, ScResId( FL_ENTRYLIST ) ),
@@ -62,12 +62,9 @@ ScSelEntryDlg::ScSelEntryDlg( Window* pParent,
aLb.Clear();
aLb.SetDoubleClickHdl( LINK( this, ScSelEntryDlg, DblClkHdl ) );
- void* pListEntry = aEntryList.First();
- while ( pListEntry )
- {
- aLb.InsertEntry( *((String*)pListEntry ) );
- pListEntry = aEntryList.Next();
- }
+ std::vector<String>::const_iterator pIter;
+ for ( pIter = rEntryList.begin(); pIter != rEntryList.end(); ++pIter )
+ aLb.InsertEntry(*pIter);
if ( aLb.GetEntryCount() > 0 )
aLb.SelectEntryPos( 0 );
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index baaccaf6b..dbec2f968 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -723,11 +723,11 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if ( pDBCol )
{
- List aList;
+ std::vector<String> aList;
const ScDBCollection::NamedDBs& rDBs = pDBCol->getNamedDBs();
ScDBCollection::NamedDBs::const_iterator itr = rDBs.begin(), itrEnd = rDBs.end();
for (; itr != itrEnd; ++itr)
- aList.Insert(new String(itr->GetName()));
+ aList.push_back(itr->GetName());
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
@@ -748,13 +748,6 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
}
delete pDlg;
-
- void* pEntry = aList.First();
- while ( pEntry )
- {
- delete (String*) aList.Remove( pEntry );
- pEntry = aList.Next();
- }
}
}
}