Kaydet (Commit) 4a42b727 authored tarafından Rafael Dominguez's avatar Rafael Dominguez Kaydeden (comit) Petr Mladek

Replace List with std::vector<String>.

üst 6372a90a
......@@ -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
......
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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();
}
}
}
}
......
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