diff -ru sd/inc/app.hrc sd/inc/app.hrc --- openoffice.org.orig/sd/inc/app.hrc 2008-02-05 17:05:14.000000000 +0000 +++ openoffice.org/sd/inc/app.hrc 2008-02-05 20:29:11.000000000 +0000 @@ -469,6 +469,8 @@ // Add companion for the SID_HIDE_SLIDE (that is defined in svx) #define SID_SHOW_SLIDE (SID_SD_START+440) -#define SID_ADD_MOTION_PATH (SID_SD_START+441) +#define SID_ADD_MOTION_PATH (SID_SD_START+441) + +#define SID_TP_EDIT_MASTER (SID_SD_START+442) #endif diff -ru sd/sdi/TaskPaneViewShell.sdi sd/sdi/TaskPaneViewShell.sdi --- openoffice.org.orig/sd/sdi/TaskPaneViewShell.sdi 2008-02-05 17:05:16.000000000 +0000 +++ openoffice.org/sd/sdi/TaskPaneViewShell.sdi 2008-02-05 20:30:12.000000000 +0000 @@ -159,6 +159,31 @@ GroupId = GID_VIEW; ] +SfxVoidItem TaskPaneEditMaster SID_TP_EDIT_MASTER +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_VIEW; +] + SfxVoidItem InsertPage SID_INSERTPAGE_LAYOUT_MENU [ /* flags: */ @@ -212,6 +237,11 @@ ExecMethod = Execute ; StateMethod = GetState ; ] + SID_TP_EDIT_MASTER + [ + ExecMethod = Execute ; + StateMethod = GetState ; + ] // The copy and paste slots are included here so that they later can be // disabled in order to remove them from context menus. diff -ru sd/source/ui/app/popup.src sd/source/ui/app/popup.src --- openoffice.org.orig/sd/source/ui/app/popup.src 2008-02-05 17:05:14.000000000 +0000 +++ openoffice.org/sd/source/ui/app/popup.src 2008-02-06 09:05:04.000000000 +0000 @@ -337,6 +337,12 @@ HelpID = SID_TP_SHOW_SMALL_PREVIEW; Text[ en-US ] = "Show S~mall Preview"; }; + MenuItem + { + Identifier = SID_TP_EDIT_MASTER; + HelpID = SID_TP_EDIT_MASTER; + Text[ en-US ] = "~Edit Master..."; + }; }; }; diff -ru sd/source/ui/toolpanel/controls/AllMasterPagesSelector.cxx sd/source/ui/toolpanel/controls/AllMasterPagesSelector.cxx --- openoffice.org.orig/sd/source/ui/toolpanel/controls/AllMasterPagesSelector.cxx 2008-02-05 17:05:15.000000000 +0000 +++ openoffice.org/sd/source/ui/toolpanel/controls/AllMasterPagesSelector.cxx 2008-02-06 14:01:07.000000000 +0000 @@ -44,6 +44,8 @@ #include #include +#include "app.hrc" + namespace { using namespace sd::toolpanel::controls; @@ -202,4 +204,13 @@ +void AllMasterPagesSelector::GetState (SfxItemSet& rItemSet) +{ + MasterPagesSelector::GetState (rItemSet); + rItemSet.DisableItem (SID_TP_EDIT_MASTER); +} + + + + } } } // end of namespace ::sd::toolpanel::controls diff -ru sd/source/ui/toolpanel/controls/AllMasterPagesSelector.hxx sd/source/ui/toolpanel/controls/AllMasterPagesSelector.hxx --- openoffice.org.orig/sd/source/ui/toolpanel/controls/AllMasterPagesSelector.hxx 2008-02-05 17:05:15.000000000 +0000 +++ openoffice.org/sd/source/ui/toolpanel/controls/AllMasterPagesSelector.hxx 2008-02-06 13:56:51.000000000 +0000 @@ -63,6 +63,7 @@ */ virtual void Fill (ItemList& rItemList); + virtual void GetState (SfxItemSet& rItemSet); protected: virtual void NotifyContainerChangeEvent (const MasterPageContainerChangeEvent& rEvent); diff -ru sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx --- openoffice.org.orig/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx 2008-02-05 17:05:15.000000000 +0000 +++ openoffice.org/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx 2008-02-06 16:28:56.000000000 +0000 @@ -39,6 +39,7 @@ #include "CurrentMasterPagesSelector.hxx" #include "PreviewValueSet.hxx" #include "ViewShellBase.hxx" +#include "DrawViewShell.hxx" #include "drawdoc.hxx" #include "sdpage.hxx" #include "MasterPageContainer.hxx" @@ -243,5 +244,12 @@ return 0; } +void CurrentMasterPagesSelector::GetState (SfxItemSet& rItemSet) +{ + MasterPagesSelector::GetState (rItemSet); + DrawViewShell* pDrawViewShell = dynamic_cast(mrBase.GetMainViewShell().get()); + if (pDrawViewShell && pDrawViewShell->GetEditMode() == EM_MASTERPAGE) + rItemSet.DisableItem (SID_TP_EDIT_MASTER); +} } } } // end of namespace ::sd::toolpanel::controls diff -ru sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.hxx sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.hxx --- openoffice.org.orig/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.hxx 2008-02-05 17:05:15.000000000 +0000 +++ openoffice.org/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.hxx 2008-02-06 14:20:20.000000000 +0000 @@ -72,6 +72,8 @@ */ virtual void Fill (ItemList& rItemList); + virtual void GetState (SfxItemSet& rItemSet); + using sd::toolpanel::controls::MasterPagesSelector::Fill; protected: diff -ru sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx --- openoffice.org.orig/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx 2008-02-05 17:05:15.000000000 +0000 +++ openoffice.org/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx 2008-02-06 16:28:52.000000000 +0000 @@ -599,6 +597,21 @@ break; } + case SID_TP_EDIT_MASTER: + using namespace ::sd::slidesorter; + using namespace ::sd::slidesorter::controller; + if (SlideSorterViewShell* pSlideSorter = SlideSorterViewShell::GetSlideSorter(mrBase)) + { + USHORT nIndex = mpPageSet->GetSelectItemId(); + SlideSorterController& rController = pSlideSorter->GetSlideSorterController(); + rController.PrepareEditModeChange(); + rController.ChangeEditMode ( EM_MASTERPAGE ); + rController.FinishEditModeChange(); + mpPageSet->SelectItem (nIndex); + rController.GetPageSelector().SetCurrentPage ( GetSelectedMasterPage() ); + } + break; + case SID_CUT: case SID_COPY: case SID_PASTE: diff -ru sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx --- openoffice.org.orig/sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx 2008-02-05 17:05:15.000000000 +0000 +++ openoffice.org/sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx 2008-02-06 13:56:58.000000000 +0000 @@ -106,7 +106,7 @@ virtual sal_Int32 GetMinimumWidth (void); void Execute (SfxRequest& rRequest); - void GetState (SfxItemSet& rItemSet); + virtual void GetState (SfxItemSet& rItemSet); /** Update the selection of previews according to whatever influences them appart from mouse and keyboard. If, for diff -ru sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx --- openoffice.org.orig/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx 2008-02-05 17:05:15.000000000 +0000 +++ openoffice.org/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx 2008-02-06 14:01:57.000000000 +0000 @@ -47,6 +47,8 @@ #include #include +#include "app.hrc" + namespace sd { namespace toolpanel { namespace controls { @@ -150,4 +152,16 @@ } } + + + +void RecentMasterPagesSelector::GetState (SfxItemSet& rItemSet) +{ + MasterPagesSelector::GetState (rItemSet); + rItemSet.DisableItem (SID_TP_EDIT_MASTER); +} + + + + } } } // end of namespace ::sd::toolpanel::controls diff -ru sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.hxx sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.hxx --- openoffice.org.orig/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.hxx 2008-02-05 17:05:15.000000000 +0000 +++ openoffice.org/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.hxx 2008-02-06 13:57:15.000000000 +0000 @@ -56,6 +56,8 @@ virtual void LateInit (void); + virtual void GetState (SfxItemSet& rItemSet); + protected: DECL_LINK(MasterPageListListener, void*); virtual void Fill (ItemList& rItemList);