summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uno/unotxvw.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/uno/unotxvw.cxx')
-rw-r--r--sw/source/uibase/uno/unotxvw.cxx12
1 files changed, 4 insertions, 8 deletions
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index 373be4bab8ab..f7da6ab5186f 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -283,8 +283,8 @@ uno::Any SwXTextView::getSelection()
case ShellMode::TableListText:
case ShellMode::Text :
{
- uno::Reference< container::XIndexAccess > xPos = SwXTextRanges::Create(rSh.GetCursor());
- aRef.set(xPos, uno::UNO_QUERY);
+ rtl::Reference< SwXTextRanges > xPos = SwXTextRanges::Create(rSh.GetCursor());
+ aRef.set(uno::Reference< container::XIndexAccess >(xPos), uno::UNO_QUERY);
}
break;
case ShellMode::Frame :
@@ -1273,7 +1273,6 @@ uno::Reference< text::XText > SwXTextViewCursor::getText()
uno::Reference< text::XTextRange > SwXTextViewCursor::getStart()
{
SolarMutexGuard aGuard;
- uno::Reference< text::XTextRange > xRet;
if(!m_pView)
throw uno::RuntimeException();
@@ -1283,15 +1282,13 @@ uno::Reference< text::XTextRange > SwXTextViewCursor::getStart()
SwWrtShell& rSh = m_pView->GetWrtShell();
SwPaM* pShellCursor = rSh.GetCursor();
SwDoc* pDoc = m_pView->GetDocShell()->GetDoc();
- xRet = SwXTextRange::CreateXTextRange(*pDoc, *pShellCursor->Start(), nullptr);
- return xRet;
+ return SwXTextRange::CreateXTextRange(*pDoc, *pShellCursor->Start(), nullptr);
}
uno::Reference< text::XTextRange > SwXTextViewCursor::getEnd()
{
SolarMutexGuard aGuard;
- rtl::Reference<SwXTextRange> xRet;
if(!m_pView)
throw uno::RuntimeException();
@@ -1301,9 +1298,8 @@ uno::Reference< text::XTextRange > SwXTextViewCursor::getEnd()
SwWrtShell& rSh = m_pView->GetWrtShell();
SwPaM* pShellCursor = rSh.GetCursor();
SwDoc* pDoc = m_pView->GetDocShell()->GetDoc();
- xRet = SwXTextRange::CreateXTextRange(*pDoc, *pShellCursor->End(), nullptr);
- return xRet;
+ return SwXTextRange::CreateXTextRange(*pDoc, *pShellCursor->End(), nullptr);
}
OUString SwXTextViewCursor::getString()