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 bb3316dfadd903afa090107ffbdf8f9ae4d7275b Author: codewithvk <[email protected]> AuthorDate: Mon Jul 21 21:56:40 2025 +0530 Commit: Szymon Kłos <[email protected]> CommitDate: Mon Sep 15 18:52:56 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 <[email protected]> Change-Id: I42c1c92e74fd6c0f079738937c03d3f451080c10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188116 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> (cherry picked from commit 8e59e9b4fa916e702bb54b963e2cfd75cce1c0e9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190223 Tested-by: Jenkins diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index 7e875941d828..c358d6666a30 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 088a793565d8..606109cb1549 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -3488,6 +3488,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 d4a8c3a277a3..2244355494e5 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -228,6 +228,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 fc4034f2ab1a..dfff11e8de8c 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 db21e447f433..2a6e96288fdc 100644 --- a/sd/util/sd.component +++ b/sd/util/sd.component @@ -41,6 +41,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 7e77d45b4dc3..3976c02fdb06 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -696,6 +696,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", "org_openoffice_comp_Draw_framework_PanelFactory_get_implementation", "css_comp_Impress_oox_PowerPointExport", diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 530a21e5ad5c..386dee0dffbc 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -412,7 +412,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" }, @@ -467,7 +466,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 9e067b668493..4b6b8d2da189 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, "navigator", 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 7d2509d55de2..ee794d2f6573 100644 --- a/vcl/workben/cgmfuzzer.cxx +++ b/vcl/workben/cgmfuzzer.cxx @@ -61,6 +61,7 @@ void sd_PresentationDocument_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 ); @@ -128,6 +129,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 },
