diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 8a9cb2f58757..5cfc725c5e29 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -3398,6 +3398,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/sheet,\
ConditionFormatOperator \
ConditionOperator \
ConditionOperator2 \
+ CreateDialogFactoryService \
DataBarAxis \
DataBarEntryType \
DateType \
diff --git a/offapi/com/sun/star/sheet/CreateDialogFactoryService.idl b/offapi/com/sun/star/sheet/CreateDialogFactoryService.idl
new file mode 100644
index 000000000000..9fdf5176ec20
--- /dev/null
+++ b/offapi/com/sun/star/sheet/CreateDialogFactoryService.idl
@@ -0,0 +1,38 @@
+/* -*- 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 sheet {
+
+/**
+ The sc module uses this to get a pointer to the ScAbstractDialogFactory from the scui module.
+ Because we have a dependency in our modules that goes the "wrong" way.
+
+ @since LibreOffice 24.8
+
+ @internal
+
+ ATTENTION: This is marked internal and does not
+ have the published flag, which means it is subject to
+ change without notice and should not be used outside the LibreOffice core.
+*/
+service CreateDialogFactoryService : com::sun::star::lang::XUnoTunnel;
+
+}; }; }; };
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk
index a4c7572734ae..a71140b9803b 100644
--- a/sc/Library_scui.mk
+++ b/sc/Library_scui.mk
@@ -9,7 +9,7 @@
$(eval $(call gb_Library_Library,scui))
-$(eval $(call gb_Library_set_plugin_for,scui,sc))
+$(eval $(call gb_Library_set_componentfile,scui,sc/util/scui,services))
$(eval $(call gb_Library_set_include,scui,\
-I$(SRCDIR)/sc/source/core/inc \
@@ -58,6 +58,7 @@ $(eval $(call gb_Library_use_libraries,scui,\
$(call gb_Helper_optional,OPENCL, \
opencl) \
sal \
+ sc \
sfx \
sot \
svl \
diff --git a/sc/source/ui/attrdlg/scabstdlg.cxx b/sc/source/ui/attrdlg/scabstdlg.cxx
index a8a457c5c985..9696147639fe 100644
--- a/sc/source/ui/attrdlg/scabstdlg.cxx
+++ b/sc/source/ui/attrdlg/scabstdlg.cxx
@@ -21,35 +21,17 @@
#include
#include
-
-typedef ScAbstractDialogFactory* (*ScFuncPtrCreateDialogFactory)();
-
-#ifndef DISABLE_DYNLOADING
-
-extern "C" { static void thisModule() {} }
-
-#else
-
-extern "C" ScAbstractDialogFactory* ScCreateDialogFactory();
-
-#endif
+#include
+#include
ScAbstractDialogFactory* ScAbstractDialogFactory::Create()
{
- ScFuncPtrCreateDialogFactory fp = nullptr;
-#ifndef DISABLE_DYNLOADING
- static ::osl::Module aDialogLibrary;
-
- if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, SVLIBRARY("scui"),
- SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
- fp = reinterpret_cast(
- aDialogLibrary.getFunctionSymbol( "ScCreateDialogFactory" ));
-#else
- fp = ScCreateDialogFactory;
-#endif
- if ( fp )
- return fp();
- return nullptr;
+ auto xService = css::sheet::CreateDialogFactoryService::create(comphelper::getProcessComponentContext());
+ assert(xService);
+ // get a factory instance
+ ScAbstractDialogFactory* pFactory = reinterpret_cast(xService->getSomething({}));
+ assert(pFactory);
+ return pFactory;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/scuiexp.cxx b/sc/source/ui/attrdlg/scuiexp.cxx
index 4351539a9055..1179050037b2 100644
--- a/sc/source/ui/attrdlg/scuiexp.cxx
+++ b/sc/source/ui/attrdlg/scuiexp.cxx
@@ -21,13 +21,46 @@
#include "scdlgfact.hxx"
#include
+#include
+
+/// anonymous implementation namespace
+namespace
+{
+class CreateDialogFactoryService
+ : public ::cppu::WeakImplHelper
+{
+public:
+ // css::lang::XServiceInfo:
+ virtual OUString SAL_CALL getImplementationName() override
+ {
+ return "com.sun.star.sheet.comp.CreateDialogFactoryService";
+ }
+ virtual sal_Bool SAL_CALL supportsService(const OUString& serviceName) override
+ {
+ return cppu::supportsService(this, serviceName);
+ }
+ virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override
+ {
+ return { "com.sun.star.sheet.CreateDialogFactoryService" };
+ }
+
+ // XUnoTunnel
+ virtual sal_Int64 SAL_CALL
+ getSomething(const ::css::uno::Sequence<::sal_Int8>& /*aIdentifier*/) override
+ {
+ static ScAbstractDialogFactory_Impl aFactory;
+ return reinterpret_cast(static_cast(&aFactory));
+ }
+};
+
+} // closing anonymous implementation namespace
extern "C" {
-SAL_DLLPUBLIC_EXPORT ScAbstractDialogFactory* ScCreateDialogFactory()
+SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+com_sun_star_sheet_CreateDialogFactoryService_get_implementation(
+ css::uno::XComponentContext*, css::uno::Sequence const&)
{
- static ScAbstractDialogFactory_Impl aFactory;
- return &aFactory;
+ return cppu::acquire(new CreateDialogFactoryService);
}
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/util/scui.component b/sc/util/scui.component
new file mode 100644
index 000000000000..3a36222b93bc
--- /dev/null
+++ b/sc/util/scui.component
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+