summaryrefslogtreecommitdiff
path: root/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx')
-rw-r--r--sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
index 81ae854ad9f5..25cb015d2d1d 100644
--- a/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
@@ -34,6 +34,7 @@
#include "CurrentMasterPagesSelector.hxx"
#include "PreviewValueSet.hxx"
#include "ViewShellBase.hxx"
+#include "DrawViewShell.hxx"
#include "drawdoc.hxx"
#include "sdpage.hxx"
#include "MasterPageContainer.hxx"
@@ -250,11 +251,21 @@ void CurrentMasterPagesSelector::Execute (SfxRequest& rRequest)
void CurrentMasterPagesSelector::GetState (SfxItemSet& rItemSet)
{
// Disable the SID_DELTE_MASTER slot when there is only one master page.
- if (mrDocument.GetMasterPageUserCount(GetSelectedMasterPage()) > 0)
+ if (rItemSet.GetItemState(SID_DELETE_MASTER_PAGE) == SFX_ITEM_AVAILABLE
+ && mrDocument.GetMasterPageUserCount(GetSelectedMasterPage()) > 0)
{
rItemSet.DisableItem(SID_DELETE_MASTER_PAGE);
}
+ ::boost::shared_ptr<DrawViewShell> pDrawViewShell (
+ ::boost::dynamic_pointer_cast<DrawViewShell>(mrBase.GetMainViewShell()));
+ if (rItemSet.GetItemState(SID_TP_EDIT_MASTER) == SFX_ITEM_AVAILABLE
+ && pDrawViewShell
+ && pDrawViewShell->GetEditMode() == EM_MASTERPAGE)
+ {
+ rItemSet.DisableItem (SID_TP_EDIT_MASTER);
+ }
+
MasterPagesSelector::GetState(rItemSet);
}