1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <comphelper/processfactory.hxx>
21 #include <comphelper/types.hxx>
22 #include <vcl/msgbox.hxx>
23 #include <svx/dataaccessdescriptor.hxx>
24 #include <sfx2/viewfrm.hxx>
26 #include <com/sun/star/sdb/CommandType.hpp>
27 #include <com/sun/star/sdb/XCompletedExecution.hpp>
28 #include <com/sun/star/sdbc/XRow.hpp>
29 #include <com/sun/star/sdbc/XRowSet.hpp>
30 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
31 #include <com/sun/star/sdbcx/XRowLocate.hpp>
32 #include <com/sun/star/task/InteractionHandler.hpp>
33 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #include <com/sun/star/frame/XDispatchProvider.hpp>
36 #include <com/sun/star/frame/FrameSearchFlag.hpp>
37 #include <com/sun/star/view/XSelectionSupplier.hpp>
39 #include "dbdocfun.hxx"
41 #include "globstr.hrc"
42 #include "scerrors.hxx"
44 #include "markdata.hxx"
45 #include "undodat.hxx"
46 #include "progress.hxx"
47 #include "patattr.hxx"
48 #include "docpool.hxx"
50 #include "dbdocutl.hxx"
51 #include "editable.hxx"
53 #include "miscuno.hxx"
54 #include "chgtrack.hxx"
55 #include <refupdatecontext.hxx>
57 using namespace com::sun::star
;
59 #define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet"
61 //! move to a header file?
62 #define SC_DBPROP_DATASOURCENAME "DataSourceName"
63 #define SC_DBPROP_COMMAND "Command"
64 #define SC_DBPROP_COMMANDTYPE "CommandType"
66 void ScDBDocFunc::ShowInBeamer( const ScImportParam
& rParam
, SfxViewFrame
* pFrame
)
68 // called after opening the database beamer
70 if ( !pFrame
|| !rParam
.bImport
)
73 uno::Reference
<frame::XFrame
> xFrame
= pFrame
->GetFrame().GetFrameInterface();
74 uno::Reference
<frame::XDispatchProvider
> xDP(xFrame
, uno::UNO_QUERY
);
76 uno::Reference
<frame::XFrame
> xBeamerFrame
= xFrame
->findFrame(
78 frame::FrameSearchFlag::CHILDREN
);
79 if (xBeamerFrame
.is())
81 uno::Reference
<frame::XController
> xController
= xBeamerFrame
->getController();
82 uno::Reference
<view::XSelectionSupplier
> xControllerSelection(xController
, uno::UNO_QUERY
);
83 if (xControllerSelection
.is())
85 sal_Int32 nType
= rParam
.bSql
? sdb::CommandType::COMMAND
:
86 ( (rParam
.nType
== ScDbQuery
) ? sdb::CommandType::QUERY
:
87 sdb::CommandType::TABLE
);
89 svx::ODataAccessDescriptor aSelection
;
90 aSelection
.setDataSource(rParam
.aDBName
);
91 aSelection
[svx::daCommand
] <<= rParam
.aStatement
;
92 aSelection
[svx::daCommandType
] <<= nType
;
94 xControllerSelection
->select(uno::makeAny(aSelection
.createPropertyValueSequence()));
98 OSL_FAIL("no selection supplier in the beamer!");
103 bool ScDBDocFunc::DoImportUno( const ScAddress
& rPos
,
104 const uno::Sequence
<beans::PropertyValue
>& aArgs
)
106 svx::ODataAccessDescriptor
aDesc( aArgs
); // includes selection and result set
108 // create database range
109 ScDBData
* pDBData
= rDocShell
.GetDBData( ScRange(rPos
), SC_DB_IMPORT
, SC_DBSEL_KEEP
);
110 DBG_ASSERT(pDBData
, "can't create DB data");
111 OUString sTarget
= pDBData
->GetName();
113 UpdateImport( sTarget
, aDesc
);
118 bool ScDBDocFunc::DoImport( SCTAB nTab
, const ScImportParam
& rParam
,
119 const svx::ODataAccessDescriptor
* pDescriptor
, bool bRecord
, bool bAddrInsert
)
121 ScDocument
& rDoc
= rDocShell
.GetDocument();
122 ScChangeTrack
*pChangeTrack
= NULL
;
123 ScRange aChangedRange
;
125 if (bRecord
&& !rDoc
.IsUndoEnabled())
128 ScDBData
* pDBData
= NULL
;
131 pDBData
= rDoc
.GetDBAtArea( nTab
, rParam
.nCol1
, rParam
.nRow1
,
132 rParam
.nCol2
, rParam
.nRow2
);
135 OSL_FAIL( "DoImport: no DBData" );
140 vcl::Window
* pWaitWin
= ScDocShell::GetActiveDialogParent();
142 pWaitWin
->EnterWait();
143 ScDocShellModificator
aModificator( rDocShell
);
145 bool bSuccess
= false;
146 bool bApi
= false; //! pass as argument
147 bool bTruncated
= false; // for warning
148 sal_uInt16 nErrStringId
= 0;
149 OUString aErrorMessage
;
151 SCCOL nCol
= rParam
.nCol1
;
152 SCROW nRow
= rParam
.nRow1
;
153 SCCOL nEndCol
= nCol
; // end of resulting database area
154 SCROW nEndRow
= nRow
;
157 bool bDoSelection
= false;
158 bool bRealSelection
= false; // sal_True if not everything is selected
159 bool bBookmarkSelection
= false;
160 sal_Int32 nListPos
= 0;
161 sal_Int32 nRowsRead
= 0;
162 sal_Int32 nListCount
= 0;
164 uno::Sequence
<uno::Any
> aSelection
;
165 if ( pDescriptor
&& pDescriptor
->has(svx::daSelection
) )
167 (*pDescriptor
)[svx::daSelection
] >>= aSelection
;
168 nListCount
= aSelection
.getLength();
169 if ( nListCount
> 0 )
172 if ( pDescriptor
->has(svx::daBookmarkSelection
) )
173 bBookmarkSelection
= ScUnoHelpFunctions::GetBoolFromAny( (*pDescriptor
)[svx::daBookmarkSelection
] );
174 if ( bBookmarkSelection
)
176 // From bookmarks, there's no way to detect if all records are selected.
177 // Rely on base to pass no selection in that case.
178 bRealSelection
= true;
183 uno::Reference
<sdbc::XResultSet
> xResultSet
;
184 if ( pDescriptor
&& pDescriptor
->has(svx::daCursor
) )
185 xResultSet
.set((*pDescriptor
)[svx::daCursor
], uno::UNO_QUERY
);
187 // ImportDoc - also used for Redo
188 ScDocument
* pImportDoc
= new ScDocument( SCDOCMODE_UNDO
);
189 pImportDoc
->InitUndo( &rDoc
, nTab
, nTab
);
191 // get data from database into import document
196 // only text (title is still needed, for the cancel button)
197 ScProgress
aProgress( &rDocShell
, ScGlobal::GetRscString(STR_UNDO_IMPORTDATA
), 0 );
199 uno::Reference
<sdbc::XRowSet
> xRowSet
= uno::Reference
<sdbc::XRowSet
>(
200 xResultSet
, uno::UNO_QUERY
);
201 bool bDispose
= false;
205 xRowSet
= uno::Reference
<sdbc::XRowSet
>(
206 comphelper::getProcessServiceFactory()->createInstance(
207 OUString( SC_SERVICE_ROWSET
) ),
209 uno::Reference
<beans::XPropertySet
> xRowProp( xRowSet
, uno::UNO_QUERY
);
210 OSL_ENSURE( xRowProp
.is(), "can't get RowSet" );
214 // set source parameters
216 sal_Int32 nType
= rParam
.bSql
? sdb::CommandType::COMMAND
:
217 ( (rParam
.nType
== ScDbQuery
) ? sdb::CommandType::QUERY
:
218 sdb::CommandType::TABLE
);
221 aAny
<<= rParam
.aDBName
;
222 xRowProp
->setPropertyValue(
223 OUString(SC_DBPROP_DATASOURCENAME
), aAny
);
225 aAny
<<= rParam
.aStatement
;
226 xRowProp
->setPropertyValue(
227 OUString(SC_DBPROP_COMMAND
), aAny
);
230 xRowProp
->setPropertyValue(
231 OUString(SC_DBPROP_COMMANDTYPE
), aAny
);
233 uno::Reference
<sdb::XCompletedExecution
> xExecute( xRowSet
, uno::UNO_QUERY
);
236 uno::Reference
<task::XInteractionHandler
> xHandler(
237 task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), 0),
238 uno::UNO_QUERY_THROW
);
239 xExecute
->executeWithCompletion( xHandler
);
248 // get column descriptions
251 uno::Reference
<sdbc::XResultSetMetaData
> xMeta
;
252 uno::Reference
<sdbc::XResultSetMetaDataSupplier
> xMetaSupp( xRowSet
, uno::UNO_QUERY
);
253 if ( xMetaSupp
.is() )
254 xMeta
= xMetaSupp
->getMetaData();
256 nColCount
= xMeta
->getColumnCount(); // this is the number of real columns
258 if ( rParam
.nCol1
+ nColCount
- 1 > MAXCOL
)
264 uno::Reference
<sdbcx::XRowLocate
> xLocate
;
265 if ( bBookmarkSelection
)
267 xLocate
.set( xRowSet
, uno::UNO_QUERY
);
270 SAL_WARN( "sc.ui","can't get XRowLocate");
271 bDoSelection
= bRealSelection
= bBookmarkSelection
= false;
275 uno::Reference
<sdbc::XRow
> xRow( xRowSet
, uno::UNO_QUERY
);
276 if ( nColCount
> 0 && xRow
.is() )
278 nEndCol
= (SCCOL
)( rParam
.nCol1
+ nColCount
- 1 );
280 uno::Sequence
<sal_Int32
> aColTypes( nColCount
); // column types
281 uno::Sequence
<sal_Bool
> aColCurr( nColCount
); // currency flag is not in types
282 sal_Int32
* pTypeArr
= aColTypes
.getArray();
283 sal_Bool
* pCurrArr
= aColCurr
.getArray();
284 for (i
=0; i
<nColCount
; i
++)
286 pTypeArr
[i
] = xMeta
->getColumnType( i
+1 );
287 pCurrArr
[i
] = xMeta
->isCurrency( i
+1 );
290 if ( !bAddrInsert
) // read column names
293 for (i
=0; i
<nColCount
; i
++)
295 pImportDoc
->SetString( nCol
, nRow
, nTab
,
296 xMeta
->getColumnLabel( i
+1 ) );
304 xRowSet
->beforeFirst();
305 sal_uInt16 nInserted
= 0;
308 // skip rows that are not selected
311 if ( !(bEnd
= !xRowSet
->next()) )
316 if (nListPos
< nListCount
)
318 if ( bBookmarkSelection
)
320 bEnd
= !xLocate
->moveToBookmark(aSelection
[nListPos
]);
322 else // use record numbers
324 sal_Int32 nNextRow
= 0;
325 aSelection
[nListPos
] >>= nNextRow
;
326 if ( nRowsRead
+1 < nNextRow
)
327 bRealSelection
= true;
328 bEnd
= !xRowSet
->absolute(nRowsRead
= nNextRow
);
334 if ( !bBookmarkSelection
&& xRowSet
->next() )
335 bRealSelection
= true; // more data available but not used
342 if ( ValidRow(nRow
) )
345 for (i
=0; i
<nColCount
; i
++)
347 ScDatabaseDocUtil::PutData( pImportDoc
, nCol
, nRow
, nTab
,
348 xRow
, i
+1, pTypeArr
[i
], pCurrArr
[i
] );
357 if (!(nInserted
& 15))
359 OUString aPict
= ScGlobal::GetRscString( STR_PROGRESS_IMPORT
);
360 OUString aText
= aPict
.getToken(0,'#');
361 aText
+= OUString::number( nInserted
);
362 aText
+= aPict
.getToken(1,'#');
364 if (!aProgress
.SetStateText( 0, aText
)) // stopped by user?
368 nErrStringId
= STR_DATABASE_ABORTED
;
372 else // past the end of the spreadsheet
374 bEnd
= true; // don't continue
375 bTruncated
= true; // warning flag
384 ::comphelper::disposeComponent( xRowSet
);
387 catch ( const sdbc::SQLException
& rError
)
389 aErrorMessage
= rError
.Message
;
391 catch ( uno::Exception
& )
393 OSL_FAIL("Unexpected exception in database");
396 // test for cell protection
398 bool bKeepFormat
= !bAddrInsert
&& pDBData
->IsKeepFmt();
399 bool bMoveCells
= !bAddrInsert
&& pDBData
->IsDoSize();
400 SCCOL nFormulaCols
= 0; // columns to be filled with formulas
401 if (bMoveCells
&& nEndCol
== rParam
.nCol2
)
403 // if column count changes, formulas would become invalid anyway
404 // -> only set nFormulaCols for unchanged column count
406 SCCOL nTestCol
= rParam
.nCol2
+ 1; // right of the data
407 SCROW nTestRow
= rParam
.nRow1
+ 1; // below the title row
408 while ( nTestCol
<= MAXCOL
&&
409 rDoc
.GetCellType(ScAddress( nTestCol
, nTestRow
, nTab
)) == CELLTYPE_FORMULA
)
410 ++nTestCol
, ++nFormulaCols
;
415 // old and new range editable?
416 ScEditableTester aTester
;
417 aTester
.TestBlock( &rDoc
, nTab
, rParam
.nCol1
,rParam
.nRow1
,rParam
.nCol2
,rParam
.nRow2
);
418 aTester
.TestBlock( &rDoc
, nTab
, rParam
.nCol1
,rParam
.nRow1
,nEndCol
,nEndRow
);
419 if ( !aTester
.IsEditable() )
421 nErrStringId
= aTester
.GetMessageId();
424 else if ( (pChangeTrack
= rDoc
.GetChangeTrack()) != NULL
)
425 aChangedRange
= ScRange(rParam
.nCol1
, rParam
.nRow1
, nTab
,
426 nEndCol
+nFormulaCols
, nEndRow
, nTab
);
429 if ( bSuccess
&& bMoveCells
)
431 ScRange
aOld( rParam
.nCol1
, rParam
.nRow1
, nTab
,
432 rParam
.nCol2
+nFormulaCols
, rParam
.nRow2
, nTab
);
433 ScRange
aNew( rParam
.nCol1
, rParam
.nRow1
, nTab
,
434 nEndCol
+nFormulaCols
, nEndRow
, nTab
);
435 if (!rDoc
.CanFitBlock( aOld
, aNew
))
437 nErrStringId
= STR_MSSG_DOSUBTOTALS_2
; // can't insert cells
442 // copy data from import doc into real document
448 // keep formatting of title and first data row from the document
449 // CopyToDocument also copies styles, Apply... needs separate calls
451 SCCOL nMinEndCol
= std::min( rParam
.nCol2
, nEndCol
); // not too much
452 nMinEndCol
= sal::static_int_cast
<SCCOL
>( nMinEndCol
+ nFormulaCols
); // only if column count unchanged
453 pImportDoc
->DeleteAreaTab( 0,0, MAXCOL
,MAXROW
, nTab
, IDF_ATTRIB
);
454 rDoc
.CopyToDocument( rParam
.nCol1
, rParam
.nRow1
, nTab
,
455 nMinEndCol
, rParam
.nRow1
, nTab
,
456 IDF_ATTRIB
, false, pImportDoc
);
458 SCROW nDataStartRow
= rParam
.nRow1
+1;
459 for (SCCOL nCopyCol
=rParam
.nCol1
; nCopyCol
<=nMinEndCol
; nCopyCol
++)
461 const ScPatternAttr
* pSrcPattern
= rDoc
.GetPattern(
462 nCopyCol
, nDataStartRow
, nTab
);
463 pImportDoc
->ApplyPatternAreaTab( nCopyCol
, nDataStartRow
, nCopyCol
, nEndRow
,
464 nTab
, *pSrcPattern
);
465 const ScStyleSheet
* pStyle
= pSrcPattern
->GetStyleSheet();
467 pImportDoc
->ApplyStyleAreaTab( nCopyCol
, nDataStartRow
, nCopyCol
, nEndRow
,
472 // don't set cell protection attribute if table is protected
473 if (rDoc
.IsTabProtected(nTab
))
475 ScPatternAttr
aPattern(pImportDoc
->GetPool());
476 aPattern
.GetItemSet().Put( ScProtectionAttr( false,false,false,false ) );
477 pImportDoc
->ApplyPatternAreaTab( 0,0,MAXCOL
,MAXROW
, nTab
, aPattern
);
480 // copy old data for undo
482 SCCOL nUndoEndCol
= std::max( nEndCol
, rParam
.nCol2
); // rParam = old end
483 SCROW nUndoEndRow
= std::max( nEndRow
, rParam
.nRow2
);
485 ScDocument
* pUndoDoc
= NULL
;
486 ScDBData
* pUndoDBData
= NULL
;
489 pUndoDoc
= new ScDocument( SCDOCMODE_UNDO
);
490 pUndoDoc
->InitUndo( &rDoc
, nTab
, nTab
);
493 pUndoDBData
= new ScDBData( *pDBData
);
497 aNewMark
.SelectOneTable( nTab
);
501 // do not touch notes (ScUndoImportData does not support drawing undo)
502 InsertDeleteFlags nCopyFlags
= IDF_ALL
& ~IDF_NOTE
;
504 // nFormulaCols is set only if column count is unchanged
505 rDoc
.CopyToDocument( rParam
.nCol1
, rParam
.nRow1
, nTab
,
506 nEndCol
+nFormulaCols
, nEndRow
, nTab
,
507 nCopyFlags
, false, pUndoDoc
);
508 if ( rParam
.nCol2
> nEndCol
)
509 rDoc
.CopyToDocument( nEndCol
+1, rParam
.nRow1
, nTab
,
510 nUndoEndCol
, nUndoEndRow
, nTab
,
511 nCopyFlags
, false, pUndoDoc
);
512 if ( rParam
.nRow2
> nEndRow
)
513 rDoc
.CopyToDocument( rParam
.nCol1
, nEndRow
+1, nTab
,
514 nUndoEndCol
+nFormulaCols
, nUndoEndRow
, nTab
,
515 nCopyFlags
, false, pUndoDoc
);
522 // clear only the range without the formulas,
523 // so the formula title and first row are preserved
525 ScRange
aDelRange( rParam
.nCol1
, rParam
.nRow1
, nTab
,
526 rParam
.nCol2
, rParam
.nRow2
, nTab
);
527 rDoc
.DeleteAreaTab( aDelRange
, IDF_ALL
& ~IDF_NOTE
); // ohne die Formeln
529 ScRange
aOld( rParam
.nCol1
, rParam
.nRow1
, nTab
,
530 rParam
.nCol2
+nFormulaCols
, rParam
.nRow2
, nTab
);
531 ScRange
aNew( rParam
.nCol1
, rParam
.nRow1
, nTab
,
532 nEndCol
+nFormulaCols
, nEndRow
, nTab
);
533 rDoc
.FitBlock( aOld
, aNew
, false ); // Formeln nicht loeschen
535 else if ( nEndCol
< rParam
.nCol2
) // DeleteArea calls PutInOrder
536 rDoc
.DeleteArea( nEndCol
+1, rParam
.nRow1
, rParam
.nCol2
, rParam
.nRow2
,
537 aNewMark
, IDF_CONTENTS
& ~IDF_NOTE
);
539 // CopyToDocument doesn't remove contents
540 rDoc
.DeleteAreaTab( rParam
.nCol1
, rParam
.nRow1
, nEndCol
, nEndRow
, nTab
, IDF_CONTENTS
& ~IDF_NOTE
);
542 // remove each column from ImportDoc after copying to reduce memory usage
543 bool bOldAutoCalc
= rDoc
.GetAutoCalc();
544 rDoc
.SetAutoCalc( false ); // outside of the loop
545 for (SCCOL nCopyCol
= rParam
.nCol1
; nCopyCol
<= nEndCol
; nCopyCol
++)
547 pImportDoc
->CopyToDocument( nCopyCol
, rParam
.nRow1
, nTab
, nCopyCol
, nEndRow
, nTab
,
548 IDF_ALL
, false, &rDoc
);
549 pImportDoc
->DeleteAreaTab( nCopyCol
, rParam
.nRow1
, nCopyCol
, nEndRow
, nTab
, IDF_CONTENTS
);
551 rDoc
.SetAutoCalc( bOldAutoCalc
);
553 if (nFormulaCols
> 0) // copy formulas
555 if (bKeepFormat
) // formats for formulas
556 pImportDoc
->CopyToDocument( nEndCol
+1, rParam
.nRow1
, nTab
,
557 nEndCol
+nFormulaCols
, nEndRow
, nTab
,
558 IDF_ATTRIB
, false, &rDoc
);
561 aMark
.SelectOneTable(nTab
);
563 sal_uLong nProgCount
= nFormulaCols
;
564 nProgCount
*= nEndRow
-rParam
.nRow1
-1;
565 ScProgress
aProgress( rDoc
.GetDocumentShell(),
566 ScGlobal::GetRscString(STR_FILL_SERIES_PROGRESS
), nProgCount
);
568 rDoc
.Fill( nEndCol
+1, rParam
.nRow1
+1, nEndCol
+nFormulaCols
, rParam
.nRow1
+1,
569 &aProgress
, aMark
, nEndRow
-rParam
.nRow1
-1, FILL_TO_BOTTOM
, FILL_SIMPLE
);
572 // if new range is smaller, clear old contents
574 if (!bMoveCells
) // move has happened above
576 if ( rParam
.nCol2
> nEndCol
)
577 rDoc
.DeleteArea( nEndCol
+1, rParam
.nRow1
, rParam
.nCol2
, rParam
.nRow2
,
578 aNewMark
, IDF_CONTENTS
);
579 if ( rParam
.nRow2
> nEndRow
)
580 rDoc
.DeleteArea( rParam
.nCol1
, nEndRow
+1, rParam
.nCol2
, rParam
.nRow2
,
581 aNewMark
, IDF_CONTENTS
);
584 if( !bAddrInsert
) // update database range
586 pDBData
->SetImportParam( rParam
);
587 pDBData
->SetHeader( true );
588 pDBData
->SetByRow( true );
589 pDBData
->SetArea( nTab
, rParam
.nCol1
,rParam
.nRow1
, nEndCol
,nEndRow
);
590 pDBData
->SetImportSelection( bRealSelection
);
591 rDoc
.CompileDBFormula();
596 ScDocument
* pRedoDoc
= pImportDoc
;
599 if (nFormulaCols
> 0) // include filled formulas for redo
600 rDoc
.CopyToDocument( rParam
.nCol1
, rParam
.nRow1
, nTab
,
601 nEndCol
+nFormulaCols
, nEndRow
, nTab
,
602 IDF_ALL
& ~IDF_NOTE
, false, pRedoDoc
);
604 ScDBData
* pRedoDBData
= pDBData
? new ScDBData( *pDBData
) : NULL
;
606 rDocShell
.GetUndoManager()->AddUndoAction(
607 new ScUndoImportData( &rDocShell
, nTab
,
608 rParam
, nUndoEndCol
, nUndoEndRow
,
610 pUndoDoc
, pRedoDoc
, pUndoDBData
, pRedoDBData
) );
613 sc::SetFormulaDirtyContext aCxt
;
614 rDoc
.SetAllFormulasDirty(aCxt
);
615 rDocShell
.PostPaint(ScRange(0, 0, nTab
, MAXCOL
, MAXROW
, nTab
), PAINT_GRID
);
616 aModificator
.SetDocumentModified();
618 ScDBRangeRefreshedHint
aHint( rParam
);
619 rDoc
.BroadcastUno( aHint
);
622 pWaitWin
->LeaveWait();
624 if ( bTruncated
&& !bApi
) // show warning
625 ErrorHandler::HandleError(SCWARN_IMPORT_RANGE_OVERFLOW
);
630 pWaitWin
->LeaveWait();
632 if (aErrorMessage
.isEmpty())
635 nErrStringId
= STR_MSSG_IMPORTDATA_0
;
636 aErrorMessage
= ScGlobal::GetRscString( nErrStringId
);
638 ScopedVclPtrInstance
< InfoBox
> aInfoBox( ScDocShell::GetActiveDialogParent(), aErrorMessage
);
644 if (bSuccess
&& pChangeTrack
)
645 pChangeTrack
->AppendInsert ( aChangedRange
);
650 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */