diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-04-11 02:37:45 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-04-13 17:21:30 +0200 |
commit | b845d236f530327610a6f69b0126c63693028e84 (patch) | |
tree | 721a9e92c0e8efe99b78ead06083e94e995c1a86 /sw | |
parent | d7b6b1dc1d21dd3925798954a59508a40a700cfd (diff) |
use getCells()
Change-Id: I11ac9c87ac1d17b2ebc847e268d935c23f129ce1
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 7deff41d8384..588ad2539af9 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -3704,25 +3704,25 @@ uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno: const sal_uInt16 nColCount = getColumnCount(); if(!nRowCount || !nColCount) throw uno::RuntimeException("Table too complex", static_cast<cppu::OWeakObject*>(this)); - uno::Sequence< uno::Sequence< double > > aRowSeq(m_bFirstRowAsLabel ? nRowCount - 1 : nRowCount); - lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this)); - uno::Sequence<double>* pRowArray = aRowSeq.getArray(); - const sal_uInt16 nRowStart = m_bFirstRowAsLabel ? 1 : 0; - for(sal_uInt16 nRow = nRowStart; nRow < nRowCount; nRow++) + if(m_bFirstColumnAsLabel || m_bFirstRowAsLabel) { - uno::Sequence<double> aColSeq(m_bFirstColumnAsLabel ? nColCount - 1 : nColCount); - double* pArray = aColSeq.getArray(); - const sal_uInt16 nColStart = m_bFirstColumnAsLabel ? 1 : 0; - for(sal_uInt16 nCol = nColStart; nCol < nColCount; nCol++) + uno::Reference<chart::XChartDataArray> xDataRange(getCellRangeByPosition(m_bFirstRowAsLabel ? 1 : 0, m_bFirstColumnAsLabel ? 1 : 0, + nRowCount, nColCount), uno::UNO_QUERY); + return xDataRange->getData(); + } + uno::Sequence< uno::Sequence< double > > vRows(nColCount); + auto vCells(getCells()); + auto pCurrentCell(vCells.begin()); + for(auto& rRow : vRows) + { + rRow = uno::Sequence<double>(nRowCount); + for(auto& rValue : rRow) { - uno::Reference<table::XCell> xCell = getCellByPosition(nCol, nRow); - if(!xCell.is()) - throw uno::RuntimeException(); - pArray[nCol - nColStart] = xCell->getValue(); + rValue = (*pCurrentCell)->getValue(); + ++pCurrentCell; } - pRowArray[nRow - nRowStart] = aColSeq; } - return aRowSeq; + return vRows; } void SwXCellRange::setData(const uno::Sequence< uno::Sequence< double > >& rData) |