summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2021-04-13 15:09:27 -0800
committerJim Raykowski <raykowj@gmail.com>2021-04-19 01:58:27 +0200
commitc0aa577dd567ddd705a8e88d0614b633629d23d2 (patch)
tree137eb2c859e3e343dad2c40d60905ff2610a0ff7 /sw
parent6aa418bc1db541d40cbc34fb0be9f16cb0019c65 (diff)
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@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/utlui/content.cxx17
1 files changed, 10 insertions, 7 deletions
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)