sd/source/ui/view/drviewsf.cxx |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit a535bacb2adeb491e919992a38e891945ca248f0
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Sun Aug 20 12:53:31 2023 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Sat Aug 26 21:05:00 2023 +0200

    sd: disable ThemeDialog when not in a master page
    
    Change-Id: Ic6ea74c877415f337d81d92bdef869c5fb61d239
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156122
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index 08d75842a187..83832f7ba561 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -37,12 +37,13 @@
 #include <svx/xdef.hxx>
 #include <svx/svdoutl.hxx>
 #include <svx/svdouno.hxx>
+#include <svx/svdpagv.hxx>
 #include <svx/fmshell.hxx>
 #include <svl/cjkoptions.hxx>
-
 #include <app.hrc>
 
 #include <sdmod.hxx>
+#include <sdpage.hxx>
 #include <stlsheet.hxx>
 #include <drawview.hxx>
 #include <drawdoc.hxx>
@@ -468,6 +469,21 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
             }
             break;
 
+            case SID_THEME_DIALOG:
+            {
+                bool bDisable = true;
+                SdrPageView* pPageView = mpDrawView->GetSdrPageView();
+                if (pPageView)
+                {
+                    SdPage* pPage = 
dynamic_cast<SdPage*>(pPageView->GetPage());
+                    if (pPage && pPage->IsMasterPage())
+                        bDisable = false;
+                }
+                if (bDisable)
+                    rSet.DisableItem(nWhich);
+            }
+            break;
+
             case SID_STYLE_FAMILY2:
             case SID_STYLE_FAMILY3:
             case SID_STYLE_FAMILY5:

Reply via email to