From 82ef0b6a9882621679a68c18289801979f222360 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Mon, 2 Aug 2004 15:32:08 +0000 Subject: INTEGRATION: CWS insight01 (1.14.8); FILE MERGED 2004/07/06 09:19:18 oj 1.14.8.4: RESYNC: (1.15-1.16); FILE MERGED 2004/05/28 17:03:10 oj 1.14.8.3: RESYNC: (1.14-1.15); FILE MERGED 2004/05/19 11:36:25 oj 1.14.8.2: #i19984# use rowset that was given 2004/02/20 11:28:14 oj 1.14.8.1: #i25414# extend the datadescriptor for database location and connection resource --- sc/source/ui/docshell/dbdocimp.cxx | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'sc/source/ui/docshell/dbdocimp.cxx') diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index 0b70a7cccf0b..09d6ee254907 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dbdocimp.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: obo $ $Date: 2004-06-04 11:22:51 $ + * last change: $Author: hr $ $Date: 2004-08-02 16:32:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -137,7 +137,7 @@ void ScDBDocFunc::ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFram sdb::CommandType::TABLE ); ::svx::ODataAccessDescriptor aSelection; - aSelection[svx::daDataSource] <<= rtl::OUString( rParam.aDBName ); + aSelection.setDataSource(rtl::OUString( rParam.aDBName )); aSelection[svx::daCommand] <<= rtl::OUString( rParam.aStatement ); aSelection[svx::daCommandType] <<= nType; @@ -406,29 +406,30 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, } BOOL bEnd = FALSE; - xRowSet->beforeFirst(); - while ( !bEnd && xRowSet->next() ) + if ( !bDoSelection ) + xRowSet->beforeFirst(); + while ( !bEnd ) { // skip rows that are not selected - - if (bDoSelection) + if ( !bDoSelection ) + { + if ( !(bEnd = !xRowSet->next()) ) + ++nRowsRead; + } + else { if (nListPos < nListCount) { ULONG nNextRow = (ULONG) pSelection->GetObject(nListPos); - while (nRowsRead+1 < nNextRow && !bEnd) - { + if ( nRowsRead+1 < nNextRow ) bRealSelection = TRUE; - if ( !xRowSet->next() ) - bEnd = TRUE; - ++nRowsRead; - } + bEnd = !xRowSet->absolute(nRowsRead = nNextRow); ++nListPos; } else { - bRealSelection = TRUE; // more data available but not used - bEnd = TRUE; + bRealSelection = xRowSet->next(); + bEnd = TRUE; // more data available but not used } } @@ -470,8 +471,6 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, bTruncated = TRUE; // warning flag } } - - ++nRowsRead; } bSuccess = TRUE; -- cgit