diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-05-12 16:26:26 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-05-13 22:54:10 -0400 |
commit | f55cc330dec0dec60c755e2ce28a840c7fca1956 (patch) | |
tree | 33c1d0a7870858072e1a7afff4b20d2d59500220 /sc/source/ui/view/cellsh2.cxx | |
parent | fb7bd1f00b269501e98cdb60ab342cc384a233e4 (diff) |
Fixed the fallout of the changes in ScDBCollection.
Diffstat (limited to 'sc/source/ui/view/cellsh2.cxx')
-rw-r--r-- | sc/source/ui/view/cellsh2.cxx | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 092c04271082..01034544d87f 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -723,26 +723,11 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) if ( pDBCol ) { - const String aStrNoName( RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME) ); - List aList; - sal_uInt16 nDBCount = pDBCol->GetCount(); - ScDBData* pDbData = NULL; - String* pDBName = NULL; - - for ( sal_uInt16 i=0; i < nDBCount; i++ ) - { - pDbData = (ScDBData*)(pDBCol->At( i )); - if ( pDbData ) - { - pDBName = new String; - *pDBName = pDbData->GetName(); - - if ( *pDBName != aStrNoName ) - aList.Insert( pDBName ); - else - DELETEZ(pDBName); - } - } + List 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())); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "ScAbstractFactory create fail!"); |