sw/source/filter/xml/xmltbli.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit ae323dfc4c031289d341a4152fc756c1433ea2e1
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Sun Oct 30 13:45:19 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Oct 31 20:36:08 2022 +0100

    tdf#126788 inline createTextCursorByRange into this call site
    
    Change-Id: I1ee91ff56f4c5e0c0182f67a9c321e914ec6cd77
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142039
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 4be7ca9f5f7a..755ee6428b83 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2715,9 +2715,13 @@ const SwStartNode *SwXMLTableContext::InsertTableSection(
             const auto pNewCursor(pDoc->CreateUnoCursor(SwPosition( *pCNd )));
             rtl::Reference<SwXTextRange> xTextRange = new 
SwXTextRange(*pNewCursor, xParent,
                     SwXTextRange::RANGE_IN_CELL);
-            Reference < XTextCursor > xTextCursor =
-                xParent->createTextCursorByRange( xTextRange );
-            GetImport().GetTextImport()->SetCursor( xTextCursor );
+            DBG_TESTSOLARMUTEX();
+            SwUnoInternalPaM aPam(*pDoc);
+            ::sw::XTextRangeToSwPaM(aPam, xTextRange);
+            rtl::Reference<SwXTextCursor> xTextCursor =
+                new SwXTextCursor(*pDoc, xParent, CursorType::TableText,
+                *aPam.GetPoint(), aPam.GetMark());
+            GetImport().GetTextImport()->SetCursor( 
static_cast<XWordCursor*>(xTextCursor.get()) );
         }
     }
 

Reply via email to