summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorDaniel Bankston <daniel.e.bankston@gmail.com>2012-05-31 21:48:45 -0500
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-06-17 17:04:00 +0200
commit153275bacbab37d4b3ab2dbef8c5e32626f705c6 (patch)
tree08b08618cb71a48367a5a9e1d857aac889052352 /sc
parent23d0816f92c5ad0885cbec648f324e68fc7f4a1b (diff)
Convert ScMyTableData to use ScAddress
Change-Id: I10972bc2b76a517c465ce32cf4832ab069be1bec
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/xml/xmlsubti.cxx21
-rw-r--r--sc/source/filter/xml/xmlsubti.hxx10
2 files changed, 14 insertions, 17 deletions
diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx
index 83d096fff2fb..c70570f47241 100644
--- a/sc/source/filter/xml/xmlsubti.cxx
+++ b/sc/source/filter/xml/xmlsubti.cxx
@@ -64,17 +64,14 @@ using ::std::auto_ptr;
using namespace com::sun::star;
-ScMyTableData::ScMyTableData(SCTAB nSheet, sal_Int32 nCol, sal_Int32 nRow)
+ScMyTableData::ScMyTableData(SCTAB nSheet, SCCOL nCol, SCROW nRow)
: nColsPerCol(nDefaultColCount, 1),
nRealCols(nDefaultColCount + 1, 0),
nRowsPerRow(nDefaultRowCount, 1),
nRealRows(nDefaultRowCount + 1, 0),
- nChangedCols()
+ nChangedCols(),
+ maTableCellPos(nCol, nRow, nSheet)
{
- aTableCellPos.Sheet = nSheet;
- aTableCellPos.Column = nCol;
- aTableCellPos.Row = nRow;
-
for (sal_Int32 i = 0; i < 3; ++i)
nRealCols[i] = i;
for (sal_Int32 j = 0; j < 3; ++j)
@@ -91,24 +88,24 @@ ScMyTableData::~ScMyTableData()
void ScMyTableData::AddRow()
{
- ++aTableCellPos.Row;
- if (static_cast<sal_uInt32>(aTableCellPos.Row) >= nRowsPerRow.size())
+ maTableCellPos.SetRow( maTableCellPos.Row() + 1 );
+ if (static_cast<sal_uInt32>(maTableCellPos.Row()) >= nRowsPerRow.size())
{
nRowsPerRow.resize(nRowsPerRow.size() + nDefaultRowCount, 1);
nRealRows.resize(nRowsPerRow.size() + nDefaultRowCount + 1, 0);
}
- nRealRows[aTableCellPos.Row + 1] = nRealRows[aTableCellPos.Row] + nRowsPerRow[aTableCellPos.Row];
+ nRealRows[maTableCellPos.Row() + 1] = nRealRows[maTableCellPos.Row()] + nRowsPerRow[maTableCellPos.Row()];
}
void ScMyTableData::AddColumn()
{
- ++aTableCellPos.Column;
- if (static_cast<sal_uInt32>(aTableCellPos.Column) >= nColsPerCol.size())
+ maTableCellPos.SetCol( maTableCellPos.Col() + 1 );
+ if (static_cast<sal_uInt32>(maTableCellPos.Col()) >= nColsPerCol.size())
{
nColsPerCol.resize(nColsPerCol.size() + nDefaultColCount, 1);
nRealCols.resize(nColsPerCol.size() + nDefaultColCount + 1, 0);
}
- nRealCols[aTableCellPos.Column + 1] = nRealCols[aTableCellPos.Column] + nColsPerCol[aTableCellPos.Column];
+ nRealCols[maTableCellPos.Col() + 1] = nRealCols[maTableCellPos.Col()] + nColsPerCol[maTableCellPos.Col()];
}
sal_Int32 ScMyTableData::GetRealCols(const sal_Int32 nIndex, const bool /* bIsNormal */) const
diff --git a/sc/source/filter/xml/xmlsubti.hxx b/sc/source/filter/xml/xmlsubti.hxx
index e95431460593..ea114ce151b8 100644
--- a/sc/source/filter/xml/xmlsubti.hxx
+++ b/sc/source/filter/xml/xmlsubti.hxx
@@ -57,7 +57,7 @@ const ScMysalIntVec::size_type nDefaultTabCount = 10;
class ScMyTableData
{
private:
- com::sun::star::table::CellAddress aTableCellPos;
+ ScAddress maTableCellPos;
ScMysalIntVec nColsPerCol;
ScMysalIntVec nRealCols;
ScMysalIntVec nRowsPerRow;
@@ -67,13 +67,13 @@ private:
sal_Int32 nSubTableSpanned;
ScMysalIntList nChangedCols;
public:
- ScMyTableData(SCTAB nSheet = -1, sal_Int32 nCol = -1, sal_Int32 nRow = -1);
+ ScMyTableData(SCTAB nSheet = -1, SCCOL nCol = -1, SCROW nRow = -1);
~ScMyTableData();
- sal_Int32 GetRow() const { return aTableCellPos.Row; }
- sal_Int32 GetColumn() const { return aTableCellPos.Column; }
+ SCROW GetRow() const { return maTableCellPos.Row(); }
+ SCCOL GetColumn() const { return maTableCellPos.Col(); }
void AddRow();
void AddColumn();
- void SetFirstColumn() { aTableCellPos.Column = -1; }
+ void SetFirstColumn() { maTableCellPos.SetCol(-1); }
sal_Int32 GetColsPerCol(const sal_Int32 nIndex) const { return nColsPerCol[nIndex]; }
void SetColsPerCol(const sal_Int32 nIndex, sal_Int32 nValue = 1) { nColsPerCol[nIndex] = nValue; }
sal_Int32 GetRealCols(const sal_Int32 nIndex, const bool bIsNormal = true) const;