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/CurrentMasterPagesSelector.cxx | 5 sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx | 3 sd/source/ui/sidebar/MasterPagesSelector.cxx | 21 + 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 | 4 14 files changed, 287 insertions(+), 6 deletions(-)
New commits: commit 4be6560cfaff53127805a8ca3c1bf0ace95f6ee8 Author: Szymon Kłos <[email protected]> AuthorDate: Tue Aug 26 08:14:24 2025 +0000 Commit: Szymon Kłos <[email protected]> CommitDate: Mon Dec 29 10:41:42 2025 +0100 notebookbar: correctly remove listeners in master page selector followup for commit f7192928b6fd9fde2dd4a2bc029d8d98da40a087 notebookbar: move master slides pane from sidebar Change-Id: Ief0eef0066538475bbae925802d700580085daa3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190203 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196278 Reviewed-by: Szymon Kłos <[email protected]> Tested-by: Jenkins diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx index 40f387396019..3efa26e7a34e 100644 --- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx @@ -70,7 +70,8 @@ CurrentMasterPagesSelector::CurrentMasterPagesSelector( { Link<sdtools::EventMultiplexerEvent&, void> aLink( LINK(this, CurrentMasterPagesSelector, EventMultiplexerListener)); - rBase.GetEventMultiplexer()->AddEventListener(aLink); + mpEventMultiplexer = rBase.GetEventMultiplexer(); + mpEventMultiplexer->AddEventListener(aLink); } CurrentMasterPagesSelector::~CurrentMasterPagesSelector() @@ -85,7 +86,7 @@ CurrentMasterPagesSelector::~CurrentMasterPagesSelector() } Link<sdtools::EventMultiplexerEvent&,void> aLink (LINK(this,CurrentMasterPagesSelector,EventMultiplexerListener)); - mrBase.GetEventMultiplexer()->RemoveEventListener(aLink); + mpEventMultiplexer->RemoveEventListener(aLink); } void CurrentMasterPagesSelector::LateInit() diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx index 5a09a3b1822b..b63208743c2e 100644 --- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx @@ -23,7 +23,7 @@ #include "MasterPagesSelector.hxx" -namespace sdtools { class EventMultiplexerEvent; } +namespace sdtools { class EventMultiplexer; class EventMultiplexerEvent; } namespace sd::sidebar { @@ -70,6 +70,7 @@ private: virtual void LateInit() override; DECL_LINK(EventMultiplexerListener,sdtools::EventMultiplexerEvent&, void); + std::shared_ptr<sdtools::EventMultiplexer> mpEventMultiplexer; }; } // end of namespace sd::sidebar commit 3e257b6b836766abfeec72e6db9a3e453788902a Author: Szymon Kłos <[email protected]> AuthorDate: Fri Aug 22 08:43:53 2025 +0000 Commit: Szymon Kłos <[email protected]> CommitDate: Mon Dec 29 10:41:33 2025 +0100 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 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196277 Tested-by: Jenkins Reviewed-by: Szymon Kłos <[email protected]> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index c358d6666a30..5d1209b5459c 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 e23423904154..006c711018b8 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -3531,6 +3531,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 d1bf7fc19297..4c6140046464 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -370,6 +370,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 e34e837efc60..dce62ce61807 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -50,6 +50,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,26 @@ 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) +{ + mxPreviewIconView->connect_item_activated(LINK(this, MasterPagesSelector, MasterPageSelected)); + mxPreviewIconView->connect_command(LINK(this, MasterPagesSelector, CommandHdl)); + 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 0771210e477f..bfcab7eb23aa 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.hxx @@ -50,10 +50,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 2b89d0af1393..e876e27c2ad3 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 2a6e96288fdc..2c7f94763b24 100644 --- a/sd/util/sd.component +++ b/sd/util/sd.component @@ -37,6 +37,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 8671cfa26f2f..6dfe480fe3b2 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -425,9 +425,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 @@ -495,6 +492,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" } });
