[Libreoffice-commits] core.git: sw/source

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Sun Apr 18 23:59:07 UTC 2021


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

New commits:
commit c0aa577dd567ddd705a8e88d0614b633629d23d2
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Tue Apr 13 15:09:27 2021 -0800
Commit:     Jim Raykowski <raykowj at gmail.com>
CommitDate: Mon Apr 19 01:58:27 2021 +0200

    Only Toggle in Outline Folding menu when sublevels are included
    
    Change-Id: Ib0d61d96f46acfeca1c017ec77d315e68ce33fb8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114072
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <raykowj at gmail.com>

diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index abce62691149..221a161d21b1 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1216,19 +1216,23 @@ static void lcl_SetOutlineContentEntriesSensitivities(SwContentTree* pThis, cons
     rPop.set_sensitive(OString::number(HIDE_OUTLINE_CONTENT_VISIBILITY), false);
     rPop.set_sensitive(OString::number(SHOW_OUTLINE_CONTENT_VISIBILITY), false);
 
-    if (!pThis->GetActiveWrtShell()->GetViewOptions()->IsShowOutlineContentVisibilityButton())
-        return;
-
     // todo: multi selection
     if (rContentTree.count_selected_rows() > 1)
         return;
 
+    bool bIsRoot = lcl_IsContentType(rEntry, rContentTree);
+
+    if (pThis->GetActiveWrtShell()->GetViewOptions()->IsTreatSubOutlineLevelsAsContent())
+    {
+        if (!bIsRoot)
+            rPop.set_sensitive(OString::number(TOGGLE_OUTLINE_CONTENT_VISIBILITY), true);
+        return;
+    }
+
     const SwNodes& rNodes = pThis->GetWrtShell()->GetNodes();
     const SwOutlineNodes& rOutlineNodes = rNodes.GetOutLineNds();
     size_t nOutlinePos = weld::GetAbsPos(rContentTree, rEntry);
 
-    bool bIsRoot = lcl_IsContentType(rEntry, rContentTree);
-
     if (!bIsRoot)
         --nOutlinePos;
 
@@ -1323,8 +1327,7 @@ static void lcl_SetOutlineContentEntriesSensitivities(SwContentTree* pThis, cons
         rPop.set_sensitive(OString::number(SHOW_OUTLINE_CONTENT_VISIBILITY), bHasFolded);
     }
 
-    bIsRoot ? rPop.remove(OString::number(TOGGLE_OUTLINE_CONTENT_VISIBILITY))
-            : rPop.set_sensitive(OString::number(TOGGLE_OUTLINE_CONTENT_VISIBILITY), true);
+    rPop.set_sensitive(OString::number(TOGGLE_OUTLINE_CONTENT_VISIBILITY), !bIsRoot);
 }
 
 IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool)


More information about the Libreoffice-commits mailing list