sc/source/ui/view/formatsh.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit a3cb71ac80c0c2971e97c033d212cf4e464fa8f0
Author:     Heiko Tietze <tietze.he...@gmail.com>
AuthorDate: Wed Mar 16 17:03:26 2022 +0100
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Wed Mar 16 19:29:40 2022 +0100

    Resolves tdf#143100 - Disable cell style commands when sheet is protected
    
    Change-Id: Id532bee30ebd550df3a55074aec94a1f92aad564
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131665
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 913915a20dc8..5513c9d76b75 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -189,6 +189,9 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet )
                     rSet.Put( SfxTemplateItem( nSlotId, pStyleSheet->GetName() 
) );
                 else
                     rSet.Put( SfxTemplateItem( nSlotId, OUString() ) );
+
+                if ( bProtected )
+                    rSet.DisableItem( nSlotId );
             }
             break;
 

Reply via email to