sw/source/core/layout/newfrm.cxx                            |    2 +-
 sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx |    6 +++---
 sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx        |    4 ++--
 sw/source/writerfilter/dmapper/PropertyMap.hxx              |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit fd93f4bbeca4b55e420edc3739cca4a3a2ef6cbc
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Feb 24 15:36:00 2026 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Feb 24 21:02:52 2026 +0100

    reduce dynamic_cast cost in writer layout
    
    Change-Id: I2778901ce73bcf0c82f0bd396d514e6bb5791aed
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200213
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 48d539504f64..114299481dc7 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -581,7 +581,7 @@ void SwRootFrame::RemoveMasterObjs( SdrPage *pPg )
     for( size_t i = pPg ? pPg->GetObjCount() : 0; i; )
     {
         SdrObject* pObj = pPg->GetObj( --i );
-        if( dynamic_cast< const SwFlyDrawObj *>( pObj ) !=  nullptr )
+        if (pObj->GetObjIdentifier() == SdrObjKind::SwFlyDrawObjIdentifier && 
!pObj->IsSwVirtFlyDrawObj())
             pPg->RemoveObject( i );
     }
 }
commit 3d613c425ea86fac1badde2baab58d4cc2ca8b80
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Feb 24 14:27:08 2026 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Feb 24 21:02:42 2026 +0100

    use more concrete UNO in writerfilter
    
    Change-Id: I4cf74efa03796e1164402bf69ace4e75346def44
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200212
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx 
b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx
index a450c079ea66..ab0fd12a0efa 100644
--- a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx
@@ -1237,7 +1237,7 @@ void 
DomainMapperTableHandler::ApplyParagraphPropertiesFromTableStyle(TableParag
                     if (!oParagraphText) // do it only once
                     {
                         rtl::Reference<SwXTextCursor> xParagraph = 
dynamic_cast<SwXTextCursor*>(
-                            
rParaProp.m_rEndParagraph->getText()->createTextCursorByRange(rParaProp.m_rEndParagraph).get()
 );
+                            
rParaProp.m_rEndParagraph->getText()->createTextCursorByRange(static_cast<text::XSentenceCursor*>(rParaProp.m_rEndParagraph.get())).get()
 );
                         if (!xParagraph)
                             throw uno::RuntimeException();
                         // select paragraph
@@ -1337,7 +1337,7 @@ void 
DomainMapperTableHandler::ApplyParagraphPropertiesFromTableStyle(TableParag
         //    property is handled in SwXTextCursor::setPropertyValue.
         uno::Reference<beans::XPropertySet> xCursorProps(
             rParaProp.m_rEndParagraph->getText()->createTextCursorByRange(
-                rParaProp.m_rEndParagraph),
+                
static_cast<text::XSentenceCursor*>(rParaProp.m_rEndParagraph.get())),
             uno::UNO_QUERY_THROW);
         xCursorProps->setPropertyValue(u"ParaAutoStyleDef"_ustr,
                                        
uno::Any(comphelper::containerToSequence(aProps)));
@@ -1559,7 +1559,7 @@ void DomainMapperTableHandler::endTable(unsigned int 
nestedTableLevel)
                                 bApply = true;
                             if (bApply)
                             {
-                                bool bEndOfApply = 
(xTextRangeCompare->compareRegionEnds(rEndPara, aIt->m_rEndParagraph) == 0);
+                                bool bEndOfApply = 
(xTextRangeCompare->compareRegionEnds(rEndPara, 
static_cast<text::XSentenceCursor*>(aIt->m_rEndParagraph.get())) == 0);
                                 // tdf#153891 handle missing cell properties 
(exception in style handling?)
                                 if ( nCell < 
sal::static_int_cast<std::size_t>(aCellProperties[nRow].getLength()) )
                                     
ApplyParagraphPropertiesFromTableStyle(*aIt, aAllTableParaProperties, 
aCellProperties[nRow][nCell]);
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
index e5467ce7fe6a..de5f47d5926e 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
@@ -3028,11 +3028,11 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap, con
                 {
                     // table style has got bigger precedence than docDefault 
style
                     // collect these pending paragraph properties to process 
in endTable()
-                    uno::Reference<text::XTextCursor> xCur = 
xTextRange->getText( )->createTextCursor( );
+                    rtl::Reference<SwXTextCursor> xCur = 
dynamic_cast<SwXTextCursor*>(xTextRange->getText( )->createTextCursor().get());
                     xCur->gotoEnd(false);
                     xCur->goLeft(1, false);
                     rtl::Reference<SwXTextCursor> xParaCursor = 
dynamic_cast<SwXTextCursor*>
-                            
(xTextRange->getText()->createTextCursorByRange(xCur).get());
+                            
(xTextRange->getText()->createTextCursorByRange(static_cast<text::XSentenceCursor*>(xCur.get())).get());
                     if (!xParaCursor)
                         throw uno::RuntimeException();
                     xParaCursor->gotoStartOfParagraph(false);
diff --git a/sw/source/writerfilter/dmapper/PropertyMap.hxx 
b/sw/source/writerfilter/dmapper/PropertyMap.hxx
index a688c21fa0e5..e9df9a187288 100644
--- a/sw/source/writerfilter/dmapper/PropertyMap.hxx
+++ b/sw/source/writerfilter/dmapper/PropertyMap.hxx
@@ -652,7 +652,7 @@ typedef tools::SvRef< TablePropertyMap > 
TablePropertyMapPtr;
 struct TableParagraph
 {
     rtl::Reference<SwXTextCursor> m_rStartParagraph;
-    css::uno::Reference<css::text::XTextRange> m_rEndParagraph;
+    rtl::Reference<SwXTextCursor> m_rEndParagraph;
     PropertyMapPtr m_pPropertyMap;
     css::uno::Reference<css::beans::XPropertySet> m_rPropertySet;
 };

Reply via email to