From a535bacb2adeb491e919992a38e891945ca248f0 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sun, 20 Aug 2023 12:53:31 +0200 Subject: sd: disable ThemeDialog when not in a master page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic6ea74c877415f337d81d92bdef869c5fb61d239 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156122 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- sd/source/ui/view/drviewsf.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 #include #include +#include #include #include - #include #include +#include #include #include #include @@ -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(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: -- cgit