sc/inc/chartarr.hxx | 24 ++++++++++++------------ sc/source/core/tool/chartarr.cxx | 36 ++++++++++++++---------------------- sc/source/ui/unoobj/cellsuno.cxx | 6 +++--- 3 files changed, 29 insertions(+), 37 deletions(-)
New commits: commit ee212bf4db7e38279d8c236c944ef3e09e3c0b72 Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Mon May 19 13:42:54 2014 +0200 kill some old 16 bit column indices Change-Id: Ie1c3f3b11ed216b53f3fd385614f6fcb2c38220c diff --git a/sc/inc/chartarr.hxx b/sc/inc/chartarr.hxx index 4e48d27..0dfcede 100644 --- a/sc/inc/chartarr.hxx +++ b/sc/inc/chartarr.hxx @@ -33,26 +33,26 @@ class ScDocument; class ScMemChart { - short nRowCnt; - short nColCnt; - double* pData; + SCROW nRowCnt; + SCCOL nColCnt; + double* pData; OUString* pColText; OUString* pRowText; ScMemChart(const ScMemChart& rMemChart); // not implemented public: - ScMemChart(short nCols, short nRows); + ScMemChart(SCCOL nCols, SCROW nRows); ~ScMemChart(); - short GetColCount() const { return nColCnt; } - short GetRowCount() const { return nRowCnt; } - const OUString& GetColText(short nCol) const { return pColText[nCol]; } - const OUString& GetRowText(short nRow) const { return pRowText[nRow]; } - double GetData(short nCol, short nRow) const { return pData[nCol * nRowCnt + nRow]; } - void SetData(short nCol, short nRow, const double& rVal) { pData[nCol * nRowCnt + nRow] = rVal; } - void SetColText(short nCol, const OUString& rText) { pColText[nCol] = rText; } - void SetRowText(short nRow, const OUString& rText) { pRowText[nRow] = rText; } + SCCOL GetColCount() const { return nColCnt; } + SCROW GetRowCount() const { return nRowCnt; } + const OUString& GetColText(SCCOL nCol) const { return pColText[nCol]; } + const OUString& GetRowText(SCROW nRow) const { return pRowText[nRow]; } + double GetData(SCCOL nCol, SCROW nRow) const { return pData[nCol * nRowCnt + nRow]; } + void SetData(SCCOL nCol, SCROW nRow, const double& rVal) { pData[nCol * nRowCnt + nRow] = rVal; } + void SetColText(SCCOL nCol, const OUString& rText) { pColText[nCol] = rText; } + void SetRowText(SCROW nRow, const OUString& rText) { pRowText[nRow] = rText; } }; class SC_DLLPUBLIC ScChartArray // only parameter-struct diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx index cc6311c..e3d3a19 100644 --- a/sc/source/core/tool/chartarr.cxx +++ b/sc/source/core/tool/chartarr.cxx @@ -33,7 +33,7 @@ using ::std::vector; -ScMemChart::ScMemChart(short nCols, short nRows) +ScMemChart::ScMemChart(SCCOL nCols, SCROW nRows) { nRowCnt = nRows; nColCnt = nCols; @@ -43,8 +43,8 @@ ScMemChart::ScMemChart(short nCols, short nRows) { double *pFill = pData; - for (short i = 0; i < nColCnt; i++) - for (short j = 0; j < nRowCnt; j++) + for (SCCOL i = 0; i < nColCnt; i++) + for (SCROW j = 0; j < nRowCnt; j++) *(pFill ++) = 0.0; } @@ -238,12 +238,8 @@ ScMemChart* ScChartArray::CreateMemChartSingle() aRows.push_back(nStrRow); } - - // Data - - - ScMemChart* pMemChart = new ScMemChart( - static_cast<short>(nColCount), static_cast<short>(nRowCount) ); + // Data + ScMemChart* pMemChart = new ScMemChart( nColCount, nRowCount ); if (pMemChart) { if ( bValidData ) @@ -256,7 +252,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle() // DBL_MIN is a Hack for Chart to recognize empty cells. ScAddress aPos(aCols[nCol], aRows[nRow], nTab1); double nVal = getCellValue(*pDocument, aPos, DBL_MIN, bCalcAsShown); - pMemChart->SetData(static_cast<short>(nCol), static_cast<short>(nRow), nVal); + pMemChart->SetData(nCol, nRow, nVal); } } } @@ -265,7 +261,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle() // Flag marking data as invalid? for (nCol=0; nCol<nColCount; nCol++) for (nRow=0; nRow<nRowCount; nRow++) - pMemChart->SetData( static_cast<short>(nCol), static_cast<short>(nRow), DBL_MIN ); + pMemChart->SetData( nCol, nRow, DBL_MIN ); } @@ -287,7 +283,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle() aString = aBuf.makeStringAndClear(); } - pMemChart->SetColText( static_cast<short>(nCol), aString); + pMemChart->SetColText( nCol, aString); } @@ -309,7 +305,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle() aBuf.append(static_cast<sal_Int32>(aRows[nRow]+1)); aString = aBuf.makeStringAndClear(); } - pMemChart->SetRowText( static_cast<short>(nRow), aString); + pMemChart->SetRowText( nRow, aString); } } @@ -340,12 +336,8 @@ ScMemChart* ScChartArray::CreateMemChartMulti() nRowCount = 1; } - // Data - - - ScMemChart* pMemChart = new ScMemChart( - static_cast<short>(nColCount), static_cast<short>(nRowCount) ); + ScMemChart* pMemChart = new ScMemChart( nColCount, nRowCount ); if (pMemChart) { SCSIZE nCol = 0; @@ -364,7 +356,7 @@ ScMemChart* ScChartArray::CreateMemChartMulti() // otherwise: Gap nVal = getCellValue(*pDocument, *pPos, DBL_MIN, bCalcAsShown); - pMemChart->SetData(static_cast<short>(nCol), static_cast<short>(nRow), nVal); + pMemChart->SetData(nCol, nRow, nVal); } } } @@ -378,7 +370,7 @@ ScMemChart* ScChartArray::CreateMemChartMulti() // otherwise: Gap nVal = getCellValue(*pDocument, *pPos, DBL_MIN, bCalcAsShown); - pMemChart->SetData(static_cast<short>(nCol), static_cast<short>(nRow), nVal); + pMemChart->SetData(nCol, nRow, nVal); } } @@ -408,7 +400,7 @@ ScMemChart* ScChartArray::CreateMemChartMulti() aBuf.append(aPos.Format(SCA_VALID_COL, NULL)); aString = aBuf.makeStringAndClear(); } - pMemChart->SetColText( static_cast<short>(nCol), aString); + pMemChart->SetColText( nCol, aString); } @@ -434,7 +426,7 @@ ScMemChart* ScChartArray::CreateMemChartMulti() aBuf.append(static_cast<sal_Int32>(nPosRow)); aString = aBuf.makeStringAndClear(); } - pMemChart->SetRowText( static_cast<short>(nRow), aString); + pMemChart->SetRowText( nRow, aString); } } diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index f07ffd2..dd3a0e2 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -3047,7 +3047,7 @@ uno::Sequence< uno::Sequence<double> > SAL_CALL ScCellRangesBase::getData() uno::Sequence<double> aColSeq( nColCount ); double* pColAry = aColSeq.getArray(); for (sal_Int32 nCol = 0; nCol < nColCount; nCol++) - pColAry[nCol] = pMemChart->GetData( static_cast<short>(nCol), static_cast<short>(nRow) ); + pColAry[nCol] = pMemChart->GetData( nCol, nRow ); pRowAry[nRow] = aColSeq; } @@ -3155,7 +3155,7 @@ uno::Sequence<OUString> SAL_CALL ScCellRangesBase::getRowDescriptions() uno::Sequence<OUString> aSeq( nRowCount ); OUString* pAry = aSeq.getArray(); for (sal_Int32 nRow = 0; nRow < nRowCount; nRow++) - pAry[nRow] = pMemChart->GetRowText(static_cast<short>(nRow)); + pAry[nRow] = pMemChart->GetRowText(nRow); return aSeq; } @@ -3226,7 +3226,7 @@ uno::Sequence<OUString> SAL_CALL ScCellRangesBase::getColumnDescriptions() uno::Sequence<OUString> aSeq( nColCount ); OUString* pAry = aSeq.getArray(); for (sal_Int32 nCol = 0; nCol < nColCount; nCol++) - pAry[nCol] = pMemChart->GetColText(static_cast<short>(nCol)); + pAry[nCol] = pMemChart->GetColText(nCol); return aSeq; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits