dbaccess/Library_dbahsql.mk | 1 dbaccess/source/ui/misc/databaseobjectview.cxx | 6 ++-- embeddedobj/Library_embobj.mk | 1 embeddedobj/source/general/docholder.cxx | 19 +++++++------- embeddedobj/source/inc/docholder.hxx | 6 ++-- framework/inc/classes/taskcreator.hxx | 4 +-- framework/source/classes/taskcreator.cxx | 8 ++---- framework/source/services/taskcreatorsrv.cxx | 19 ++------------ framework/util/fwk.component | 5 --- include/framework/taskcreatorsrv.hxx | 32 +++---------------------- offapi/UnoApi_offapi.mk | 1 offapi/com/sun/star/frame/TaskCreator.idl | 31 ------------------------ solenv/bin/native-code.py | 1 13 files changed, 30 insertions(+), 104 deletions(-)
New commits: commit 39f2c62847b890b6b354bdbc39b9b7aa40542f3d Author: Noel Grandin <[email protected]> AuthorDate: Sat Jun 14 13:26:22 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sat Jun 14 19:34:10 2025 +0200 simplify TaskCreatorService now that it is no longer an UNO service, we can simplify it, and returning a more explicit type. Change-Id: Ibd0f56e04ac26f09b57dc295febcf26202f16a2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186495 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx index 7a96d9172d3f..5cf67fa78694 100644 --- a/dbaccess/source/ui/misc/databaseobjectview.cxx +++ b/dbaccess/source/ui/misc/databaseobjectview.cxx @@ -109,7 +109,7 @@ namespace dbaui Any(NamedValue(u"SupportPersistentWindowState"_ustr, Any(true))) }; - m_xFrameLoader.set(xFact->createInstanceWithArguments(lArgs), UNO_QUERY_THROW); + m_xFrameLoader.set(xFact->createInstance(lArgs), UNO_QUERY_THROW); // everything we load can be considered a "top level document", so set the respective bit at the window. // This, amongst other things, triggers that the component in this task participates in the diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx index 6ed4d38ba0bc..3721b7ba10a4 100644 --- a/embeddedobj/source/general/docholder.cxx +++ b/embeddedobj/source/general/docholder.cxx @@ -451,7 +451,7 @@ bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >& xPar } // the call will create, initialize the frame, and register it in the parent - m_xFrame.set( xFrameFact->createInstanceWithArguments( aArgs ), uno::UNO_QUERY_THROW ); + m_xFrame = xFrameFact->createInstance( aArgs ); m_xHatchWindow = std::move(xHWindow); m_xOwnWindow = std::move(xOwnWindow); @@ -807,17 +807,16 @@ bool DocumentHolder::HideUI( const uno::Reference< css::frame::XLayoutManager >& } -uno::Reference< frame::XFrame > const & DocumentHolder::GetDocFrame() +uno::Reference< frame::XFrame2 > const & DocumentHolder::GetDocFrame() { // the frame for outplace activation if ( !m_xFrame.is() ) { rtl::Reference< TaskCreatorService > xFrameFact = new TaskCreatorService(m_xContext); - m_xFrame.set(xFrameFact->createInstanceWithArguments( m_aOutplaceFrameProps ), uno::UNO_QUERY_THROW); + m_xFrame = xFrameFact->createInstance( m_aOutplaceFrameProps ); - uno::Reference< frame::XDispatchProviderInterception > xInterception( m_xFrame, uno::UNO_QUERY ); - if ( xInterception.is() ) + if ( m_xFrame.is() ) { if ( m_xInterceptor.is() ) { @@ -827,11 +826,11 @@ uno::Reference< frame::XFrame > const & DocumentHolder::GetDocFrame() m_xInterceptor = new Interceptor( this ); - xInterception->registerDispatchProviderInterceptor( m_xInterceptor ); + m_xFrame->registerDispatchProviderInterceptor( m_xInterceptor ); // register interceptor from outside if ( m_xOutplaceInterceptor.is() ) - xInterception->registerDispatchProviderInterceptor( m_xOutplaceInterceptor ); + m_xFrame->registerDispatchProviderInterceptor( m_xOutplaceInterceptor ); } uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xFrame, uno::UNO_QUERY ); diff --git a/embeddedobj/source/inc/docholder.hxx b/embeddedobj/source/inc/docholder.hxx index d4aa54d3b10c..88212e4cd5e6 100644 --- a/embeddedobj/source/inc/docholder.hxx +++ b/embeddedobj/source/inc/docholder.hxx @@ -24,7 +24,7 @@ #include <com/sun/star/util/XModifyListener.hpp> #include <com/sun/star/util/XCloseable.hpp> #include <com/sun/star/document/XEventListener.hpp> -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrame2.hpp> #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> #include <com/sun/star/frame/XBorderResizeListener.hpp> #include <com/sun/star/frame/BorderWidths.hpp> @@ -63,7 +63,7 @@ private: css::uno::Reference< css::util::XCloseable > m_xComponent; - css::uno::Reference< css::frame::XFrame > m_xFrame; + css::uno::Reference< css::frame::XFrame2 > m_xFrame; css::uno::Reference< css::awt::XWindow > m_xOwnWindow; // set for inplace objects css::uno::Reference< css::awt::XWindow > m_xHatchWindow; // set for inplace objects @@ -85,7 +85,7 @@ private: css::uno::Sequence< css::uno::Any > m_aOutplaceFrameProps; - css::uno::Reference< css::frame::XFrame > const & GetDocFrame(); + css::uno::Reference< css::frame::XFrame2 > const & GetDocFrame(); bool LoadDocToFrame( bool ); css::awt::Rectangle CalculateBorderedArea( const css::awt::Rectangle& aRect ); diff --git a/framework/inc/classes/taskcreator.hxx b/framework/inc/classes/taskcreator.hxx index d57cc406e3b7..169a015aa368 100644 --- a/framework/inc/classes/taskcreator.hxx +++ b/framework/inc/classes/taskcreator.hxx @@ -19,7 +19,7 @@ #pragma once -#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XFrame2.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/Reference.hxx> @@ -51,7 +51,7 @@ class TaskCreator final TaskCreator( css::uno::Reference< css::uno::XComponentContext > xContext ); ~TaskCreator( ); - css::uno::Reference< css::frame::XFrame > createTask( const OUString& sName, const utl::MediaDescriptor& rDescriptor ); + css::uno::Reference< css::frame::XFrame2 > createTask( const OUString& sName, const utl::MediaDescriptor& rDescriptor ); }; // class TaskCreator diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx index cd0a511b1e76..3488018d2c09 100644 --- a/framework/source/classes/taskcreator.cxx +++ b/framework/source/classes/taskcreator.cxx @@ -53,7 +53,7 @@ TaskCreator::~TaskCreator() /*-**************************************************************************************************** TODO document me *//*-*****************************************************************************************************/ -css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUString& sName, const utl::MediaDescriptor& rDescriptor ) +css::uno::Reference< css::frame::XFrame2 > TaskCreator::createTask( const OUString& sName, const utl::MediaDescriptor& rDescriptor ) { rtl::Reference< TaskCreatorService > xCreator = new TaskCreatorService(m_xContext); @@ -66,8 +66,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin css::uno::Any(css::beans::NamedValue(ARGUMENT_FRAMENAME, css::uno::Any(sName))), css::uno::Any(css::beans::NamedValue(ARGUMENT_HIDDENFORCONVERSION, css::uno::Any(rDescriptor.getUnpackedValueOrDefault(ARGUMENT_HIDDENFORCONVERSION, false)))) }; - css::uno::Reference< css::frame::XFrame > xTask(xCreator->createInstanceWithArguments(lArgs), css::uno::UNO_QUERY_THROW); - return xTask; + return xCreator->createInstance(lArgs); } } // namespace framework diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx index 70908178da0f..97a75dff554e 100644 --- a/framework/source/services/taskcreatorsrv.cxx +++ b/framework/source/services/taskcreatorsrv.cxx @@ -46,12 +46,7 @@ TaskCreatorService::TaskCreatorService(css::uno::Reference< css::uno::XComponent { } -css::uno::Reference< css::uno::XInterface > SAL_CALL TaskCreatorService::createInstance() -{ - return createInstanceWithArguments(css::uno::Sequence< css::uno::Any >()); -} - -css::uno::Reference< css::uno::XInterface > SAL_CALL TaskCreatorService::createInstanceWithArguments(const css::uno::Sequence< css::uno::Any >& lArguments) +css::uno::Reference< css::frame::XFrame2 > TaskCreatorService::createInstance(const css::uno::Sequence< css::uno::Any >& lArguments) { ::comphelper::SequenceAsHashMap lArgs(lArguments); @@ -137,7 +132,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL TaskCreatorService::createI if (bVisible) xContainerWindow->setVisible(bVisible); - return css::uno::Reference< css::uno::XInterface >(xFrame, css::uno::UNO_QUERY_THROW); + return xFrame; } // static diff --git a/include/framework/taskcreatorsrv.hxx b/include/framework/taskcreatorsrv.hxx index 01b8ba18aaa3..44970c628037 100644 --- a/include/framework/taskcreatorsrv.hxx +++ b/include/framework/taskcreatorsrv.hxx @@ -21,12 +21,10 @@ #include "fwkdllapi.h" #include <comphelper/compbase.hxx> -#include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/frame/XFrame2.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -typedef comphelper::WeakComponentImplHelper<css::lang::XSingleServiceFactory> - TaskCreatorService_BASE; +typedef comphelper::WeakComponentImplHelper<> TaskCreatorService_BASE; class FWK_DLLPUBLIC TaskCreatorService : public TaskCreatorService_BASE { @@ -39,11 +37,8 @@ private: public: explicit TaskCreatorService(css::uno::Reference<css::uno::XComponentContext> xContext); - // XSingleServiceFactory - virtual css::uno::Reference<css::uno::XInterface> SAL_CALL createInstance() override; - - virtual css::uno::Reference<css::uno::XInterface> SAL_CALL - createInstanceWithArguments(const css::uno::Sequence<css::uno::Any>& lArguments) override; + css::uno::Reference<css::frame::XFrame2> + createInstance(const css::uno::Sequence<css::uno::Any>& lArguments); private: css::uno::Reference<css::awt::XWindow> commit 96b6d13c9ad73f946efcb7cfa7ccee3d91b8649c Author: Noel Grandin <[email protected]> AuthorDate: Sat Jun 14 13:18:46 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sat Jun 14 19:34:01 2025 +0200 [API CHANGE] no need for TaskCreatorService to be exposed via UNO This is a purely internal usage thing. Change-Id: I8d13d21c791bc88a2fc288fb97f7877eecab3e73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186494 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/dbaccess/Library_dbahsql.mk b/dbaccess/Library_dbahsql.mk index 05b99126c62e..e6c353c63f40 100644 --- a/dbaccess/Library_dbahsql.mk +++ b/dbaccess/Library_dbahsql.mk @@ -22,6 +22,7 @@ $(eval $(call gb_Library_use_libraries,dbahsql,\ comphelper \ cppu \ cppuhelper \ + fwk \ sal \ salhelper \ dbtools \ diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx index 112c79947393..7a96d9172d3f 100644 --- a/dbaccess/source/ui/misc/databaseobjectview.cxx +++ b/dbaccess/source/ui/misc/databaseobjectview.cxx @@ -22,7 +22,6 @@ #include <asyncmodaldialog.hxx> #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#include <com/sun/star/frame/TaskCreator.hpp> #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdb/application/XTableUIProvider.hpp> @@ -34,6 +33,7 @@ #include <comphelper/diagnose_ex.hxx> #include <utility> #include <vcl/window.hxx> +#include <framework/taskcreatorsrv.hxx> namespace dbaui { @@ -103,7 +103,7 @@ namespace dbaui // if we have no externally provided frame, create one if ( !m_xFrameLoader.is() ) { - Reference< XSingleServiceFactory > xFact = TaskCreator::create(m_xORB); + rtl::Reference< TaskCreatorService > xFact = new TaskCreatorService(m_xORB); Sequence< Any > lArgs{ Any(NamedValue(u"ParentFrame"_ustr, Any(m_xParentFrame))), Any(NamedValue(u"TopWindow"_ustr, Any(true))), Any(NamedValue(u"SupportPersistentWindowState"_ustr, diff --git a/embeddedobj/Library_embobj.mk b/embeddedobj/Library_embobj.mk index 18cf55518d44..c06d229a0113 100644 --- a/embeddedobj/Library_embobj.mk +++ b/embeddedobj/Library_embobj.mk @@ -33,6 +33,7 @@ $(eval $(call gb_Library_use_libraries,embobj,\ comphelper \ cppu \ cppuhelper \ + fwk \ sal \ svt \ utl \ diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx index eddc8a47ca0f..6ed4d38ba0bc 100644 --- a/embeddedobj/source/general/docholder.cxx +++ b/embeddedobj/source/general/docholder.cxx @@ -18,7 +18,6 @@ */ #include <com/sun/star/embed/Aspects.hpp> -#include <com/sun/star/frame/TaskCreator.hpp> #include <com/sun/star/frame/XTitle.hpp> #include <com/sun/star/frame/TerminationVetoException.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> @@ -64,6 +63,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/namedvaluecollection.hxx> +#include <framework/taskcreatorsrv.hxx> #include <docholder.hxx> #include <commonembobj.hxx> @@ -433,7 +433,7 @@ bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >& xPar uno::Reference< frame::XFrame > xContFrame( xContDisp, uno::UNO_QUERY ); // create a frame based on the specified window - uno::Reference< lang::XSingleServiceFactory > xFrameFact = frame::TaskCreator::create(m_xContext); + rtl::Reference< TaskCreatorService > xFrameFact = new TaskCreatorService(m_xContext); uno::Sequence< uno::Any > aArgs( xContFrame.is() ? 2 : 1 ); auto pArgs = aArgs.getArray(); @@ -812,7 +812,7 @@ uno::Reference< frame::XFrame > const & DocumentHolder::GetDocFrame() // the frame for outplace activation if ( !m_xFrame.is() ) { - uno::Reference< lang::XSingleServiceFactory > xFrameFact = frame::TaskCreator::create(m_xContext); + rtl::Reference< TaskCreatorService > xFrameFact = new TaskCreatorService(m_xContext); m_xFrame.set(xFrameFact->createInstanceWithArguments( m_aOutplaceFrameProps ), uno::UNO_QUERY_THROW); diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx index 167e345e051e..cd0a511b1e76 100644 --- a/framework/source/classes/taskcreator.cxx +++ b/framework/source/classes/taskcreator.cxx @@ -18,12 +18,11 @@ */ #include <classes/taskcreator.hxx> -#include <services/taskcreatorsrv.hxx> +#include <framework/taskcreatorsrv.hxx> #include <services.h> #include <taskcreatordefs.hxx> #include <com/sun/star/frame/Desktop.hpp> -#include <com/sun/star/frame/TaskCreator.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <utility> diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx index 2cd7519d0b73..70908178da0f 100644 --- a/framework/source/services/taskcreatorsrv.cxx +++ b/framework/source/services/taskcreatorsrv.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <services/taskcreatorsrv.hxx> +#include <framework/taskcreatorsrv.hxx> #include <helper/persistentwindowstate.hxx> #include <helper/tagwindowasmodified.hxx> #include <helper/titlebarupdate.hxx> @@ -284,12 +284,4 @@ OUString TaskCreatorService::impl_filterNames( const OUString& sName ) return sFiltered; } -extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * -com_sun_star_comp_framework_TaskCreator_get_implementation( - css::uno::XComponentContext *context, - css::uno::Sequence<css::uno::Any> const &) -{ - return cppu::acquire(new TaskCreatorService(context)); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index b8fef412703d..eccbe5e2694b 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -149,11 +149,6 @@ constructor="com_sun_star_comp_framework_StatusIndicatorFactory_get_implementation"> <service name="com.sun.star.task.StatusIndicatorFactory"/> </implementation> - <implementation name="com.sun.star.comp.framework.TaskCreator" - constructor="com_sun_star_comp_framework_TaskCreator_get_implementation" - single-instance="true"> - <service name="com.sun.star.frame.TaskCreator"/> - </implementation> <implementation name="com.sun.star.comp.framework.ToolBarControllerFactory" constructor="com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation" single-instance="true"> diff --git a/framework/inc/services/taskcreatorsrv.hxx b/include/framework/taskcreatorsrv.hxx similarity index 78% rename from framework/inc/services/taskcreatorsrv.hxx rename to include/framework/taskcreatorsrv.hxx index e66cda211378..01b8ba18aaa3 100644 --- a/framework/inc/services/taskcreatorsrv.hxx +++ b/include/framework/taskcreatorsrv.hxx @@ -19,18 +19,16 @@ #pragma once +#include "fwkdllapi.h" #include <comphelper/compbase.hxx> -#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/frame/XFrame2.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <cppuhelper/supportsservice.hxx> -typedef comphelper::WeakComponentImplHelper<css::lang::XServiceInfo, - css::lang::XSingleServiceFactory> +typedef comphelper::WeakComponentImplHelper<css::lang::XSingleServiceFactory> TaskCreatorService_BASE; -class TaskCreatorService : public TaskCreatorService_BASE +class FWK_DLLPUBLIC TaskCreatorService : public TaskCreatorService_BASE { private: /** @short the global uno service manager. @@ -41,21 +39,6 @@ private: public: explicit TaskCreatorService(css::uno::Reference<css::uno::XComponentContext> xContext); - virtual OUString SAL_CALL getImplementationName() override - { - return u"com.sun.star.comp.framework.TaskCreator"_ustr; - } - - virtual sal_Bool SAL_CALL supportsService(OUString const& ServiceName) override - { - return cppu::supportsService(this, ServiceName); - } - - virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override - { - return { u"com.sun.star.frame.TaskCreator"_ustr }; - } - // XSingleServiceFactory virtual css::uno::Reference<css::uno::XInterface> SAL_CALL createInstance() override; diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 76907d1defaa..b25e2a261ef4 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -199,7 +199,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/frame,\ OfficeFrameLoader \ SessionListener \ StartModule \ - TaskCreator \ UICommandDescription \ theAutoRecovery \ theDesktop \ diff --git a/offapi/com/sun/star/frame/TaskCreator.idl b/offapi/com/sun/star/frame/TaskCreator.idl deleted file mode 100644 index f7cba87cd926..000000000000 --- a/offapi/com/sun/star/frame/TaskCreator.idl +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - - module com { module sun { module star { module frame { - -/** - @since LibreOffice 4.1 - */ -service TaskCreator : com::sun::star::lang::XSingleServiceFactory; - - -}; }; }; }; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index 638d9b98a26d..8671942bf7aa 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -215,7 +215,6 @@ core_constructor_list = [ "com_sun_star_comp_framework_ToolbarAsMenuController_get_implementation", "com_sun_star_comp_framework_ResourceMenuController_get_implementation", "com_sun_star_comp_framework_StatusIndicatorFactory_get_implementation", - "com_sun_star_comp_framework_TaskCreator_get_implementation", "com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation", "com_sun_star_comp_framework_UIConfigurationManager_get_implementation", "com_sun_star_comp_framework_UIElementFactoryManager_get_implementation",
