Kaydet (Commit) 439ca530 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

simplify

Change-Id: I358ba505d67d2df6189001bdb0ece9c4676ee67a
üst 670ec265
...@@ -4154,37 +4154,26 @@ uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno: ...@@ -4154,37 +4154,26 @@ uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno:
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
const sal_uInt16 nRowCount = getRowCount(); const sal_uInt16 nRowCount = getRowCount();
const sal_uInt16 nColCount = getColumnCount(); const sal_uInt16 nColCount = getColumnCount();
if(!nRowCount || !nColCount) if(!nRowCount || !nColCount)
{ throw uno::RuntimeException("Table too complex", static_cast<cppu::OWeakObject*>(this));
uno::RuntimeException aRuntime;
aRuntime.Message = "Table too complex";
throw aRuntime;
}
uno::Sequence< uno::Sequence< double > > aRowSeq(bFirstRowAsLabel ? nRowCount - 1 : nRowCount); uno::Sequence< uno::Sequence< double > > aRowSeq(bFirstRowAsLabel ? nRowCount - 1 : nRowCount);
SwFrmFmt* pFmt = GetFrmFmt(); lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this));
if(pFmt) uno::Sequence<double>* pRowArray = aRowSeq.getArray();
{
uno::Sequence< double >* pRowArray = aRowSeq.getArray();
const sal_uInt16 nRowStart = bFirstRowAsLabel ? 1 : 0; const sal_uInt16 nRowStart = bFirstRowAsLabel ? 1 : 0;
for(sal_uInt16 nRow = nRowStart; nRow < nRowCount; nRow++) for(sal_uInt16 nRow = nRowStart; nRow < nRowCount; nRow++)
{ {
uno::Sequence< double > aColSeq(bFirstColumnAsLabel ? nColCount - 1 : nColCount); uno::Sequence<double> aColSeq(bFirstColumnAsLabel ? nColCount - 1 : nColCount);
double * pArray = aColSeq.getArray(); double* pArray = aColSeq.getArray();
const sal_uInt16 nColStart = bFirstColumnAsLabel ? 1 : 0; const sal_uInt16 nColStart = bFirstColumnAsLabel ? 1 : 0;
for(sal_uInt16 nCol = nColStart; nCol < nColCount; nCol++) for(sal_uInt16 nCol = nColStart; nCol < nColCount; nCol++)
{ {
uno::Reference< table::XCell > xCell = getCellByPosition(nCol, nRow); uno::Reference<table::XCell> xCell = getCellByPosition(nCol, nRow);
if(!xCell.is()) if(!xCell.is())
{
throw uno::RuntimeException(); throw uno::RuntimeException();
}
pArray[nCol - nColStart] = xCell->getValue(); pArray[nCol - nColStart] = xCell->getValue();
} }
pRowArray[nRow - nRowStart] = aColSeq; pRowArray[nRow - nRowStart] = aColSeq;
} }
}
return aRowSeq; return aRowSeq;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment