summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-28 17:53:36 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-28 22:14:39 +0100
commitcb555c12a2aef08e9b53698f6b0e753d43142551 (patch)
treeec21cb3f98fcc9669dc7aab64f391ef847c73bbb
parent2535e00ea70956ea56f2a3d9c0e80a40265d5f68 (diff)
simplify
Change-Id: Id48493c820e8052730e3f13270b5071161ba9f26
-rw-r--r--sw/source/core/unocore/unotbl.cxx34
1 files changed, 12 insertions, 22 deletions
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 6ceecbe392bb..80034e66c343 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -2065,26 +2065,19 @@ SwXTextTable::SwXTextTable(SwFrmFmt& rFrmFmt)
SwXTextTable::~SwXTextTable()
{ delete pTableProps; }
-uno::Reference<text::XTextTable>
-SwXTextTable::CreateXTextTable(SwFrmFmt *const pFrmFmt)
+uno::Reference<text::XTextTable> SwXTextTable::CreateXTextTable(SwFrmFmt* const pFrmFmt)
{
uno::Reference<text::XTextTable> xTable;
- if (pFrmFmt)
- {
+ if(pFrmFmt)
xTable.set(pFrmFmt->GetXObject(), uno::UNO_QUERY); // cached?
- }
- if (!xTable.is())
- {
- SwXTextTable *const pNew(
- (pFrmFmt) ? new SwXTextTable(*pFrmFmt) : new SwXTextTable());
- xTable.set(pNew);
- if (pFrmFmt)
- {
- pFrmFmt->SetXObject(xTable);
- }
- // need a permanent Reference to initialize m_wThis
- pNew->m_pImpl->m_wThis = xTable;
- }
+ if(xTable.is())
+ return xTable;
+ SwXTextTable* const pNew( (pFrmFmt) ? new SwXTextTable(*pFrmFmt) : new SwXTextTable());
+ xTable.set(pNew);
+ if(pFrmFmt)
+ pFrmFmt->SetXObject(xTable);
+ // need a permanent Reference to initialize m_wThis
+ pNew->m_pImpl->m_wThis = xTable;
return xTable;
}
@@ -2092,11 +2085,8 @@ void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeExc
{
if(!bIsDescriptor || nR <= 0 || nC <= 0 || nR >= USHRT_MAX || nC >= USHRT_MAX )
throw uno::RuntimeException();
- else
- {
- nRows = (sal_uInt16)nR;
- nColumns = (sal_uInt16)nC;
- }
+ nRows = static_cast<sal_uInt16>(nR);
+ nColumns = static_cast<sal_uInt16>(nC);
}
uno::Reference< table::XTableRows > SwXTextTable::getRows(void) throw( uno::RuntimeException, std::exception )