diff options
Diffstat (limited to 'sc/source/ui/unoobj/docuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index c985cb5b61aa..629b2c6816e3 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -3568,24 +3568,21 @@ uno::Sequence < uno::Reference< table::XCellRange > > SAL_CALL ScTableSheetsObj: ScRangeList aRangeList; ScDocument& rDoc = pDocShell->GetDocument(); - if (ScRangeStringConverter::GetRangeListFromString( aRangeList, aRange, &rDoc, ::formula::FormulaGrammar::CONV_OOO, ';' )) + if (!ScRangeStringConverter::GetRangeListFromString( aRangeList, aRange, &rDoc, ::formula::FormulaGrammar::CONV_OOO, ';' )) + throw lang::IllegalArgumentException(); + + size_t nCount = aRangeList.size(); + if (!nCount) + throw lang::IllegalArgumentException(); + + xRet.realloc(nCount); + for( size_t nIndex = 0; nIndex < nCount; nIndex++ ) { - size_t nCount = aRangeList.size(); - if (nCount) - { - xRet.realloc(nCount); - for( size_t nIndex = 0; nIndex < nCount; nIndex++ ) - { - const ScRange* pRange = aRangeList[ nIndex ]; - if( pRange ) - xRet[nIndex] = new ScCellRangeObj(pDocShell, *pRange); - } - } - else - throw lang::IllegalArgumentException(); + const ScRange* pRange = aRangeList[ nIndex ]; + if( pRange ) + xRet[nIndex] = new ScCellRangeObj(pDocShell, *pRange); } - else - throw lang::IllegalArgumentException(); + return xRet; } |