summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-28 18:24:48 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-28 22:14:40 +0100
commitcd0a92f1d61c8653f158bf5c49912e1257c1fd05 (patch)
tree6aaf66efd9bbd06d83bdf282aa34a0a7eec07e15
parent8e3c3adbf0132fd0ce4f4bd113274392297c0b23 (diff)
simplify
Change-Id: I1893f53d1bc4996db862301fc4350339802858ff
-rw-r--r--sw/source/core/unocore/unotbl.cxx23
1 files changed, 9 insertions, 14 deletions
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 0a1a57bae741..68e0512176ac 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -2141,24 +2141,19 @@ uno::Sequence<OUString> SwXTextTable::getCellNames(void) throw( uno::RuntimeExce
return comphelper::containerToSequence<OUString>(aAllNames);
}
-uno::Reference< text::XTextTableCursor > SwXTextTable::createCursorByCellName(const OUString& sCellName)
+uno::Reference<text::XTextTableCursor> SwXTextTable::createCursorByCellName(const OUString& sCellName)
throw (uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- uno::Reference< text::XTextTableCursor > xRet;
- SwFrmFmt* pFmt = GetFrmFmt();
- if(pFmt)
- {
- SwTable* pTable = SwTable::FindTable( pFmt );
- SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTblBox( sCellName ));
- if(pBox && pBox->getRowSpan() > 0 )
- {
- xRet = new SwXTextTableCursor(pFmt, pBox);
- }
- }
- if(!xRet.is())
+ SwFrmFmt* pFmt(GetFrmFmt());
+ if(!pFmt)
throw uno::RuntimeException();
- return xRet;
+ uno::Reference<text::XTextTableCursor> xRet;
+ SwTable* pTable = SwTable::FindTable(pFmt);
+ SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTblBox(sCellName));
+ if(!pBox || pBox->getRowSpan() == 0)
+ throw uno::RuntimeException();
+ return new SwXTextTableCursor(pFmt, pBox);
}
void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTextRange)