summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sc/inc/paramisc.hxx22
-rw-r--r--sc/source/core/data/documen4.cxx6
-rw-r--r--sc/source/core/data/global2.cxx14
-rw-r--r--sc/source/filter/excel/impop.cxx10
-rw-r--r--sc/source/ui/docshell/docfunc.cxx2
-rw-r--r--sc/source/ui/inc/undoblk.hxx5
-rw-r--r--sc/source/ui/miscdlgs/tabopdlg.cxx16
-rw-r--r--sc/source/ui/undo/undoblk3.cxx8
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx11
9 files changed, 47 insertions, 47 deletions
diff --git a/sc/inc/paramisc.hxx b/sc/inc/paramisc.hxx
index 425bb1906a5f..b5545a9ab38d 100644
--- a/sc/inc/paramisc.hxx
+++ b/sc/inc/paramisc.hxx
@@ -40,25 +40,27 @@ struct ScSolveParam
sal_Bool operator== ( const ScSolveParam& r ) const;
};
-struct ScTabOpParam
+/**
+ * Parameter for data table aka multiple operations.
+ */
+struct SC_DLLPUBLIC ScTabOpParam
{
+ enum Mode { Column = 0, Row = 1, Both = 2 };
+
ScRefAddress aRefFormulaCell;
ScRefAddress aRefFormulaEnd;
ScRefAddress aRefRowCell;
ScRefAddress aRefColCell;
- sal_uInt8 nMode;
+ Mode meMode;
- ScTabOpParam() {};
+ ScTabOpParam();
ScTabOpParam( const ScTabOpParam& r );
- ScTabOpParam( const ScRefAddress& rFormulaCell,
- const ScRefAddress& rFormulaEnd,
- const ScRefAddress& rRowCell,
- const ScRefAddress& rColCell,
- sal_uInt8 nMd);
- ~ScTabOpParam() {};
+ ScTabOpParam(
+ const ScRefAddress& rFormulaCell, const ScRefAddress& rFormulaEnd,
+ const ScRefAddress& rRowCell, const ScRefAddress& rColCell, Mode eMode );
ScTabOpParam& operator= ( const ScTabOpParam& r );
- sal_Bool operator== ( const ScTabOpParam& r ) const;
+ bool operator== ( const ScTabOpParam& r ) const;
};
#endif // SC_PARAMISC_HXX
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 590737ce63ba..65005bd73957 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -378,7 +378,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera
aForString.append(ScCompiler::GetNativeSymbol( ocOpen));
const OUString& sSep = ScCompiler::GetNativeSymbol( ocSep);
- if (rParam.nMode == 0) // nur Spalte
+ if (rParam.meMode == ScTabOpParam::Column) // column only
{
aRef.Set( rParam.aRefFormulaCell.GetAddress(), true, false, false );
aForString.append(aRef.GetRefString(this, nTab1));
@@ -391,7 +391,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera
nCol2 = std::min( nCol2, (SCCOL)(rParam.aRefFormulaEnd.Col() -
rParam.aRefFormulaCell.Col() + nCol1 + 1));
}
- else if (rParam.nMode == 1) // nur zeilenweise
+ else if (rParam.meMode == ScTabOpParam::Row) // row only
{
aRef.Set( rParam.aRefFormulaCell.GetAddress(), false, true, false );
aForString.append(aRef.GetRefString(this, nTab1));
@@ -404,7 +404,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera
nRow2 = std::min( nRow2, (SCROW)(rParam.aRefFormulaEnd.Row() -
rParam.aRefFormulaCell.Row() + nRow1 + 1));
}
- else // beides
+ else // both
{
aForString.append(rParam.aRefFormulaCell.GetRefString(this, nTab1));
aForString.append(sSep);
diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx
index 54b7c877dc00..ae5bdf92e560 100644
--- a/sc/source/core/data/global2.cxx
+++ b/sc/source/core/data/global2.cxx
@@ -294,12 +294,14 @@ sal_Bool ScSolveParam::operator==( const ScSolveParam& r ) const
//------------------------------------------------------------------------
// struct ScTabOpParam
+ScTabOpParam::ScTabOpParam() : meMode(Column) {}
+
ScTabOpParam::ScTabOpParam( const ScTabOpParam& r )
: aRefFormulaCell ( r.aRefFormulaCell ),
aRefFormulaEnd ( r.aRefFormulaEnd ),
aRefRowCell ( r.aRefRowCell ),
aRefColCell ( r.aRefColCell ),
- nMode ( r.nMode )
+ meMode(r.meMode)
{
}
@@ -309,12 +311,12 @@ ScTabOpParam::ScTabOpParam( const ScRefAddress& rFormulaCell,
const ScRefAddress& rFormulaEnd,
const ScRefAddress& rRowCell,
const ScRefAddress& rColCell,
- sal_uInt8 nMd)
+ Mode eMode )
: aRefFormulaCell ( rFormulaCell ),
aRefFormulaEnd ( rFormulaEnd ),
aRefRowCell ( rRowCell ),
aRefColCell ( rColCell ),
- nMode ( nMd )
+ meMode(eMode)
{
}
@@ -326,19 +328,19 @@ ScTabOpParam& ScTabOpParam::operator=( const ScTabOpParam& r )
aRefFormulaEnd = r.aRefFormulaEnd;
aRefRowCell = r.aRefRowCell;
aRefColCell = r.aRefColCell;
- nMode = r.nMode;
+ meMode = r.meMode;
return *this;
}
//------------------------------------------------------------------------
-sal_Bool ScTabOpParam::operator==( const ScTabOpParam& r ) const
+bool ScTabOpParam::operator==( const ScTabOpParam& r ) const
{
return ( (aRefFormulaCell == r.aRefFormulaCell)
&& (aRefFormulaEnd == r.aRefFormulaEnd)
&& (aRefRowCell == r.aRefRowCell)
&& (aRefColCell == r.aRefColCell)
- && (nMode == r.nMode) );
+ && (meMode == r.meMode) );
}
OUString ScGlobal::GetAbsDocName( const OUString& rFileName,
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index e8caace8386c..ceb758b1e32d 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -1104,13 +1104,13 @@ void ImportExcel::TableOp( void )
if( nFirstCol && nFirstRow )
{
ScTabOpParam aTabOpParam;
- aTabOpParam.nMode = (nGrbit & EXC_TABLEOP_BOTH) ? 2 : ((nGrbit & EXC_TABLEOP_ROW) ? 1 : 0 );
+ aTabOpParam.meMode = (nGrbit & EXC_TABLEOP_BOTH) ? ScTabOpParam::Both : ((nGrbit & EXC_TABLEOP_ROW) ? ScTabOpParam::Row : ScTabOpParam::Column);
sal_uInt16 nCol = nFirstCol - 1;
sal_uInt16 nRow = nFirstRow - 1;
SCTAB nTab = GetCurrScTab();
- switch( aTabOpParam.nMode )
+ switch (aTabOpParam.meMode)
{
- case 0: // COL
+ case ScTabOpParam::Column:
aTabOpParam.aRefFormulaCell.Set(
static_cast<SCCOL>(nFirstCol),
static_cast<SCROW>(nFirstRow - 1), nTab, false,
@@ -1124,7 +1124,7 @@ void ImportExcel::TableOp( void )
false );
nRow++;
break;
- case 1: // ROW
+ case ScTabOpParam::Row:
aTabOpParam.aRefFormulaCell.Set(
static_cast<SCCOL>(nFirstCol - 1),
static_cast<SCROW>(nFirstRow), nTab, false, false,
@@ -1138,7 +1138,7 @@ void ImportExcel::TableOp( void )
false );
nCol++;
break;
- case 2: // TWO-INPUT
+ case ScTabOpParam::Both: // TWO-INPUT
aTabOpParam.aRefFormulaCell.Set(
static_cast<SCCOL>(nFirstCol - 1),
static_cast<SCROW>(nFirstRow - 1), nTab, false,
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 56008a2c691d..0c7e82b09618 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -4156,7 +4156,7 @@ sal_Bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
rParam.aRefFormulaEnd,
rParam.aRefRowCell,
rParam.aRefColCell,
- rParam.nMode) );
+ rParam.meMode) );
}
pDoc->InsertTableOp(rParam, nStartCol, nStartRow, nEndCol, nEndRow, aMark);
rDocShell.PostPaintGridAll();
diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx
index 129e35ad4ddf..1b10216b3ebd 100644
--- a/sc/source/ui/inc/undoblk.hxx
+++ b/sc/source/ui/inc/undoblk.hxx
@@ -24,6 +24,7 @@
#include "viewutil.hxx"
#include "spellparam.hxx"
#include "cellmergeoption.hxx"
+#include "paramisc.hxx"
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
@@ -527,7 +528,7 @@ public:
const ScRefAddress& rFormulaEnd,
const ScRefAddress& rRowCell,
const ScRefAddress& rColCell,
- sal_uInt8 nMode );
+ ScTabOpParam::Mode eMode );
virtual ~ScUndoTabOp();
virtual void Undo();
@@ -544,7 +545,7 @@ private:
ScRefAddress theFormulaEnd;
ScRefAddress theRowCell;
ScRefAddress theColCell;
- sal_uInt8 nMode;
+ ScTabOpParam::Mode meMode;
};
diff --git a/sc/source/ui/miscdlgs/tabopdlg.cxx b/sc/source/ui/miscdlgs/tabopdlg.cxx
index 3a01e3de4a41..abff708e383a 100644
--- a/sc/source/ui/miscdlgs/tabopdlg.cxx
+++ b/sc/source/ui/miscdlgs/tabopdlg.cxx
@@ -243,7 +243,7 @@ IMPL_LINK( ScTabOpDlg, BtnHdl, PushButton*, pBtn )
{
if ( pBtn == &aBtnOk )
{
- sal_uInt8 nMode = 3;
+ ScTabOpParam::Mode eMode = ScTabOpParam::Column;
sal_uInt16 nError = 0;
// Zu ueberpruefen:
@@ -274,7 +274,7 @@ IMPL_LINK( ScTabOpDlg, BtnHdl, PushButton*, pBtn )
theFormulaCell.Col() != theFormulaEnd.Col())
nError = TABOPERR_NOCOLFORMULA;
else
- nMode = 1;
+ eMode = ScTabOpParam::Row;
}
}
if (!aEdColCell.GetText().isEmpty())
@@ -284,16 +284,16 @@ IMPL_LINK( ScTabOpDlg, BtnHdl, PushButton*, pBtn )
nError = TABOPERR_WRONGCOL;
else
{
- if (nMode == 1) // beides
+ if (eMode == ScTabOpParam::Row) // beides
{
- nMode = 2;
+ eMode = ScTabOpParam::Both;
ConvertSingleRef( pDoc, aEdFormulaRange.GetText(), nCurTab,
theFormulaCell, eConv );
}
else if (theFormulaCell.Row() != theFormulaEnd.Row())
nError = TABOPERR_NOROWFORMULA;
else
- nMode = 0;
+ eMode = ScTabOpParam::Column;
}
}
}
@@ -302,11 +302,7 @@ IMPL_LINK( ScTabOpDlg, BtnHdl, PushButton*, pBtn )
RaiseError( (ScTabOpErr) nError );
else
{
- ScTabOpParam aOutParam( theFormulaCell,
- theFormulaEnd,
- theRowCell,
- theColCell,
- nMode );
+ ScTabOpParam aOutParam(theFormulaCell, theFormulaEnd, theRowCell, theColCell, eMode);
ScTabOpItem aOutItem( SID_TABOP, &aOutParam );
SetDispatcherLock( false );
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 2037eb7bb1ec..c3953c69afb8 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -1086,7 +1086,7 @@ ScUndoTabOp::ScUndoTabOp( ScDocShell* pNewDocShell,
const ScRefAddress& rFormulaEnd,
const ScRefAddress& rRowCell,
const ScRefAddress& rColCell,
- sal_uInt8 nMd )
+ ScTabOpParam::Mode eMode )
: ScSimpleUndo( pNewDocShell ),
aRange ( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ),
pUndoDoc ( pNewUndoDoc ),
@@ -1094,7 +1094,7 @@ ScUndoTabOp::ScUndoTabOp( ScDocShell* pNewDocShell,
theFormulaEnd ( rFormulaEnd ),
theRowCell ( rRowCell ),
theColCell ( rColCell ),
- nMode ( nMd )
+ meMode(eMode)
{
}
@@ -1135,9 +1135,7 @@ void ScUndoTabOp::Redo()
ScUndoUtil::MarkSimpleBlock( pDocShell, aRange );
- ScTabOpParam aParam( theFormulaCell, theFormulaEnd,
- theRowCell, theColCell,
- nMode );
+ ScTabOpParam aParam(theFormulaCell, theFormulaEnd, theRowCell, theColCell, meMode);
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 9d2b61242c91..f128f6646a50 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -5342,7 +5342,7 @@ void SAL_CALL ScCellRangeObj::setTableOperation( const table::CellRangeAddress&
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
{
- sal_Bool bError = false;
+ bool bError = false;
ScTabOpParam aParam;
aParam.aRefFormulaCell = ScRefAddress( (SCCOL)aFormulaRange.StartColumn,
(SCROW)aFormulaRange.StartRow, aFormulaRange.Sheet,
@@ -5356,19 +5356,20 @@ void SAL_CALL ScCellRangeObj::setTableOperation( const table::CellRangeAddress&
aParam.aRefColCell = ScRefAddress( (SCCOL)aColumnCell.Column,
(SCROW)aColumnCell.Row, aColumnCell.Sheet,
false, false, false );
+
switch (nMode)
{
case sheet::TableOperationMode_COLUMN:
- aParam.nMode = 0;
+ aParam.meMode = ScTabOpParam::Column;
break;
case sheet::TableOperationMode_ROW:
- aParam.nMode = 1;
+ aParam.meMode = ScTabOpParam::Row;
break;
case sheet::TableOperationMode_BOTH:
- aParam.nMode = 2;
+ aParam.meMode = ScTabOpParam::Both;
break;
default:
- bError = sal_True;
+ bError = true;
}
if (!bError)