summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-28 13:11:57 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-28 22:14:27 +0100
commit4392cd43de2df7f7dd67106b24d184b52f0bd316 (patch)
treed3e5e2641da45a875b2e6c30ad6ef626130ad66e /sw
parent2c788546083f3bc33b5264c4228caeec1c2c3353 (diff)
flatten scope
Change-Id: Ifc448767a946566dce5e4f5c98f79fc61099ad5f
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unotbl.cxx23
1 files changed, 9 insertions, 14 deletions
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index ff3987986d2d..e6b30fdea1ea 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1000,23 +1000,18 @@ sal_Int32 SwXCell::getError(void) throw( uno::RuntimeException, std::exception )
return sal_Int32(sContent.equals(SwViewShell::GetShellRes()->aCalc_Error));
}
-uno::Reference< text::XTextCursor > SwXCell::createTextCursor(void) throw( uno::RuntimeException, std::exception )
+uno::Reference<text::XTextCursor> SwXCell::createTextCursor(void) throw( uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
- uno::Reference< text::XTextCursor > aRef;
- if(pStartNode || IsValid())
- {
- const SwStartNode* pSttNd = pStartNode ? pStartNode : pBox->GetSttNd();
- SwPosition aPos(*pSttNd);
- SwXTextCursor *const pXCursor =
- new SwXTextCursor(*GetDoc(), this, CURSOR_TBLTEXT, aPos);
- SwUnoCrsr *const pUnoCrsr = pXCursor->GetCursor();
- pUnoCrsr->Move(fnMoveForward, fnGoNode);
- aRef = static_cast<text::XWordCursor*>(pXCursor);
- }
- else
+ if(!pStartNode && !IsValid())
throw uno::RuntimeException();
- return aRef;
+ const SwStartNode* pSttNd = pStartNode ? pStartNode : pBox->GetSttNd();
+ SwPosition aPos(*pSttNd);
+ SwXTextCursor* const pXCursor =
+ new SwXTextCursor(*GetDoc(), this, CURSOR_TBLTEXT, aPos);
+ SwUnoCrsr* const pUnoCrsr = pXCursor->GetCursor();
+ pUnoCrsr->Move(fnMoveForward, fnGoNode);
+ return static_cast<text::XWordCursor*>(pXCursor);
}
uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno::Reference< text::XTextRange > & xTextPosition)