officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu | 11 + officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 9 sd/Library_sd.mk | 1 sd/source/ui/sidebar/AllMasterPagesSelector.cxx | 33 +++ sd/source/ui/sidebar/AllMasterPagesSelector.hxx | 14 + sd/source/ui/sidebar/MasterPagesSelector.cxx | 22 ++ sd/source/ui/sidebar/MasterPagesSelector.hxx | 7 sd/source/ui/sidebar/SlideMasterPagesAllToolBoxControl.cxx | 110 ++++++++++ sd/source/ui/sidebar/SlideMasterPagesAllToolBoxControl.hxx | 47 ++++ sd/uiconfig/simpress/ui/notebookbar_online.ui | 24 ++ sd/util/sd.component | 4 vcl/jsdialog/enabled.cxx | 5 12 files changed, 284 insertions(+), 3 deletions(-)
New commits: commit bdcd34e7c0e11fd56d45670a42ae0ab6b4668381 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Fri Aug 22 14:00:10 2025 +0000 Commit: Pedro Silva <pedro.si...@collabora.com> CommitDate: Mon Aug 25 10:41:48 2025 +0200 jsdialog: enable master page context menu it can be found in sidebar's widget on master slide deck, when user right clicks on a template Change-Id: I16ba749f4f8d9a877e713713a69dce68362aaa53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190072 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Pedro Silva <pedro.si...@collabora.com> Tested-by: Pedro Silva <pedro.si...@collabora.com> diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index b3b39bc3cf1e..9e28232eeed3 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -393,6 +393,7 @@ constexpr auto PopupList constexpr auto MenuList = frozen::make_unordered_set<std::u16string_view>({ { u"sfx/ui/stylecontextmenu.ui" }, + { u"modules/simpress/ui/mastermenu.ui" }, { u"modules/simpress/ui/layoutmenu.ui" } }); commit f7192928b6fd9fde2dd4a2bc029d8d98da40a087 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Fri Aug 22 08:43:53 2025 +0000 Commit: Pedro Silva <pedro.si...@collabora.com> CommitDate: Mon Aug 25 10:41:40 2025 +0200 notebookbar: move master slides pane from sidebar - move it to the notebookbar for LOK case use Change-Id: I439efb7db55e06b37a54497642c763522299d048 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190049 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Pedro Silva <pedro.si...@collabora.com> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index f95999d055bf..127bb38bf197 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -1105,6 +1105,17 @@ <value>com.sun.star.comp.svx.NumberingToolBoxControl</value> </prop> </node> + <node oor:name="SlideMasterPagesAll" oor:op="replace"> + <prop oor:name="Command"> + <value>.uno:SlideMasterPagesAll</value> + </prop> + <prop oor:name="Module"> + <value>com.sun.star.presentation.PresentationDocument</value> + </prop> + <prop oor:name="Controller"> + <value>com.sun.star.comp.sd.SlideMasterPagesAllToolBoxControl</value> + </prop> + </node> <node oor:name="BulletsToolBox" oor:op="replace"> <prop oor:name="Command"> <value>.uno:DefaultBullet</value> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 490cb4de4c76..effdca00d2c2 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -3147,6 +3147,15 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 <value>1</value> </prop> </node> + <node oor:name=".uno:SlideMasterPagesAll" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Master Pages</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertTimeField" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Time Field</value> diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index cc88f516184e..e340d8b18c73 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -367,6 +367,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ sd/source/ui/sidebar/RecentlyUsedMasterPages \ sd/source/ui/sidebar/RecentMasterPagesSelector \ sd/source/ui/sidebar/SlideBackground \ + sd/source/ui/sidebar/SlideMasterPagesAllToolBoxControl \ sd/source/ui/slideshow/PaneHider \ sd/source/ui/slideshow/SlideShowRestarter \ sd/source/ui/slideshow/showwin \ diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx index fdd8ea4618f8..e966d2a8a851 100644 --- a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx @@ -97,6 +97,27 @@ std::unique_ptr<PanelLayout> AllMasterPagesSelector::Create ( return xSelector; } +std::unique_ptr<PanelLayout> AllMasterPagesSelector::Create ( + weld::Widget* pParent, + ViewShellBase& rViewShellBase) +{ + SdDrawDocument* pDocument = rViewShellBase.GetDocument(); + if (pDocument == nullptr) + return nullptr; + + auto pContainer = std::make_shared<MasterPageContainer>(); + + auto xSelector(std::make_unique<AllMasterPagesSelector>( + pParent, + *pDocument, + rViewShellBase, + pContainer)); + xSelector->LateInit(); + xSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_ALL); + + return xSelector; +} + AllMasterPagesSelector::AllMasterPagesSelector( weld::Widget* pParent, SdDrawDocument& rDocument, ViewShellBase& rBase, const std::shared_ptr<MasterPageContainer>& rpContainer, @@ -109,6 +130,18 @@ AllMasterPagesSelector::AllMasterPagesSelector( MasterPagesSelector::Fill(); } +AllMasterPagesSelector::AllMasterPagesSelector( + weld::Widget* pParent, SdDrawDocument& rDocument, ViewShellBase& rBase, + const std::shared_ptr<MasterPageContainer>& rpContainer) + : MasterPagesSelector(pParent, rDocument, rBase, rpContainer, + u"modules/simpress/ui/masterpagepanelall.ui"_ustr, + u"masterpageall_icons"_ustr) + , mpSortedMasterPages(new SortedMasterPageDescriptorList()) +{ + MasterPagesSelector::Fill(); +} + + AllMasterPagesSelector::~AllMasterPagesSelector() { } diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.hxx b/sd/source/ui/sidebar/AllMasterPagesSelector.hxx index 982a2ec5211f..8bfd34bf17be 100644 --- a/sd/source/ui/sidebar/AllMasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/AllMasterPagesSelector.hxx @@ -38,12 +38,26 @@ public: ViewShellBase& rViewShellBase, const css::uno::Reference<css::ui::XSidebar>& rxSidebar); + static std::unique_ptr<PanelLayout> Create ( + weld::Widget* pParent, + ViewShellBase& rViewShellBase); + + // Sidebar AllMasterPagesSelector ( weld::Widget* pParent, SdDrawDocument& rDocument, ViewShellBase& rBase, const std::shared_ptr<MasterPageContainer>& rpContainer, const css::uno::Reference<css::ui::XSidebar>& rxSidebar); + + // Notebookbar + AllMasterPagesSelector ( + weld::Widget* pParent, + SdDrawDocument& rDocument, + ViewShellBase& rBase, + const std::shared_ptr<MasterPageContainer>& rpContainer); + + virtual ~AllMasterPagesSelector() override; diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index e8be353bd53e..70b12025ab46 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -49,6 +49,7 @@ namespace sd::sidebar { */ constexpr OUStringLiteral gsDefaultClickAction = u"applyselect"; +// Sidebar MasterPagesSelector::MasterPagesSelector(weld::Widget* pParent, SdDrawDocument& rDocument, ViewShellBase& rBase, std::shared_ptr<MasterPageContainer> pContainer, @@ -70,6 +71,27 @@ MasterPagesSelector::MasterPagesSelector(weld::Widget* pParent, SdDrawDocument& mpContainer->AddChangeListener(aChangeListener); } +// Notebookbar +MasterPagesSelector::MasterPagesSelector(weld::Widget* pParent, SdDrawDocument& rDocument, + ViewShellBase& rBase, + std::shared_ptr<MasterPageContainer> pContainer, + const OUString& rUIFileName, const OUString& rIconViewId) + : PanelLayout(pParent, u"MasterPagePanel"_ustr, rUIFileName) + , mpContainer(std::move(pContainer)) + , mxPreviewIconView(m_xBuilder->weld_icon_view(rIconViewId)) + , mrDocument(rDocument) + , mrBase(rBase) + , maIconViewId(rIconViewId) +{ + mxPreviewIconView->connect_item_activated(LINK(this, MasterPagesSelector, MasterPageSelected)); + mxPreviewIconView->connect_mouse_press(LINK(this, MasterPagesSelector, MousePressHdl)); + mxPreviewIconView->connect_query_tooltip(LINK(this, MasterPagesSelector, QueryTooltipHdl)); + + Link<MasterPageContainerChangeEvent&,void> aChangeListener (LINK(this,MasterPagesSelector,ContainerChangeListener)); + mpContainer->AddChangeListener(aChangeListener); +} + + MasterPagesSelector::~MasterPagesSelector() { Clear(); diff --git a/sd/source/ui/sidebar/MasterPagesSelector.hxx b/sd/source/ui/sidebar/MasterPagesSelector.hxx index 3eaf9851e317..8bb65d068150 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.hxx @@ -49,10 +49,17 @@ class MasterPagesSelector : public PanelLayout , public sfx2::sidebar::ILayoutableWindow { public: + // Sidebar MasterPagesSelector(weld::Widget* pParent, SdDrawDocument& rDocument, ViewShellBase& rBase, std::shared_ptr<MasterPageContainer> pContainer, css::uno::Reference<css::ui::XSidebar> xSidebar, const OUString& rUIFileName, const OUString& rIconViewId); + + // Notebookbar + MasterPagesSelector(weld::Widget* pParent, SdDrawDocument& rDocument, ViewShellBase& rBase, + std::shared_ptr<MasterPageContainer> pContainer, + const OUString& rUIFileName, const OUString& rIconViewId); + virtual ~MasterPagesSelector() override; virtual void LateInit(); diff --git a/sd/source/ui/sidebar/SlideMasterPagesAllToolBoxControl.cxx b/sd/source/ui/sidebar/SlideMasterPagesAllToolBoxControl.cxx new file mode 100644 index 000000000000..e802f0b281c6 --- /dev/null +++ b/sd/source/ui/sidebar/SlideMasterPagesAllToolBoxControl.cxx @@ -0,0 +1,110 @@ +#include <cppuhelper/supportsservice.hxx> +#include <vcl/svapp.hxx> +#include <toolkit/helper/vclunohelper.hxx> +#include <ViewShellBase.hxx> +#include <sfx2/viewsh.hxx> +#include "MasterPageContainer.hxx" +#include "AllMasterPagesSelector.hxx" +#include "SlideMasterPagesAllToolBoxControl.hxx" + +SlideMasterPagesAllToolBoxControl::SlideMasterPagesAllToolBoxControl() {} + +SlideMasterPagesAllToolBoxControl::~SlideMasterPagesAllToolBoxControl() {} + +void SAL_CALL +SlideMasterPagesAllToolBoxControl::initialize(const css::uno::Sequence<css::uno::Any>& rArguments) +{ + SAL_INFO("sd", "initialize called for SlideMasterPagesAllToolBoxControl"); + + svt::ToolboxController::initialize(rArguments); +} + +void SAL_CALL +SlideMasterPagesAllToolBoxControl::statusChanged(const css::frame::FeatureStateEvent& /*rEvent*/) +{ + // Handle status changes if needed +} + +void SAL_CALL SlideMasterPagesAllToolBoxControl::dispose() +{ + SolarMutexGuard aSolarMutexGuard; + m_xVclBox.disposeAndClear(); + svt::ToolboxController::dispose(); +} + +css::uno::Reference<css::awt::XWindow> SlideMasterPagesAllToolBoxControl::createItemWindow( + const css::uno::Reference<css::awt::XWindow>& rParent) +{ + css::uno::Reference<css::awt::XWindow> xItemWindow; + SAL_INFO("sd", "createItemWindow called for SlideMasterPagesAllToolBoxControl"); + + VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow(rParent); + if (pParent) + { + SolarMutexGuard aSolarMutexGuard; + + sd::ViewShellBase* pViewShellBase = nullptr; + if (SfxViewShell* pViewShell = SfxViewShell::Current()) + { + pViewShellBase = dynamic_cast<sd::ViewShellBase*>(pViewShell); + } + + if (pViewShellBase) + { + m_xVclBox = VclPtr<SlideMasterPagesAllWrapper>::Create(pParent, *pViewShellBase); + xItemWindow = VCLUnoHelper::GetInterface(m_xVclBox.get()); + } + } + SAL_INFO("sd", "createItemWindow called for SlideMasterPagesAllToolBoxControl"); + + return xItemWindow; +} + +OUString SAL_CALL SlideMasterPagesAllToolBoxControl::getImplementationName() +{ + return u"com.sun.star.comp.sd.SlideMasterPagesAllToolBoxControl"_ustr; +} + +css::uno::Sequence<OUString> SAL_CALL SlideMasterPagesAllToolBoxControl::getSupportedServiceNames() +{ + return { u"com.sun.star.frame.ToolbarController"_ustr }; +} + +sal_Bool SAL_CALL SlideMasterPagesAllToolBoxControl::supportsService(const OUString& rServiceName) +{ + return cppu::supportsService(this, rServiceName); +} + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_sd_SlideMasterPagesAllToolBoxControl_get_implementation( + css::uno::XComponentContext* /*rxContext*/, css::uno::Sequence<css::uno::Any> const&) +{ + return cppu::acquire(new SlideMasterPagesAllToolBoxControl()); +} + +SlideMasterPagesAllWrapper::SlideMasterPagesAllWrapper(vcl::Window* pParent, + sd::ViewShellBase& rBase) + : InterimItemWindow(pParent, u"modules/simpress/ui/masterpagepanelall.ui"_ustr, + u"MasterPagePanel"_ustr, true, + reinterpret_cast<sal_uInt64>(SfxViewShell::Current())) +{ + SdDrawDocument* pDocument = rBase.GetDocument(); + if (pDocument == nullptr) + SAL_INFO("sd", "SlideMasterPagesAllWrapper got null SdDrawDocument"); + + m_xPane = std::make_unique<sd::sidebar::AllMasterPagesSelector>( + m_xContainer.get(), *pDocument, rBase, + std::make_shared<sd::sidebar::MasterPageContainer>()); + SetOptimalSize(); + SAL_INFO("sd", "SlideMasterPagesAllWrapper created"); +} + +SlideMasterPagesAllWrapper::~SlideMasterPagesAllWrapper() { disposeOnce(); } +void SlideMasterPagesAllWrapper::SetOptimalSize() { SetSizePixel(GetOptimalSize()); } + +void SlideMasterPagesAllWrapper::dispose() +{ + SAL_INFO("sd", "SlideMasterPagesAllWrapper dispose "); + m_xPane.reset(); + InterimItemWindow::dispose(); +} diff --git a/sd/source/ui/sidebar/SlideMasterPagesAllToolBoxControl.hxx b/sd/source/ui/sidebar/SlideMasterPagesAllToolBoxControl.hxx new file mode 100644 index 000000000000..7a1580411cef --- /dev/null +++ b/sd/source/ui/sidebar/SlideMasterPagesAllToolBoxControl.hxx @@ -0,0 +1,47 @@ +#include <svtools/toolboxcontroller.hxx> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <vcl/vclptr.hxx> +#include "AllMasterPagesSelector.hxx" +#include <vcl/InterimItemWindow.hxx> + +// Used to put transition pane to the notebookbar + +class SlideMasterPagesAllWrapper final : public InterimItemWindow +{ +private: + std::unique_ptr<sd::sidebar::AllMasterPagesSelector> m_xPane; + +public: + SlideMasterPagesAllWrapper(vcl::Window* pParent, sd::ViewShellBase& rBase); + virtual ~SlideMasterPagesAllWrapper() override; + virtual void dispose() override; + void SetOptimalSize(); +}; + +class SlideMasterPagesAllToolBoxControl final + : public cppu::ImplInheritanceHelper<svt::ToolboxController, css::lang::XServiceInfo> +{ + VclPtr<SlideMasterPagesAllWrapper> m_xVclBox; + +public: + SlideMasterPagesAllToolBoxControl(); + virtual ~SlideMasterPagesAllToolBoxControl() override; + + // XStatusListener + virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& rEvent) override; + + // XToolbarController + virtual css::uno::Reference<css::awt::XWindow> + SAL_CALL createItemWindow(const css::uno::Reference<css::awt::XWindow>& rParent) override; + + // XInitialization + virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override; + + // XComponent + virtual void SAL_CALL dispose() override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; +}; diff --git a/sd/uiconfig/simpress/ui/notebookbar_online.ui b/sd/uiconfig/simpress/ui/notebookbar_online.ui index e11161c598f2..745efe6ab570 100644 --- a/sd/uiconfig/simpress/ui/notebookbar_online.ui +++ b/sd/uiconfig/simpress/ui/notebookbar_online.ui @@ -58,6 +58,30 @@ <property name="position">2</property> </packing> </child> + <child> + <object class="sfxlo-NotebookbarToolBox" id="master_slide_pane"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="margin_start">5</property> + <child> + <object class="GtkToolButton" id="MasterSlide-MasterSlidePane"> + <property name="visible">True</property> + <property name="action_name">.uno:SlideMasterPagesAll</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> <object class="sfxlo-NotebookbarToolBox" id="fontheight"> <property name="visible">True</property> diff --git a/sd/util/sd.component b/sd/util/sd.component index 296b828bba66..e20b1ebbcebb 100644 --- a/sd/util/sd.component +++ b/sd/util/sd.component @@ -53,6 +53,10 @@ constructor="org_openoffice_comp_Draw_framework_PanelFactory_get_implementation"> <service name="com.sun.star.drawing.framework.PanelFactory"/> </implementation> + <implementation name="com.sun.star.comp.sd.SlideMasterPagesAllToolBoxControl" + constructor="com_sun_star_comp_sd_SlideMasterPagesAllToolBoxControl_get_implementation"> + <service name="com.sun.star.frame.ToolbarController"/> + </implementation> <implementation name="com.sun.star.comp.sd.InsertSlideController" constructor="com_sun_star_comp_sd_InsertSlideController_get_implementation"> <service name="com.sun.star.frame.ToolbarController"/> diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 13d94e02cd2f..b3b39bc3cf1e 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -417,9 +417,6 @@ constexpr auto SidebarList { u"modules/simpress/ui/customanimationfragment.ui" }, { u"modules/simpress/ui/customanimationspanel.ui" }, { u"modules/simpress/ui/layoutpanel.ui" }, - { u"modules/simpress/ui/masterpagepanel.ui" }, - { u"modules/simpress/ui/masterpagepanelall.ui" }, - { u"modules/simpress/ui/masterpagepanelrecent.ui" }, { u"modules/simpress/ui/sidebarslidebackground.ui" }, { u"modules/simpress/ui/tabledesignpanel.ui" }, // smath @@ -484,6 +481,7 @@ constexpr auto NotebookbarList { u"svx/ui/fontsizebox.ui" }, { u"svx/ui/stylespreview.ui" }, // not interim builder, but regular builder: + { u"modules/simpress/ui/masterpagepanelall.ui" }, { u"modules/simpress/ui/slidetransitionspanel.ui" } });