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: ...@@ -394,7 +394,7 @@ public:
sal_uInt16 nResId, sal_uInt16 nResId,
const String& aTitle, const String& aTitle,
const String& aLbTitle, const String& aLbTitle,
List& aEntryList, const std::vector<String> &rEntryList,
int nId ) = 0; int nId ) = 0;
virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg ( Window* pParent, int nId) = 0; //add for ScLinkedAreaDlg virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg ( Window* pParent, int nId) = 0; //add for ScLinkedAreaDlg
......
...@@ -1062,14 +1062,14 @@ AbstractScSelEntryDlg * ScAbstractDialogFactory_Impl::CreateScSelEntryDlg ( Wind ...@@ -1062,14 +1062,14 @@ AbstractScSelEntryDlg * ScAbstractDialogFactory_Impl::CreateScSelEntryDlg ( Wind
sal_uInt16 nResId, sal_uInt16 nResId,
const String& aTitle, const String& aTitle,
const String& aLbTitle, const String& aLbTitle,
List& aEntryList, const std::vector<String> &rEntryList,
int nId ) int nId )
{ {
ScSelEntryDlg * pDlg=NULL; ScSelEntryDlg * pDlg=NULL;
switch ( nId ) switch ( nId )
{ {
case RID_SCDLG_SELECTDB : case RID_SCDLG_SELECTDB :
pDlg = new ScSelEntryDlg( pParent, nResId,aTitle, aLbTitle, aEntryList ); pDlg = new ScSelEntryDlg( pParent, nResId,aTitle, aLbTitle, rEntryList );
break; break;
default: default:
break; break;
......
...@@ -476,7 +476,7 @@ public: ...@@ -476,7 +476,7 @@ public:
sal_uInt16 nResId, sal_uInt16 nResId,
const String& aTitle, const String& aTitle,
const String& aLbTitle, const String& aLbTitle,
List& aEntryList, const std::vector<String> &rEntryList,
int nId ); int nId );
virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg ( Window* pParent, //add for ScLinkedAreaDlg virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg ( Window* pParent, //add for ScLinkedAreaDlg
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
sal_uInt16 nResId, sal_uInt16 nResId,
const String& aTitle, const String& aTitle,
const String& aLbTitle, const String& aLbTitle,
List& aEntryList ); const std::vector<String> &rEntryList );
~ScSelEntryDlg(); ~ScSelEntryDlg();
String GetSelectEntry() const; String GetSelectEntry() const;
......
...@@ -48,7 +48,7 @@ ScSelEntryDlg::ScSelEntryDlg( Window* pParent, ...@@ -48,7 +48,7 @@ ScSelEntryDlg::ScSelEntryDlg( Window* pParent,
sal_uInt16 nResId, sal_uInt16 nResId,
const String& aTitle, const String& aTitle,
const String& aLbTitle, const String& aLbTitle,
List& aEntryList ) : const std::vector<String> &rEntryList ) :
ModalDialog ( pParent, ScResId( nResId ) ), ModalDialog ( pParent, ScResId( nResId ) ),
// //
aFlLbTitle ( this, ScResId( FL_ENTRYLIST ) ), aFlLbTitle ( this, ScResId( FL_ENTRYLIST ) ),
...@@ -62,12 +62,9 @@ ScSelEntryDlg::ScSelEntryDlg( Window* pParent, ...@@ -62,12 +62,9 @@ ScSelEntryDlg::ScSelEntryDlg( Window* pParent,
aLb.Clear(); aLb.Clear();
aLb.SetDoubleClickHdl( LINK( this, ScSelEntryDlg, DblClkHdl ) ); aLb.SetDoubleClickHdl( LINK( this, ScSelEntryDlg, DblClkHdl ) );
void* pListEntry = aEntryList.First(); std::vector<String>::const_iterator pIter;
while ( pListEntry ) for ( pIter = rEntryList.begin(); pIter != rEntryList.end(); ++pIter )
{ aLb.InsertEntry(*pIter);
aLb.InsertEntry( *((String*)pListEntry ) );
pListEntry = aEntryList.Next();
}
if ( aLb.GetEntryCount() > 0 ) if ( aLb.GetEntryCount() > 0 )
aLb.SelectEntryPos( 0 ); aLb.SelectEntryPos( 0 );
......
...@@ -723,11 +723,11 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) ...@@ -723,11 +723,11 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if ( pDBCol ) if ( pDBCol )
{ {
List aList; std::vector<String> aList;
const ScDBCollection::NamedDBs& rDBs = pDBCol->getNamedDBs(); const ScDBCollection::NamedDBs& rDBs = pDBCol->getNamedDBs();
ScDBCollection::NamedDBs::const_iterator itr = rDBs.begin(), itrEnd = rDBs.end(); ScDBCollection::NamedDBs::const_iterator itr = rDBs.begin(), itrEnd = rDBs.end();
for (; itr != itrEnd; ++itr) for (; itr != itrEnd; ++itr)
aList.Insert(new String(itr->GetName())); aList.push_back(itr->GetName());
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
...@@ -748,13 +748,6 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) ...@@ -748,13 +748,6 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
} }
delete pDlg; 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