sw/source/uibase/utlui/content.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 5af582071da444af338c8cd0a9657f73f9a5f52f
Author:     Pranam Lashkari <lpra...@collabora.com>
AuthorDate: Tue Aug 29 17:37:38 2023 +0800
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Oct 16 09:43:23 2023 +0200

    LOK: update navigator instantly on heading level change
    
    problem:
    i.e: when you change the header level,
    it was not reflected instantly in navigator and required reopening it.
    That was due to header level change was not registed as change in LOK case
    
    Change-Id: I503eb6a3fe9d2801ea5b45b0a1096e8174360ddc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156239
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Attila Szűcs <attila.sz...@collabora.com>
    (cherry picked from commit 1fca94be7fafc305cf02c0134fbc2d7e5cfb2a03)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157967
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index ca4e431f8038..a5079e411331 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3024,18 +3024,24 @@ bool SwContentTree::HasContentChanged()
             // In case of LOK, empty contentTypes are hidden, even in all 
content view
             // so it is not enough to check only the m_xTreeView.
             bool bCountChanged = false;
+            bool bHasContentChanged = false;
             for (ContentTypeId i : o3tl::enumrange<ContentTypeId>())
             {
                 if (m_aActiveContentArr[i])
                 {
                     auto nLastTMCount = 
m_aActiveContentArr[i]->GetMemberCount();
-                    m_aActiveContentArr[i]->FillMemberList();
+                    if (i == ContentTypeId::OUTLINE) // this is required for 
checking if header level is changed
+                        
m_aActiveContentArr[i]->FillMemberList(&bHasContentChanged);
+                    else
+                        m_aActiveContentArr[i]->FillMemberList();
                     // If the member count of a type is changed, then the 
content is surely changed
                     if (m_aActiveContentArr[i]->GetMemberCount() != 
nLastTMCount)
                         bCountChanged = true;
+                    if (bHasContentChanged)
+                        bContentChanged = true;
                 }
             }
-            if (bCountChanged)
+            if (bCountChanged || bContentChanged)
                 return true;
         }
 

Reply via email to