Resolves tdf#119919 - Show hidden children in Stylist when in tree mode
To avoid styles appearing on root if their parent is hidden
(eg. Heading hidden, Heading 1 moves under root), the Stylist
shows all styles but with disabled color for the hidden styles
Change-Id: Iec73a3010ab05d01e9b7209d81f1f03c1355ef49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145324
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 5945575..e1ecd4a 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -926,7 +926,7 @@ void StyleList::FillTreeBox(SfxStyleFamily eFam)
return;
StyleTreeArr_Impl aArr;
SfxStyleSheetBase* pStyle = m_pStyleSheetPool->First(eFam, SfxStyleSearchBits::AllVisible);
SfxStyleSheetBase* pStyle = m_pStyleSheetPool->First(eFam, SfxStyleSearchBits::All);
m_bAllowReParentDrop = pStyle && pStyle->HasParentSupport() && m_bTreeDrag;
@@ -1564,6 +1564,10 @@ IMPL_LINK(StyleList, CustomRenderHdl, weld::TreeView::render_args, aPayload, voi
if (pStyleSheet)
{
rRenderContext.Push(vcl::PushFlags::ALL);
// tdf#119919 - show "hidden" styles as disabled to not move children onto root node
if (pStyleSheet->IsHidden())
rRenderContext.SetTextColor(rStyleSettings.GetDisableColor());
sal_Int32 nSize = aRect.GetHeight();
std::unique_ptr<sfx2::StylePreviewRenderer> pStylePreviewRenderer(
pStyleManager->CreateStylePreviewRenderer(rRenderContext, pStyleSheet, nSize));