officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu | 11 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 8 sd/Library_sd.mk | 1 sd/source/ui/animations/SlideTransitionPane.cxx | 2 sd/source/ui/controller/SlideTransitionsToolBoxControl.cxx | 111 ++++++++++ sd/source/ui/controller/SlideTransitionsToolBoxControl.hxx | 51 ++++ sd/uiconfig/simpress/ui/notebookbar_online.ui | 23 ++ sd/util/sd.component | 4 solenv/bin/native-code.py | 1 vcl/jsdialog/enabled.cxx | 5 vcl/source/window/builder.cxx | 3 vcl/workben/cgmfuzzer.cxx | 2 12 files changed, 219 insertions(+), 3 deletions(-)
New commits: commit 8e59e9b4fa916e702bb54b963e2cfd75cce1c0e9 Author: codewithvk <vivek.jav...@collabora.com> AuthorDate: Mon Jul 21 21:56:40 2025 +0530 Commit: Pedro Silva <pedro.si...@collabora.com> CommitDate: Wed Aug 6 16:22:04 2025 +0200 notebookbar: move slide transition pane - use interim builder to put wrapper into notebookbar - assign correct type = notebookbar - enable for notebookbar, disable for sidebar Signed-off-by: codewithvk <vivek.jav...@collabora.com> Change-Id: I42c1c92e74fd6c0f079738937c03d3f451080c10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188116 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@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 89fbd5d39931..ca6835d722b9 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -1082,6 +1082,17 @@ <prop oor:name="Controller"> <value>com.sun.star.comp.sd.InsertSlideController</value> </prop> + </node> + <node oor:name="SlideTransitionsPane" oor:op="replace"> + <prop oor:name="Command"> + <value>.uno:SlideTransitionsPane</value> + </prop> + <prop oor:name="Module"> + <value>com.sun.star.presentation.PresentationDocument</value> + </prop> + <prop oor:name="Controller"> + <value>com.sun.star.comp.sd.SlideTransitionsToolBoxControl</value> + </prop> </node> <node oor:name="NumberingToolBox" oor:op="replace"> <prop oor:name="Command"> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 3064d506f95b..00474669ec90 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -3131,6 +3131,14 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 <value>1</value> </prop> </node> + <node oor:name=".uno:SlideTransitionsPane" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Slide Transitions</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:AddDateField" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Date Field</value> diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index a05aba888eb6..cc88f516184e 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -227,6 +227,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ sd/source/ui/app/scalectrl \ sd/source/ui/controller/slidelayoutcontroller \ sd/source/ui/controller/displaymodecontroller \ + sd/source/ui/controller/SlideTransitionsToolBoxControl \ sd/source/ui/dlg/AnimationChildWindow \ sd/source/ui/dlg/LayerTabBar \ sd/source/ui/dlg/NavigatorChildWindow \ diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 1ab9ca44ab0c..59891b1d8a8b 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -363,7 +363,7 @@ sd::TransitionPresetPtr getPreset(const sd::impl::TransitionEffect &rEffect) SlideTransitionPane::SlideTransitionPane( weld::Widget* pParent, ViewShellBase & rBase) : - PanelLayout( pParent, u"SlideTransitionsPanel"_ustr, u"modules/simpress/ui/slidetransitionspanel.ui"_ustr ), + PanelLayout( pParent, u"SlideTransitionsPanel"_ustr, u"modules/simpress/ui/slidetransitionspanel.ui"_ustr, reinterpret_cast<sal_uInt64>(SfxViewShell::Current())), mrBase( rBase ), mpDrawDoc( rBase.GetDocShell() ? rBase.GetDocShell()->GetDoc() : nullptr ), mxTransitionsIconView(m_xBuilder->weld_icon_view("transitions_icons")), diff --git a/sd/source/ui/controller/SlideTransitionsToolBoxControl.cxx b/sd/source/ui/controller/SlideTransitionsToolBoxControl.cxx new file mode 100644 index 000000000000..0b76fee99d00 --- /dev/null +++ b/sd/source/ui/controller/SlideTransitionsToolBoxControl.cxx @@ -0,0 +1,111 @@ +#include <cppuhelper/supportsservice.hxx> +#include <vcl/svapp.hxx> +#include <toolkit/helper/vclunohelper.hxx> +#include <SlideTransitionPane.hxx> +#include <ViewShellBase.hxx> +#include <sfx2/viewsh.hxx> +#include "SlideTransitionsToolBoxControl.hxx" + +SlideTransitionsToolBoxControl::SlideTransitionsToolBoxControl() {} + +SlideTransitionsToolBoxControl::~SlideTransitionsToolBoxControl() {} + +void SAL_CALL +SlideTransitionsToolBoxControl::initialize(const css::uno::Sequence<css::uno::Any>& rArguments) +{ + SAL_INFO("sd", "initialize called for TransitionToolBoxControl"); + + svt::ToolboxController::initialize(rArguments); +} + +void SAL_CALL SlideTransitionsToolBoxControl::dispose() +{ + SolarMutexGuard aSolarMutexGuard; + m_xTransitionPane.reset(); + m_xVclBox.disposeAndClear(); + svt::ToolboxController::dispose(); +} + +void SAL_CALL +SlideTransitionsToolBoxControl::statusChanged(const css::frame::FeatureStateEvent& /*rEvent*/) +{ + // Handle status changes if needed +} + +css::uno::Reference<css::awt::XWindow> SlideTransitionsToolBoxControl::createItemWindow( + const css::uno::Reference<css::awt::XWindow>& rParent) +{ + css::uno::Reference<css::awt::XWindow> xItemWindow; + SAL_INFO("sd", "createItemWindow called for SlideTransitionsToolBoxControl"); + + 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<SlideTransitionsPaneWrapper>::Create(pParent, *pViewShellBase); + xItemWindow = VCLUnoHelper::GetInterface(m_xVclBox.get()); + } + } + SAL_INFO("sd", "createItemWindow called for TransitionToolBoxControl"); + + return xItemWindow; +} + +void SAL_CALL SlideTransitionsToolBoxControl::update() +{ + // Update logic if needed +} + +OUString SAL_CALL SlideTransitionsToolBoxControl::getImplementationName() +{ + return u"com.sun.star.comp.sd.SlideTransitionsToolBoxControl"_ustr; +} + +sal_Bool SAL_CALL SlideTransitionsToolBoxControl::supportsService(const OUString& rServiceName) +{ + return cppu::supportsService(this, rServiceName); +} + +css::uno::Sequence<OUString> SAL_CALL SlideTransitionsToolBoxControl::getSupportedServiceNames() +{ + return { u"com.sun.star.frame.ToolbarController"_ustr }; +} + +// Export function for service registration +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_sd_SlideTransitionsToolBoxControl_get_implementation( + css::uno::XComponentContext* /*rxContext*/, css::uno::Sequence<css::uno::Any> const&) +{ + return cppu::acquire(new SlideTransitionsToolBoxControl()); +} + +SlideTransitionsPaneWrapper::SlideTransitionsPaneWrapper(vcl::Window* pParent, + sd::ViewShellBase& rBase) + : InterimItemWindow(pParent, u"modules/simpress/ui/slidetransitionspanel.ui"_ustr, + u"SlideTransitionsPanel"_ustr, true, + reinterpret_cast<sal_uInt64>(SfxViewShell::Current())) +{ + // Create SlideTransitionsPane with the container widget + m_xTransitionPane = std::make_unique<sd::SlideTransitionPane>(m_xContainer.get(), rBase); + SetOptimalSize(); + SAL_INFO("sd", "SlideTransitionsPaneWrapper created with SlideTransitionsPane"); +} + +SlideTransitionsPaneWrapper::~SlideTransitionsPaneWrapper() { disposeOnce(); } +void SlideTransitionsPaneWrapper::SetOptimalSize() { SetSizePixel(GetOptimalSize()); } + +void SlideTransitionsPaneWrapper::dispose() +{ + SAL_INFO("sd", "SlideTransitionsPaneWrapper dispose "); + m_xTransitionPane.reset(); + InterimItemWindow::dispose(); +} diff --git a/sd/source/ui/controller/SlideTransitionsToolBoxControl.hxx b/sd/source/ui/controller/SlideTransitionsToolBoxControl.hxx new file mode 100644 index 000000000000..7a4da7a79d41 --- /dev/null +++ b/sd/source/ui/controller/SlideTransitionsToolBoxControl.hxx @@ -0,0 +1,51 @@ +#include <svtools/toolboxcontroller.hxx> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <vcl/vclptr.hxx> +#include <SlideTransitionPane.hxx> +#include <vcl/InterimItemWindow.hxx> + +// Used to put transition pane to the notebookbar + +class SlideTransitionsPaneWrapper final : public InterimItemWindow +{ +private: + std::unique_ptr<sd::SlideTransitionPane> m_xTransitionPane; + +public: + SlideTransitionsPaneWrapper(vcl::Window* pParent, sd::ViewShellBase& rBase); + virtual ~SlideTransitionsPaneWrapper() override; + virtual void dispose() override; + void SetOptimalSize(); // Add this method +}; + +class SlideTransitionsToolBoxControl final + : public cppu::ImplInheritanceHelper<svt::ToolboxController, css::lang::XServiceInfo> +{ + VclPtr<SlideTransitionsPaneWrapper> m_xVclBox; + std::unique_ptr<sd::SlideTransitionPane> m_xTransitionPane; + +public: + SlideTransitionsToolBoxControl(); + virtual ~SlideTransitionsToolBoxControl() 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; + + // XUpdatable + virtual void SAL_CALL update() 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 7fe79d180a0f..e11161c598f2 100644 --- a/sd/uiconfig/simpress/ui/notebookbar_online.ui +++ b/sd/uiconfig/simpress/ui/notebookbar_online.ui @@ -35,6 +35,29 @@ <property name="position">0</property> </packing> </child> + <child> + <object class="sfxlo-NotebookbarToolBox" id="slide_transitions_pane"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="margin_start">5</property> + <child> + <object class="GtkToolButton" id="Transitions-SlideTransitionsPane"> + <property name="visible">True</property> + <property name="action_name">.uno:SlideTransitionsPane</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 24f54893bbd6..296b828bba66 100644 --- a/sd/util/sd.component +++ b/sd/util/sd.component @@ -57,6 +57,10 @@ constructor="com_sun_star_comp_sd_InsertSlideController_get_implementation"> <service name="com.sun.star.frame.ToolbarController"/> </implementation> + <implementation name="com.sun.star.comp.sd.SlideTransitionsToolBoxControl" + constructor="com_sun_star_comp_sd_SlideTransitionsToolBoxControl_get_implementation"> + <service name="com.sun.star.frame.ToolbarController"/> + </implementation> <implementation name="com.sun.star.comp.sd.SlideLayoutController" constructor="com_sun_star_comp_sd_SlideLayoutController_get_implementation"> <service name="com.sun.star.frame.ToolbarController"/> diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index efc2db77ecff..7e16fe3201f5 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -701,6 +701,7 @@ draw_constructor_list = [ "com_sun_star_comp_sd_InsertSlideController_get_implementation", "com_sun_star_comp_sd_SlideLayoutController_get_implementation", "com_sun_star_comp_sd_DisplayModeController_get_implementation", + "com_sun_star_comp_sd_SlideTransitionsToolBoxControl_get_implementation", "RandomAnimationNode_get_implementation", "com_sun_star_comp_Draw_framework_ResourceID_get_implementation", "org_openoffice_comp_Draw_framework_PanelFactory_get_implementation", diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 6cf67c68e372..3b20c2165457 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -418,7 +418,6 @@ constexpr auto SidebarList { u"modules/simpress/ui/masterpagepanelall.ui" }, { u"modules/simpress/ui/masterpagepanelrecent.ui" }, { u"modules/simpress/ui/sidebarslidebackground.ui" }, - { u"modules/simpress/ui/slidetransitionspanel.ui" }, { u"modules/simpress/ui/tabledesignpanel.ui" }, // smath { u"modules/smath/ui/sidebarelements_math.ui" }, @@ -480,7 +479,9 @@ constexpr auto NotebookbarList { u"modules/scalc/ui/numberbox.ui" }, { u"svx/ui/fontnamebox.ui" }, { u"svx/ui/fontsizebox.ui" }, - { u"svx/ui/stylespreview.ui" } + { u"svx/ui/stylespreview.ui" }, + // not interim builder, but regular builder: + { u"modules/simpress/ui/slidetransitionspanel.ui" } }); // ========== ADDRESSINPUT ================================================ // diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 5c75a23f6e49..c181a2bf8f2d 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -199,6 +199,9 @@ std::unique_ptr<weld::Builder> Application::CreateBuilder(weld::Widget* pParent, return JSInstanceBuilder::CreateSidebarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, "quickfind", nLOKWindowId); else if (jsdialog::isBuilderEnabled(rUIFile, bMobile)) return JSInstanceBuilder::CreateDialogBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile); + // this is notebookbar widget but converted from sidebar panel + else if (jsdialog::isInterimBuilderEnabledForNotebookbar(rUIFile)) + return JSInstanceBuilder::CreateSidebarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, "notebookbar", nLOKWindowId); else SAL_WARN("vcl", "UI file not enabled for JSDialogs: " << rUIFile); } diff --git a/vcl/workben/cgmfuzzer.cxx b/vcl/workben/cgmfuzzer.cxx index 993937adba53..5b8e075341f9 100644 --- a/vcl/workben/cgmfuzzer.cxx +++ b/vcl/workben/cgmfuzzer.cxx @@ -64,6 +64,7 @@ void com_sun_star_comp_Draw_SlideRenderer_get_implementation( void ); void com_sun_star_comp_sd_InsertSlideController_get_implementation( void ); void com_sun_star_comp_sd_SlideLayoutController_get_implementation( void ); void com_sun_star_comp_sd_DisplayModeController_get_implementation( void ); +void com_sun_star_comp_sd_SlideTransitionsToolBoxControl_get_implementation( void ); void ucb_UcbCommandEnvironment_get_implementation( void ); void ucb_UcbContentProviderProxyFactory_get_implementation( void ); void ucb_UcbPropertiesManager_get_implementation( void ); @@ -134,6 +135,7 @@ lo_get_constructor_map(void) { "com_sun_star_comp_sd_InsertSlideController_get_implementation", com_sun_star_comp_sd_InsertSlideController_get_implementation }, { "com_sun_star_comp_sd_SlideLayoutController_get_implementation", com_sun_star_comp_sd_SlideLayoutController_get_implementation }, { "com_sun_star_comp_sd_DisplayModeController_get_implementation", com_sun_star_comp_sd_DisplayModeController_get_implementation }, + { "com_sun_star_comp_sd_SlideTransitionsToolBoxControl_get_implementation", com_sun_star_comp_sd_SlideTransitionsToolBoxControl_get_implementation }, { "ucb_UcbCommandEnvironment_get_implementation", ucb_UcbCommandEnvironment_get_implementation, }, { "ucb_UcbContentProviderProxyFactory_get_implementation", ucb_UcbContentProviderProxyFactory_get_implementation }, { "ucb_UcbPropertiesManager_get_implementation", ucb_UcbPropertiesManager_get_implementation },