sfx2/source/dialog/StyleList.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit f2a2ca8a9d4bf0314b2012cc1d066c65044bd5e0
Author:     Heiko Tietze <[email protected]>
AuthorDate: Wed Jan 11 11:12:58 2023 +0100
Commit:     Heiko Tietze <[email protected]>
CommitDate: Fri Jan 13 08:04:06 2023 +0000

    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 <[email protected]>

diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 59455758e890..e1ecd4a2108d 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));

Reply via email to