summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-28 17:57:06 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-28 22:14:40 +0100
commit0056e34ae80ef57daf0567020a147cc914b7ab4e (patch)
tree734dba9ebcb760cd99e5dee8f36048f1fb22cbb1
parentcb555c12a2aef08e9b53698f6b0e753d43142551 (diff)
flatten and simplify
Change-Id: Ibc09d895714ba0ea44c3a73a13eb80ccff7415e6
-rw-r--r--sw/source/core/unocore/unotbl.cxx22
1 files changed, 8 insertions, 14 deletions
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 80034e66c343..d1ac85c7d248 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -2115,23 +2115,17 @@ uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( un
return xResult;
}
-uno::Reference< table::XCell > SwXTextTable::getCellByName(const OUString& sCellName) throw( uno::RuntimeException, std::exception )
+uno::Reference<table::XCell> SwXTextTable::getCellByName(const OUString& sCellName) throw( uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
- uno::Reference< table::XCell > xRet;
- SwFrmFmt* pFmt = GetFrmFmt();
- if(pFmt)
- {
- SwTable* pTable = SwTable::FindTable( pFmt );
- SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTblBox( sCellName ));
- if(pBox)
- {
- xRet = SwXCell::CreateXCell(pFmt, pBox);
- }
- }
- else
+ SwFrmFmt* pFmt(GetFrmFmt());
+ if(!pFmt)
throw uno::RuntimeException();
- return xRet;
+ SwTable* pTable = SwTable::FindTable(pFmt);
+ SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTblBox(sCellName));
+ if(!pBox)
+ return nullptr;
+ return SwXCell::CreateXCell(pFmt, pBox);
}
uno::Sequence< OUString > SwXTextTable::getCellNames(void) throw( uno::RuntimeException, std::exception )