diff options
author | Pranam Lashkari <lpranam@collabora.com> | 2023-08-29 17:37:38 +0800 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-10-16 09:43:23 +0200 |
commit | 5af582071da444af338c8cd0a9657f73f9a5f52f (patch) | |
tree | 37b96febac60369bf861ac838ef81ee733488c41 | |
parent | d254ec0e8e7be6cd42e70998df7b8d0f3233a0fb (diff) |
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 <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Attila Szűcs <attila.szucs@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.mcnamara@collabora.com>
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
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; } |