From 153275bacbab37d4b3ab2dbef8c5e32626f705c6 Mon Sep 17 00:00:00 2001 From: Daniel Bankston Date: Thu, 31 May 2012 21:48:45 -0500 Subject: Convert ScMyTableData to use ScAddress Change-Id: I10972bc2b76a517c465ce32cf4832ab069be1bec --- sc/source/filter/xml/xmlsubti.cxx | 21 +++++++++------------ sc/source/filter/xml/xmlsubti.hxx | 10 +++++----- 2 files changed, 14 insertions(+), 17 deletions(-) (limited to 'sc') 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(aTableCellPos.Row) >= nRowsPerRow.size()) + maTableCellPos.SetRow( maTableCellPos.Row() + 1 ); + if (static_cast(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(aTableCellPos.Column) >= nColsPerCol.size()) + maTableCellPos.SetCol( maTableCellPos.Col() + 1 ); + if (static_cast(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; -- cgit