diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-03-28 18:51:54 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-03-28 22:14:43 +0100 |
commit | 690eb78e409665eca4b9e9e5a754459d524529e0 (patch) | |
tree | 89b65f5838dab5665d97f55410383b2657cff0f6 | |
parent | ee1d50f6fb4fd9cf6284b583caf68bf53bd7cf3b (diff) |
simplify a bit
Change-Id: I6c43307b8af29cef211a45fa568d11389501bb29
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index d84dcde061b8..8d52a7463bc0 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -2322,20 +2322,16 @@ uno::Reference<table::XCellRange> SwXTextTable::GetRangeByName(SwFrmFmt* pFmt, return new SwXCellRange(pUnoCrsr, *pFmt, rDesc); } -uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByPosition(sal_Int32 nLeft, sal_Int32 nTop, - sal_Int32 nRight, sal_Int32 nBottom) - throw (uno::RuntimeException, - lang::IndexOutOfBoundsException, - std::exception) +uno::Reference<table::XCellRange> SwXTextTable::getCellRangeByPosition(sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom) + throw(uno::RuntimeException, lang::IndexOutOfBoundsException, std::exception) { SolarMutexGuard aGuard; - uno::Reference< table::XCellRange > aRef; - SwFrmFmt* pFmt = GetFrmFmt(); + SwFrmFmt* pFmt(GetFrmFmt()); if(pFmt && nRight < USHRT_MAX && nBottom < USHRT_MAX && - nLeft <= nRight && nTop <= nBottom && + nLeft <= nRight && nTop <= nBottom && nLeft >= 0 && nRight >= 0 && nTop >= 0 && nBottom >= 0 ) { - SwTable* pTable = SwTable::FindTable( pFmt ); + SwTable* pTable = SwTable::FindTable(pFmt); if(!pTable->IsTblComplex()) { SwRangeDescriptor aDesc; @@ -2345,16 +2341,12 @@ uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByPosition(sal_In aDesc.nRight = nRight; const OUString sTLName = sw_GetCellName(aDesc.nLeft, aDesc.nTop); const OUString sBRName = sw_GetCellName(aDesc.nRight, aDesc.nBottom); - // please note that according to the 'if' statement at the begin // sTLName:sBRName already denotes the normalized range string - - aRef = GetRangeByName(pFmt, pTable, sTLName, sBRName, aDesc); + return GetRangeByName(pFmt, pTable, sTLName, sBRName, aDesc); } } - if(!aRef.is()) - throw lang::IndexOutOfBoundsException(); - return aRef; + throw lang::IndexOutOfBoundsException(); } uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByName(const OUString& sRange) |