diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2011-06-03 21:52:10 -0430 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2011-06-09 21:49:46 +0200 |
commit | 95ae7d1d059d32beaaf316bb0f14d89182041c41 (patch) | |
tree | 6916abfa4c695a71f21340faabda50c3d15d95c9 | |
parent | aba7233bc7aba525d850a57e4fef3c2a12fa5f69 (diff) |
Replace SbaSelectionList with std::vector<sal_Int32>.
Remove SbaSelectionList and SV_DECL_IMPL_REF(SbaSelectionList).
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocimp.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/inc/dbdocfun.hxx | 16 |
4 files changed, 13 insertions, 25 deletions
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 67d17a15e187..5cc9e778574d 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1456,7 +1456,7 @@ void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName, const String& rTableName, const String& rStatement, bool bNative, sal_uInt8 nType, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& xResultSet, - const SbaSelectionList* pSelection ) + const std::vector<sal_Int32> *pSelection ) { // Target ist jetzt einfach der Bereichsname diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index 1fb2bd39b6ab..88a1a54abb72 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -170,13 +170,13 @@ bool ScDBDocFunc::DoImportUno( const ScAddress& rPos, } } - SbaSelectionList aList; + std::vector<sal_Int32> aList; long nSelLen = aSelection.getLength(); for (i = 0; i < nSelLen; i++) { sal_Int32 nEntry = 0; if ( aSelection[i] >>= nEntry ) - aList.Insert( (void*)(sal_IntPtr)nEntry, LIST_APPEND ); + aList.push_back( nEntry ); } bool bAddrInsert = false; //!??? @@ -213,7 +213,7 @@ bool ScDBDocFunc::DoImportUno( const ScAddress& rPos, bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, const uno::Reference< sdbc::XResultSet >& xResultSet, - const SbaSelectionList* pSelection, bool bRecord, bool bAddrInsert ) + const std::vector<sal_Int32> *pSelection, bool bRecord, bool bAddrInsert ) { ScDocument* pDoc = rDocShell.GetDocument(); ScChangeTrack *pChangeTrack = NULL; @@ -258,10 +258,10 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, sal_uLong nListCount = 0; // -1 is special - if ( pSelection && pSelection->Count() && (long)pSelection->GetObject(0) != -1L ) + if ( !pSelection->empty() && (*pSelection)[0] != -1 ) { bDoSelection = sal_True; - nListCount = pSelection->Count(); + nListCount = pSelection->size(); } // ImportDoc - also used for Redo @@ -390,7 +390,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, { if (nListPos < nListCount) { - sal_uLong nNextRow = (sal_uLong) pSelection->GetObject(nListPos); + sal_uInt32 nNextRow = (*pSelection)[nListPos]; if ( nRowsRead+1 < nNextRow ) bRealSelection = sal_True; bEnd = !xRowSet->absolute(nRowsRead = nNextRow); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 6688b027eb8a..9a99fdc6ff41 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -229,7 +229,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) if ( sTabFlag.EqualsAscii("0") ) // "0" = Query, "1" = Table (Default) nType = ScDbQuery; - SbaSelectionListRef pSelectionList = new SbaSelectionList; + std::vector<sal_Int32> aSelectionList; xub_StrLen nCount = sSbaData.GetTokenCount(cSbaSep); for (xub_StrLen i = 4; i < nCount; i++) @@ -237,8 +237,8 @@ void ScDocShell::Execute( SfxRequest& rReq ) String aSelItem = sSbaData.GetToken(i,cSbaSep); if (aSelItem.Len()) { - sal_uIntPtr nValue = aSelItem.ToInt32(); - pSelectionList->Insert( (void*)nValue, LIST_APPEND ); + sal_uInt32 nValue = aSelItem.ToInt32(); + aSelectionList.push_back(nValue); } } @@ -283,7 +283,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) { ScDBDocFunc(*this).UpdateImport( sTarget, sDBName, sDBTable, sDBSql, true, nType, xResultSet, - pSelectionList ); + &aSelectionList ); rReq.Done(); // UpdateImport aktualisiert auch die internen Operationen diff --git a/sc/source/ui/inc/dbdocfun.hxx b/sc/source/ui/inc/dbdocfun.hxx index 4f338f4ae0c5..ac0ed5865437 100644 --- a/sc/source/ui/inc/dbdocfun.hxx +++ b/sc/source/ui/inc/dbdocfun.hxx @@ -57,18 +57,6 @@ namespace com { namespace sun { namespace star { } } } } -// --------------------------------------------------------------------------- -// ----------------------------------------------------------------- -class SbaSelectionList: public List , public SvRefBase -{ -public: - SbaSelectionList(): - List(CONTAINER_MAXBLOCKSIZE,100,100){} -}; - -SV_DECL_IMPL_REF(SbaSelectionList) - - class ScDBDocFunc { friend class ScDBFunc; @@ -85,11 +73,11 @@ public: bool bNative, sal_uInt8 nType, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& xResultSet, - const SbaSelectionList* pSelection ); + const std::vector<sal_Int32> *pSelection ); bool DoImport( SCTAB nTab, const ScImportParam& rParam, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& xResultSet, - const SbaSelectionList* pSelection, bool bRecord, + const std::vector<sal_Int32> *pSelection, bool bRecord, bool bAddrInsert = false ); bool DoImportUno( const ScAddress& rPos, |