summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uno/unoatxt.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/uno/unoatxt.cxx')
-rw-r--r--sw/source/uibase/uno/unoatxt.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index 651ecf173cbe..f1358df6b4d8 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -848,13 +848,13 @@ void SwXAutoTextEntry::applyTo(const uno::Reference< text::XTextRange > & xTextR
// This means that we would reflect any changes which were done to the AutoText by foreign instances
// in the meantime
- // The reference to xTmp is needed during the whole call, likely because it could be a
+ // The reference to xKeepAlive is needed during the whole call, likely because it could be a
// different object, not xTextRange itself, and the reference guards it from preliminary death
uno::Reference<text::XTextRange> xKeepAlive( xTextRange );
uno::Reference<lang::XUnoTunnel> xTunnel( xTextRange, uno::UNO_QUERY);
SwXTextRange* pRange = comphelper::getFromUnoTunnel<SwXTextRange>(xTunnel);
OTextCursorHelper* pCursor = dynamic_cast<OTextCursorHelper*>(xKeepAlive.get());
- SwXText *pText = comphelper::getFromUnoTunnel<SwXText>(xTunnel);
+ SwXText *pText = dynamic_cast<SwXText*>(xTextRange.get());
SwDoc* pDoc = nullptr;
if (pRange)