summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-29 01:30:49 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-30 23:17:31 +0200
commit2f241ed70c5065b526cac88a3400f9c47830f516 (patch)
tree7663f8403699aafae94334600be03fab62f163c5 /sw
parent99ecd8abe7e9a65e1d4af04ee160d3941aadebad (diff)
simplify/eat copypasta
Change-Id: I388c314b4baf72e889a0b23a1fbd1c0f0715e80d
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unotbl.cxx45
1 files changed, 6 insertions, 39 deletions
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 6a431a3517b2..40572a5e466b 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -4262,9 +4262,10 @@ uno::Sequence< OUString > SwXCellRange::getRowDescriptions(void)
///@see SwXTextTable::setRowDescriptions (TODO: seems to be copy and paste programming here)
void SwXCellRange::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc)
- throw( uno::RuntimeException, std::exception )
+ throw( uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
+
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
@@ -4295,48 +4296,14 @@ void SwXCellRange::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc)
}
}
-///@see SwXTextTable::setColumnDescriptions (TODO: seems to be copy and paste programming here)
uno::Sequence< OUString > SwXCellRange::getColumnDescriptions(void)
- throw( uno::RuntimeException, std::exception )
+ throw(uno::RuntimeException, std::exception)
{
- SolarMutexGuard aGuard;
- const sal_uInt16 nColCount = getColumnCount();
- if(!nColCount)
- {
- uno::RuntimeException aRuntime;
- aRuntime.Message = "Table too complex";
- throw aRuntime;
- }
- uno::Sequence< OUString > aRet(bFirstRowAsLabel ? nColCount - 1 : nColCount);
- SwFrmFmt* pFmt = GetFrmFmt();
- if(pFmt)
- {
- OUString* pArray = aRet.getArray();
- if(bFirstRowAsLabel)
- {
- const sal_uInt16 nStart = bFirstColumnAsLabel ? 1 : 0;
- for(sal_uInt16 i = nStart; i < nColCount; i++)
- {
- uno::Reference< table::XCell > xCell = getCellByPosition(i, 0);
- if(!xCell.is())
- {
- throw uno::RuntimeException();
- }
- uno::Reference< text::XText > xText(xCell, uno::UNO_QUERY);
- pArray[i - nStart] = xText->getString();
- }
- }
- else
- {
- OSL_FAIL("Where do these labels come from?");
- }
- }
- else
- throw uno::RuntimeException();
- return aRet;
+ uno::Sequence<OUString> vResult(getColumnCount());
+ setColumnDescriptions(vResult);
+ return vResult;
}
-///@see SwXTextTable::setColumnDescriptions (TODO: seems to be copy and paste programming here)
void SwXCellRange::setColumnDescriptions(const uno::Sequence< OUString >& ColumnDesc)
throw( uno::RuntimeException, std::exception )
{