sw/source/core/doc/textboxhelper.cxx |    3 ++-
 sw/source/core/edit/edfcol.cxx       |    7 +++----
 sw/source/uibase/utlui/unotools.cxx  |    7 +++----
 3 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 38bad260039a6d3ec6a4ce39859ab13dfe8d9c4c
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Feb 14 14:52:03 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Feb 14 16:37:58 2025 +0100

    use more concrete UNO in writer
    
    Change-Id: I5a177f6bf1a0dc134ed1b0cf80f0e99cc1fcb937
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181667
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/sw/source/core/doc/textboxhelper.cxx 
b/sw/source/core/doc/textboxhelper.cxx
index 653bc2849624..bf3a9bbd5341 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -47,6 +47,7 @@
 #include <IDocumentUndoRedo.hxx>
 #include <IDocumentDrawModelAccess.hxx>
 #include <frmatr.hxx>
+#include <unotextbodyhf.hxx>
 
 #include <com/sun/star/document/XActionLockable.hpp>
 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
@@ -109,7 +110,7 @@ void SwTextBoxHelper::create(SwFrameFormat* pShape, 
SdrObject* pObject, bool bCo
         if (SwDocShell* pShell = pShape->GetDoc()->GetDocShell())
         {
             rtl::Reference<SwXTextDocument> 
xTextDocument(pShell->GetBaseModel());
-            xTextContentAppend.set(xTextDocument->getText(), 
uno::UNO_QUERY_THROW);
+            xTextContentAppend = xTextDocument->getBodyText();
         }
     }
 
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 848d9508a418..2a0271655893 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -1890,11 +1890,10 @@ void SwEditShell::ValidateAllParagraphSignatures(bool 
updateDontRemove)
         });
 
     rtl::Reference<SwXTextDocument> xModel = pDocShell->GetBaseModel();
-    uno::Reference<text::XText> xParent = xModel->getText();
-    uno::Reference<container::XEnumerationAccess> 
xParagraphEnumerationAccess(xParent, uno::UNO_QUERY);
-    if (!xParagraphEnumerationAccess.is())
+    rtl::Reference<SwXBodyText> xParent = xModel->getBodyText();
+    if (!xParent.is())
         return;
-    uno::Reference<container::XEnumeration> xParagraphs = 
xParagraphEnumerationAccess->createEnumeration();
+    rtl::Reference<SwXParagraphEnumeration> xParagraphs = 
xParent->createParagraphEnumeration();
     if (!xParagraphs.is())
         return;
     uno::Sequence<uno::Reference<css::rdf::XURI>> aGraphNames = 
SwRDFHelper::getGraphNames(pDocShell->GetBaseModel(), MetaNS);
diff --git a/sw/source/uibase/utlui/unotools.cxx 
b/sw/source/uibase/utlui/unotools.cxx
index 94c8853b642c..09bacb12c50b 100644
--- a/sw/source/uibase/utlui/unotools.cxx
+++ b/sw/source/uibase/utlui/unotools.cxx
@@ -59,6 +59,7 @@
 #include <swmodule.hxx>
 #include <TextCursorHelper.hxx>
 #include <doc.hxx>
+#include <unotextbodyhf.hxx>
 
 using namespace ::com::sun::star;
 
@@ -284,10 +285,8 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer, 
void )
             m_bIsInitialized = true;
         }
 
-        uno::Reference< text::XText >  xText = m_xModel->getText();
-        uno::Reference< text::XTextCursor > xTextCursor = 
xText->createTextCursor();
-        m_xCursor = dynamic_cast<SwXTextCursor*>(xTextCursor.get());
-        assert(bool(xTextCursor) == bool(m_xCursor) && "expect to get 
SwXTextCursor type here");
+        rtl::Reference< SwXBodyText > xText = m_xModel->getBodyText();
+        m_xCursor = xText->createXTextCursor();
 
         //From here, a cursor is defined, which goes through the template,
         //and overwrites the template words where it is necessary.

Reply via email to