diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-01-23 22:19:30 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-01-24 11:33:44 +0000 |
commit | 6d3aafc3aa70d63aa8f61bf86b39cdad25172e73 (patch) | |
tree | 71e4fdc7441084265c6dfe1480f6e5655072d8a5 /sw/source/uibase/shells/basesh.cxx | |
parent | 9b324f97b55f37ef9f8dc6c9974c2fbbb2e984d5 (diff) |
sw: disable theme dialog if the theme is not set to the draw page
Change-Id: I3d60e9b82dfd59b5afc7769a7895acfcc5c3417c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146061
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/source/uibase/shells/basesh.cxx')
-rw-r--r-- | sw/source/uibase/shells/basesh.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 363c37f9d580..eb071c1d4bfb 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2209,6 +2209,21 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) break; case SID_THEME_DIALOG: { + bool bDisable = true; + auto* pDocument = rSh.GetDoc(); + auto* pDocumentShell = pDocument->GetDocShell(); + if (pDocumentShell) + { + SdrPage* pPage = pDocument->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); + if (pPage) + { + svx::Theme* pTheme = pPage->getSdrPageProperties().GetTheme(); + if (pTheme) + bDisable = false; + } + } + if (bDisable) + rSet.DisableItem(nWhich); } break; } |