summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docsh8.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/docshell/docsh8.cxx')
-rw-r--r--sc/source/ui/docshell/docsh8.cxx25
1 files changed, 9 insertions, 16 deletions
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 93101e802651..675f9ea109c0 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -251,6 +251,7 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
{
sal_uLong nErr = eERR_OK;
long i;
+ long nColCount = 0;
try
{
@@ -262,14 +263,7 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
return nRet;
::utl::DisposableComponent aConnectionHelper(xConnection);
- long nRowCount = 0;
- if ( nRowCount < 0 )
- {
- DBG_ERROR("can't get row count");
- nRowCount = 0;
- }
-
- ScProgress aProgress( this, ScGlobal::GetRscString( STR_LOAD_DOC ), nRowCount );
+ ScProgress aProgress( this, ScGlobal::GetRscString( STR_LOAD_DOC ), 0 );
uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
uno::Reference<sdbc::XRowSet> xRowSet( xFactory->createInstance(
rtl::OUString::createFromAscii( SC_SERVICE_ROWSET ) ),
@@ -296,7 +290,6 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
xRowSet->execute();
- long nColCount = 0;
uno::Reference<sdbc::XResultSetMetaData> xMeta;
uno::Reference<sdbc::XResultSetMetaDataSupplier> xMetaSupp( xRowSet, uno::UNO_QUERY );
if ( xMetaSupp.is() )
@@ -310,10 +303,6 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
nErr = SCWARN_IMPORT_RANGE_OVERFLOW; // warning
}
- if ( nColCount > 0 )
- aDocument.DoColResize( 0, 0, static_cast<SCCOL>(nColCount) - 1,
- static_cast<SCSIZE>(nRowCount) + 1 );
-
uno::Reference<sdbc::XRow> xRow( xRowSet, uno::UNO_QUERY );
DBG_ASSERT( xRow.is(), "can't get Row" );
if (!xRow.is()) return SCERR_IMPORT_CONNECT;
@@ -327,6 +316,9 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
// read column names
//! add type descriptions
+ aProgress.SetState( 0 );
+ ScColumn::bDoubleAlloc = sal_True; // row count isn't readily available in advance
+
for (i=0; i<nColCount; i++)
{
String aHeader = xMeta->getColumnLabel( i+1 );
@@ -384,9 +376,6 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
bEnd = sal_True; // don't continue
nErr = SCWARN_IMPORT_RANGE_OVERFLOW; // warning message
}
-
- if ( nRowCount )
- aProgress.SetStateOnPercent( nRow );
}
}
catch ( sdbc::SQLException& )
@@ -399,6 +388,10 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
nErr = ERRCODE_IO_GENERAL;
}
+ ScColumn::bDoubleAlloc = sal_False;
+ if ( nColCount > 0 )
+ aDocument.DoColResize( 0, 0, static_cast<SCCOL>(nColCount) - 1, 0 );
+
return nErr;
}