diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-03-30 00:01:12 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-03-30 23:20:09 +0200 |
commit | 439ca5309f7e7659802f7fef44c8690fa099ac22 (patch) | |
tree | b6a48fb7463d9772c0a76e7f7ecf9ca2a0a132d0 /sw | |
parent | 670ec2652b682d37b5d712752b14bc17c9c344ac (diff) |
simplify
Change-Id: I358ba505d67d2df6189001bdb0ece9c4676ee67a
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index d478504f8ff5..95fd5e9b0b20 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -4154,36 +4154,25 @@ uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno: SolarMutexGuard aGuard; const sal_uInt16 nRowCount = getRowCount(); const sal_uInt16 nColCount = getColumnCount(); - if(!nRowCount || !nColCount) - { - uno::RuntimeException aRuntime; - aRuntime.Message = "Table too complex"; - throw aRuntime; - } + throw uno::RuntimeException("Table too complex", static_cast<cppu::OWeakObject*>(this)); uno::Sequence< uno::Sequence< double > > aRowSeq(bFirstRowAsLabel ? nRowCount - 1 : nRowCount); - SwFrmFmt* pFmt = GetFrmFmt(); - if(pFmt) + lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this)); + uno::Sequence<double>* pRowArray = aRowSeq.getArray(); + const sal_uInt16 nRowStart = bFirstRowAsLabel ? 1 : 0; + for(sal_uInt16 nRow = nRowStart; nRow < nRowCount; nRow++) { - uno::Sequence< double >* pRowArray = aRowSeq.getArray(); - - const sal_uInt16 nRowStart = bFirstRowAsLabel ? 1 : 0; - for(sal_uInt16 nRow = nRowStart; nRow < nRowCount; nRow++) + uno::Sequence<double> aColSeq(bFirstColumnAsLabel ? nColCount - 1 : nColCount); + double* pArray = aColSeq.getArray(); + const sal_uInt16 nColStart = bFirstColumnAsLabel ? 1 : 0; + for(sal_uInt16 nCol = nColStart; nCol < nColCount; nCol++) { - uno::Sequence< double > aColSeq(bFirstColumnAsLabel ? nColCount - 1 : nColCount); - double * pArray = aColSeq.getArray(); - const sal_uInt16 nColStart = bFirstColumnAsLabel ? 1 : 0; - for(sal_uInt16 nCol = nColStart; nCol < nColCount; nCol++) - { - uno::Reference< table::XCell > xCell = getCellByPosition(nCol, nRow); - if(!xCell.is()) - { - throw uno::RuntimeException(); - } - pArray[nCol - nColStart] = xCell->getValue(); - } - pRowArray[nRow - nRowStart] = aColSeq; + uno::Reference<table::XCell> xCell = getCellByPosition(nCol, nRow); + if(!xCell.is()) + throw uno::RuntimeException(); + pArray[nCol - nColStart] = xCell->getValue(); } + pRowArray[nRow - nRowStart] = aColSeq; } return aRowSeq; } |