sw/inc/IDocumentContentOperations.hxx                   |    3 ++-
 sw/source/core/doc/DocumentContentOperationsManager.cxx |    3 ++-
 sw/source/core/unocore/unofield.cxx                     |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 13874ba730ed94a38271e3b053e11a28f7d8268f
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jun 12 11:40:56 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Jun 12 15:17:16 2024 +0200

    tdf#144208 speedup doc with lots of redline (5)
    
    no need to call compress-redlines during load
    
    Change-Id: Ib26a1123b96e299974507e167bcb8ce8b3e3c924
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168701
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/IDocumentContentOperations.hxx 
b/sw/inc/IDocumentContentOperations.hxx
index eafc586886c2..222bf44e794c 100644
--- a/sw/inc/IDocumentContentOperations.hxx
+++ b/sw/inc/IDocumentContentOperations.hxx
@@ -85,10 +85,11 @@ enum class SwDeleteFlags
 {
     Default = 0,
     ArtificialSelection = (1<<0), ///< keyboard delete, artificial selection, 
avoid deleting flys
+    DontCompressRedlines = (1<<1) ///< dont call compress redlines while we 
are loading document
 };
 namespace o3tl
 {
-    template<> struct typed_flags<SwDeleteFlags> : 
is_typed_flags<SwDeleteFlags, 0x01> {};
+    template<> struct typed_flags<SwDeleteFlags> : 
is_typed_flags<SwDeleteFlags, 0x03> {};
 }
 
 /** Text operation/manipulation interface
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 366cd276440b..773b5b0026d4 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -4409,7 +4409,8 @@ bool 
DocumentContentOperationsManager::DeleteAndJoinImpl(SwPaM & rPam, SwDeleteF
     }
 
     if (!m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline()
-        && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty())
+        && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty()
+        && !(flags & SwDeleteFlags::DontCompressRedlines))
     {
         m_rDoc.getIDocumentRedlineAccess().CompressRedlines();
     }
diff --git a/sw/source/core/unocore/unofield.cxx 
b/sw/source/core/unocore/unofield.cxx
index aab9b5193646..152c1aa3bc44 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -2030,7 +2030,7 @@ void SAL_CALL SwXTextField::attach(
                 SwPaM aPam( rTextNode, pTextField->GetStart() );
                 aPam.SetMark();
                 aPam.Move();
-                pDoc->getIDocumentContentOperations().DeleteAndJoin(aPam);
+                pDoc->getIDocumentContentOperations().DeleteAndJoin(aPam, 
SwDeleteFlags::DontCompressRedlines);
             }
             // keep inserted annotation
             {

Reply via email to