sw/source/core/txtnode/thints.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 5760cba3b276a372d6cccf3f6b6db7fb26c20351
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Oct 22 19:43:44 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Oct 22 21:04:16 2021 +0200

    tdf#64991 speed up loading large RTL documents
    
    only insert the bounds we are interested in
    
    takes load time from 1m51 to 1min39 for me
    
    Change-Id: I5a267ae3cf3fe7691481f83b591b02d939931c07
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124074
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 1d3791b119a9..e97df81267df 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -723,8 +723,10 @@ void SwpHints::BuildPortions( SwTextNode& rNode, 
SwTextAttr& rNewHint,
             const sal_Int32 nOtherStart = pOther->GetStart();
             const sal_Int32 nOtherEnd = *pOther->End();
 
-            aBounds.insert( nOtherStart );
-            aBounds.insert( nOtherEnd );
+            if (nThisStart <= nOtherStart && nOtherStart <= nThisEnd)
+                aBounds.insert( nOtherStart );
+            if (nThisStart <= nOtherEnd && nOtherEnd <= nThisEnd)
+                aBounds.insert( nOtherEnd );
         }
     }
 

Reply via email to