summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/dbdocimp.cxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-08-23 15:04:32 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-08-23 15:04:32 +0200
commitc9ac7489ec5fd4652f0cff09722561ba5a27bcda (patch)
treee9fb41b01f699d5a4202e719d5dc7e087fa701c1 /sc/source/ui/docshell/dbdocimp.cxx
parent69bb367315288b644439dc46d34743a2575a3527 (diff)
recreated tag libreoffice-3.3.0.4 which had these commits:
commit 5e369f0d3b306be13606c1558ecf7d0aac0048f4 (tag: refs/tags/libreoffice-3.3.0.4) Author: Petr Mladek <pmladek@suse.cz> Date: Tue Jan 18 19:01:15 2011 +0100 Version 3.3.0.4, tag libreoffice-3.3.0.4 (3.3-rc4) commit 2df81fdef39f29be15dc0a6e12031916de963f08 Author: Kohei Yoshida <kyoshida@novell.com> Date: Thu Jan 13 11:18:07 2011 -0500 Reverting the merge commit 0fe55349b05fae496a86a3fa958d184f0453916c. I created a patch between before and after the merge commit, and reverse-applied it. This is because if you revert a merge commit in git you are denying all future merges from that branch. I wasn't sure if we really wanted that. Signed-off-by: Petr Mladek <pmladek@suse.cz> sc/inc/document.hxx | 22 +------ sc/inc/drwlayer.hxx | 2 +- sc/inc/table.hxx | 16 +----- sc/source/core/data/document.cxx | 7 +-- sc/source/core/data/drwlayer.cxx | 6 +- sc/source/core/data/table1.cxx | 38 ++++-------- sc/source/core/data/table2.cxx | 91 ++++++------------------------ sc/source/core/data/table3.cxx | 71 +---------------------- sc/source/filter/xml/xmlrowi.cxx | 17 +---- sc/source/ui/docshell/externalrefmgr.cxx | 7 +- sc/source/ui/view/dbfunc.cxx | 5 +- sc/source/ui/view/tabvwshe.cxx | 4 +- 12 files changed, 52 insertions(+), 234 deletions(-) commit 9ce94f52e8c404a5e19154d38c18a44281d961f0 Author: Kohei Yoshida <kyoshida@novell.com> Date: Thu Jan 13 11:04:14 2011 -0500 Revert "This is also part of the merge." This reverts commit 0fe55349b05fae496a86a3fa958d184f0453916c. Signed-off-by: Petr Mladek <pmladek@suse.cz> sc/source/core/data/table3.cxx | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) commit 1e03f54cc4f8939867869a3570f56d0645b515f5 Author: Petr Mladek <pmladek@suse.cz> Date: Tue Jan 11 22:59:36 2011 +0100 Branch libreoffice-3-3-0 This is 'libreoffice-3-3-0' - the stable branch for the 3.3.0 release. Only very safe changes, reviewed by three people are allowed. If you want to commit more complicated fix for the next 3.3.x release, please use the 'libreoffice-3-3' branch. If you want to build something cool, unstable, and risky, use master.
Notes
Notes: split repo tag: calc_libreoffice-3.3.0.4
Diffstat (limited to 'sc/source/ui/docshell/dbdocimp.cxx')
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx132
1 files changed, 66 insertions, 66 deletions
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 8400f1ad8b6f..b992d595d0ea 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -70,20 +70,20 @@
using namespace com::sun::star;
-#define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet"
-#define SC_SERVICE_INTHANDLER "com.sun.star.task.InteractionHandler"
+#define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet"
+#define SC_SERVICE_INTHANDLER "com.sun.star.task.InteractionHandler"
-//! move to a header file?
-#define SC_DBPROP_DATASOURCENAME "DataSourceName"
-#define SC_DBPROP_COMMAND "Command"
-#define SC_DBPROP_COMMANDTYPE "CommandType"
-#define SC_DBPROP_SELECTION "Selection"
-#define SC_DBPROP_CURSOR "Cursor"
+//! move to a header file?
+#define SC_DBPROP_DATASOURCENAME "DataSourceName"
+#define SC_DBPROP_COMMAND "Command"
+#define SC_DBPROP_COMMANDTYPE "CommandType"
+#define SC_DBPROP_SELECTION "Selection"
+#define SC_DBPROP_CURSOR "Cursor"
// static
void ScDBDocFunc::ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFrame )
{
- // called after opening the database beamer
+ // called after opening the database beamer
if ( !pFrame || !rParam.bImport )
return;
@@ -181,21 +181,21 @@ BOOL ScDBDocFunc::DoImportUno( const ScAddress& rPos,
aList.Insert( (void*)nEntry, LIST_APPEND );
}
- BOOL bAddrInsert = FALSE; //!???
+ BOOL bAddrInsert = FALSE; //!???
if ( bAddrInsert )
{
bDone = DoImport( rPos.Tab(), aImParam, xResSet, &aList, TRUE, bAddrInsert );
}
else
{
- // create database range
- //! merge this with SID_SBA_IMPORT execute in docsh4.cxx
+ // create database range
+ //! merge this with SID_SBA_IMPORT execute in docsh4.cxx
ScDBData* pDBData = rDocShell.GetDBData( ScRange(rPos), SC_DB_IMPORT, SC_DBSEL_KEEP );
DBG_ASSERT(pDBData, "can't create DB data");
String sTarget = pDBData->GetName();
- //! change UpdateImport to use only one of rTableName, rStatement
+ //! change UpdateImport to use only one of rTableName, rStatement
String aTableName, aStatement;
if ( aImParam.bSql )
@@ -242,24 +242,24 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
ScDocShellModificator aModificator( rDocShell );
BOOL bSuccess = FALSE;
- BOOL bApi = FALSE; //! pass as argument
- BOOL bTruncated = FALSE; // for warning
+ BOOL bApi = FALSE; //! pass as argument
+ BOOL bTruncated = FALSE; // for warning
USHORT nErrStringId = 0;
String aErrorMessage;
SCCOL nCol = rParam.nCol1;
SCROW nRow = rParam.nRow1;
- SCCOL nEndCol = nCol; // end of resulting database area
+ SCCOL nEndCol = nCol; // end of resulting database area
SCROW nEndRow = nRow;
long i;
BOOL bDoSelection = FALSE;
- BOOL bRealSelection = FALSE; // TRUE if not everything is selected
+ BOOL bRealSelection = FALSE; // TRUE if not everything is selected
ULONG nListPos = 0;
ULONG nRowsRead = 0;
ULONG nListCount = 0;
- // -1 is special
+ // -1 is special
if ( pSelection && pSelection->Count() && (long)pSelection->GetObject(0) != -1L )
{
bDoSelection = TRUE;
@@ -272,13 +272,13 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
ScColumn::DoubleAllocSwitch aAllocSwitch(true);
//
- // get data from database into import document
+ // get data from database into import document
//
try
{
- // progress bar
- // only text (title is still needed, for the cancel button)
+ // progress bar
+ // only text (title is still needed, for the cancel button)
ScProgress aProgress( &rDocShell, ScGlobal::GetRscString(STR_UNDO_IMPORTDATA), 0 );
USHORT nInserted = 0;
@@ -297,7 +297,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if ( xRowProp.is() )
{
//
- // set source parameters
+ // set source parameters
//
sal_Int32 nType = rParam.bSql ? sdb::CommandType::COMMAND :
@@ -333,7 +333,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if ( xRowSet.is() )
{
//
- // get column descriptions
+ // get column descriptions
//
long nColCount = 0;
@@ -342,12 +342,12 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if ( xMetaSupp.is() )
xMeta = xMetaSupp->getMetaData();
if ( xMeta.is() )
- nColCount = xMeta->getColumnCount(); // this is the number of real columns
+ nColCount = xMeta->getColumnCount(); // this is the number of real columns
if ( rParam.nCol1 + nColCount - 1 > MAXCOL )
{
nColCount = 0;
- //! error message
+ //! error message
}
uno::Reference<sdbc::XRow> xRow( xRowSet, uno::UNO_QUERY );
@@ -355,8 +355,8 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
{
nEndCol = (SCCOL)( rParam.nCol1 + nColCount - 1 );
- uno::Sequence<sal_Int32> aColTypes( nColCount ); // column types
- uno::Sequence<sal_Bool> aColCurr( nColCount ); // currency flag is not in types
+ uno::Sequence<sal_Int32> aColTypes( nColCount ); // column types
+ uno::Sequence<sal_Bool> aColCurr( nColCount ); // currency flag is not in types
sal_Int32* pTypeArr = aColTypes.getArray();
sal_Bool* pCurrArr = aColCurr.getArray();
for (i=0; i<nColCount; i++)
@@ -365,7 +365,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
pCurrArr[i] = xMeta->isCurrency( i+1 );
}
- if ( !bAddrInsert ) // read column names
+ if ( !bAddrInsert ) // read column names
{
nCol = rParam.nCol1;
for (i=0; i<nColCount; i++)
@@ -382,7 +382,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
xRowSet->beforeFirst();
while ( !bEnd )
{
- // skip rows that are not selected
+ // skip rows that are not selected
if ( !bDoSelection )
{
if ( (bEnd = !xRowSet->next()) == FALSE )
@@ -419,7 +419,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
nEndRow = nRow;
++nRow;
- // progress bar
+ // progress bar
++nInserted;
if (!(nInserted & 15))
@@ -429,7 +429,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
aText += String::CreateFromInt32( nInserted );
aText += aPict.GetToken(1,'#');
- if (!aProgress.SetStateText( 0, aText )) // stopped by user?
+ if (!aProgress.SetStateText( 0, aText )) // stopped by user?
{
bEnd = TRUE;
bSuccess = FALSE;
@@ -437,10 +437,10 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
}
}
}
- else // past the end of the spreadsheet
+ else // past the end of the spreadsheet
{
- bEnd = TRUE; // don't continue
- bTruncated = TRUE; // warning flag
+ bEnd = TRUE; // don't continue
+ bTruncated = TRUE; // warning flag
}
}
}
@@ -464,19 +464,19 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
pImportDoc->DoColResize( nTab, rParam.nCol1,nEndCol, 0 );
//
- // test for cell protection
+ // test for cell protection
//
BOOL bKeepFormat = !bAddrInsert && pDBData->IsKeepFmt();
BOOL bMoveCells = !bAddrInsert && pDBData->IsDoSize();
- SCCOL nFormulaCols = 0; // columns to be filled with formulas
+ SCCOL nFormulaCols = 0; // columns to be filled with formulas
if (bMoveCells && nEndCol == rParam.nCol2)
{
- // if column count changes, formulas would become invalid anyway
- // -> only set nFormulaCols for unchanged column count
+ // if column count changes, formulas would become invalid anyway
+ // -> only set nFormulaCols for unchanged column count
- SCCOL nTestCol = rParam.nCol2 + 1; // right of the data
- SCROW nTestRow = rParam.nRow1 + 1; // below the title row
+ SCCOL nTestCol = rParam.nCol2 + 1; // right of the data
+ SCROW nTestRow = rParam.nRow1 + 1; // below the title row
while ( nTestCol <= MAXCOL &&
pDoc->GetCellType(ScAddress( nTestCol, nTestRow, nTab )) == CELLTYPE_FORMULA )
++nTestCol, ++nFormulaCols;
@@ -484,7 +484,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (bSuccess)
{
- // old and new range editable?
+ // old and new range editable?
ScEditableTester aTester;
aTester.TestBlock( pDoc, nTab, rParam.nCol1,rParam.nRow1,rParam.nCol2,rParam.nRow2 );
aTester.TestBlock( pDoc, nTab, rParam.nCol1,rParam.nRow1,nEndCol,nEndRow );
@@ -506,23 +506,23 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
nEndCol+nFormulaCols, nEndRow, nTab );
if (!pDoc->CanFitBlock( aOld, aNew ))
{
- nErrStringId = STR_MSSG_DOSUBTOTALS_2; // can't insert cells
+ nErrStringId = STR_MSSG_DOSUBTOTALS_2; // can't insert cells
bSuccess = FALSE;
}
}
//
- // copy data from import doc into real document
+ // copy data from import doc into real document
//
if ( bSuccess )
{
if (bKeepFormat)
{
- // keep formatting of title and first data row from the document
- // CopyToDocument also copies styles, Apply... needs separate calls
+ // keep formatting of title and first data row from the document
+ // CopyToDocument also copies styles, Apply... needs separate calls
- SCCOL nMinEndCol = Min( rParam.nCol2, nEndCol ); // not too much
+ SCCOL nMinEndCol = Min( rParam.nCol2, nEndCol ); // not too much
nMinEndCol = sal::static_int_cast<SCCOL>( nMinEndCol + nFormulaCols ); // only if column count unchanged
pImportDoc->DeleteAreaTab( 0,0, MAXCOL,MAXROW, nTab, IDF_ATTRIB );
pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
@@ -543,7 +543,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
}
}
- // don't set cell protection attribute if table is protected
+ // don't set cell protection attribute if table is protected
if (pDoc->IsTabProtected(nTab))
{
ScPatternAttr aPattern(pImportDoc->GetPool());
@@ -552,10 +552,10 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
}
//
- // copy old data for undo
+ // copy old data for undo
//
- SCCOL nUndoEndCol = Max( nEndCol, rParam.nCol2 ); // rParam = old end
+ SCCOL nUndoEndCol = Max( nEndCol, rParam.nCol2 ); // rParam = old end
SCROW nUndoEndRow = Max( nEndRow, rParam.nRow2 );
ScDocument* pUndoDoc = NULL;
@@ -577,7 +577,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
// do not touch notes (ScUndoImportData does not support drawing undo)
sal_uInt16 nCopyFlags = IDF_ALL & ~IDF_NOTE;
- // nFormulaCols is set only if column count is unchanged
+ // nFormulaCols is set only if column count is unchanged
pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
nCopyFlags, FALSE, pUndoDoc );
@@ -592,13 +592,13 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
}
//
- // move new data
+ // move new data
//
if (bMoveCells)
{
- // clear only the range without the formulas,
- // so the formula title and first row are preserved
+ // clear only the range without the formulas,
+ // so the formula title and first row are preserved
ScRange aDelRange( rParam.nCol1, rParam.nRow1, nTab,
rParam.nCol2, rParam.nRow2, nTab );
@@ -608,18 +608,18 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
rParam.nCol2+nFormulaCols, rParam.nRow2, nTab );
ScRange aNew( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab );
- pDoc->FitBlock( aOld, aNew, FALSE ); // Formeln nicht loeschen
+ pDoc->FitBlock( aOld, aNew, FALSE ); // Formeln nicht loeschen
}
- else if ( nEndCol < rParam.nCol2 ) // DeleteArea calls PutInOrder
+ else if ( nEndCol < rParam.nCol2 ) // DeleteArea calls PutInOrder
pDoc->DeleteArea( nEndCol+1, rParam.nRow1, rParam.nCol2, rParam.nRow2,
aNewMark, IDF_CONTENTS & ~IDF_NOTE );
- // CopyToDocument doesn't remove contents
+ // CopyToDocument doesn't remove contents
pDoc->DeleteAreaTab( rParam.nCol1, rParam.nRow1, nEndCol, nEndRow, nTab, IDF_CONTENTS & ~IDF_NOTE );
- // #41216# remove each column from ImportDoc after copying to reduce memory usage
+ // #41216# remove each column from ImportDoc after copying to reduce memory usage
BOOL bOldAutoCalc = pDoc->GetAutoCalc();
- pDoc->SetAutoCalc( FALSE ); // outside of the loop
+ pDoc->SetAutoCalc( FALSE ); // outside of the loop
for (SCCOL nCopyCol = rParam.nCol1; nCopyCol <= nEndCol; nCopyCol++)
{
pImportDoc->CopyToDocument( nCopyCol, rParam.nRow1, nTab, nCopyCol, nEndRow, nTab,
@@ -629,9 +629,9 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
}
pDoc->SetAutoCalc( bOldAutoCalc );
- if (nFormulaCols > 0) // copy formulas
+ if (nFormulaCols > 0) // copy formulas
{
- if (bKeepFormat) // formats for formulas
+ if (bKeepFormat) // formats for formulas
pImportDoc->CopyToDocument( nEndCol+1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
IDF_ATTRIB, FALSE, pDoc );
@@ -642,9 +642,9 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
aMark, nEndRow-rParam.nRow1-1, FILL_TO_BOTTOM, FILL_SIMPLE );
}
- // if new range is smaller, clear old contents
+ // if new range is smaller, clear old contents
- if (!bMoveCells) // move has happened above
+ if (!bMoveCells) // move has happened above
{
if ( rParam.nCol2 > nEndCol )
pDoc->DeleteArea( nEndCol+1, rParam.nRow1, rParam.nCol2, rParam.nRow2,
@@ -654,7 +654,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
aNewMark, IDF_CONTENTS );
}
- if( !bAddrInsert ) // update database range
+ if( !bAddrInsert ) // update database range
{
pDBData->SetImportParam( rParam );
pDBData->SetHeader( TRUE );
@@ -669,7 +669,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
ScDocument* pRedoDoc = pImportDoc;
pImportDoc = NULL;
- if (nFormulaCols > 0) // include filled formulas for redo
+ if (nFormulaCols > 0) // include filled formulas for redo
pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
IDF_ALL & ~IDF_NOTE, FALSE, pRedoDoc );
@@ -693,7 +693,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (pWaitWin)
pWaitWin->LeaveWait();
- if ( bTruncated && !bApi ) // show warning
+ if ( bTruncated && !bApi ) // show warning
ErrorHandler::HandleError(SCWARN_IMPORT_RANGE_OVERFLOW);
}
else if ( !bApi )