summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-29 00:37:21 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-30 23:17:28 +0200
commit12038a6191798211823cecc070bc02b8ad36956d (patch)
treebee1c9116fa36773a31115c059c86d2d969030e0 /sw
parente0bc0b7aeb18ff638d826f07e243af776b7a5a3c (diff)
getCount() should throw exceptions on complex table like others
Change-Id: Ie504426209601695131e4c684bde7ee27fac87d8
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unotbl.cxx20
1 files changed, 7 insertions, 13 deletions
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 41040b5e2698..85e30ce54dad 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -4695,21 +4695,15 @@ SwXTableColumns::~SwXTableColumns()
sal_Int32 SwXTableColumns::getCount(void) throw( uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
- sal_Int32 nRet = 0;
- SwFrmFmt* pFrmFmt = GetFrmFmt();
+ SwFrmFmt* pFrmFmt(GetFrmFmt());
if(!pFrmFmt)
throw uno::RuntimeException();
- else
- {
- SwTable* pTable = SwTable::FindTable( pFrmFmt );
- if(!pTable->IsTblComplex())
- {
- SwTableLines& rLines = pTable->GetTabLines();
- SwTableLine* pLine = rLines.front();
- nRet = pLine->GetTabBoxes().size();
- }
- }
- return nRet;
+ SwTable* pTable = SwTable::FindTable( pFrmFmt );
+ if(!pTable->IsTblComplex())
+ throw uno::RuntimeException("Table too complex", static_cast<cppu::OWeakObject*>(this));
+ SwTableLines& rLines = pTable->GetTabLines();
+ SwTableLine* pLine = rLines.front();
+ return pLine->GetTabBoxes().size();
}
uno::Any SwXTableColumns::getByIndex(sal_Int32 nIndex)