RepositoryModule_host.mk                                        |    7 -
 offapi/UnoApi_offapi.mk                                         |    1 
 offapi/com/sun/star/presentation/CreateDialogFactoryService.idl |   38 
+++++++++
 sd/Library_sdui.mk                                              |    3 
 sd/source/console/presenter.component                           |    4 
 sd/source/ui/dlg/sdabstdlg.cxx                                  |   39 
++-------
 sd/source/ui/dlg/sduiexp.cxx                                    |   41 
+++++++++-
 solenv/gbuild/extensions/pre_MergedLibsList.mk                  |    1 
 8 files changed, 97 insertions(+), 37 deletions(-)

New commits:
commit 4ed1536c6eed2a7919a80c7f92617aa0a4058263
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Mar 5 14:40:44 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Mar 5 18:31:48 2024 +0100

    Create an UNO service to do the symbol lookup in sd
    
    which means I can remove one usage of gb_Library_set_plugin_for, which
    is blocking linking the sd module into
    --enable-mergelibs=more
    
    Change-Id: I90dae749f777446f67342d121e4dc29b974cb9b6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164423
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 5cfc725c5e29..7687ee9fd06d 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -2971,6 +2971,7 @@ $(eval $(call 
gb_UnoApi_add_idlfiles,offapi,com/sun/star/presentation,\
        AnimationEffect \
        AnimationSpeed \
        ClickAction \
+       CreateDialogFactoryService \
        EffectCommands \
        EffectNodeType \
        EffectPresetClass \
diff --git a/offapi/com/sun/star/presentation/CreateDialogFactoryService.idl 
b/offapi/com/sun/star/presentation/CreateDialogFactoryService.idl
new file mode 100644
index 000000000000..2f235334adaa
--- /dev/null
+++ b/offapi/com/sun/star/presentation/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 presentation {
+
+/**
+  The sd module uses this to get a pointer to the AccessibleFactory from the 
sdui module.
+  Because we have a dependency in our modules that goes the "wrong" way.
+
+  @since LibreOffice 24.8
+
+  @internal
+
+  ATTENTION: This is marked <em>internal</em> and does not
+  have the <em>published</em> 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/sd/Library_sdui.mk b/sd/Library_sdui.mk
index 30a502bcbdf6..5f0f457a43c5 100644
--- a/sd/Library_sdui.mk
+++ b/sd/Library_sdui.mk
@@ -9,8 +9,6 @@
 
 $(eval $(call gb_Library_Library,sdui))
 
-$(eval $(call gb_Library_set_plugin_for,sdui,sd))
-
 $(eval $(call 
gb_Library_set_componentfile,sdui,sd/source/console/presenter,services))
 
 $(eval $(call gb_Library_set_include,sdui,\
@@ -53,6 +51,7 @@ $(eval $(call gb_Library_use_libraries,sdui,\
     fwk \
     sal \
     salhelper \
+       sd \
     sfx \
     sot \
     svl \
diff --git a/sd/source/console/presenter.component 
b/sd/source/console/presenter.component
index 3e1bc8508d36..8a1d8b93a224 100644
--- a/sd/source/console/presenter.component
+++ b/sd/source/console/presenter.component
@@ -15,4 +15,8 @@
         constructor="sd_PresenterProtocolHandler_get_implementation">
         <service name="com.sun.star.frame.ProtocolHandler"/>
     </implementation>
+    <implementation 
name="com.sun.star.presentation.comp.CreateDialogFactoryService"
+        
constructor="com_sun_star_presentation_CreateDialogFactoryService_get_implementation">
+        <service name="com.sun.star.presentation.CreateDialogFactoryService"/>
+     </implementation>
 </component>
diff --git a/sd/source/ui/dlg/sdabstdlg.cxx b/sd/source/ui/dlg/sdabstdlg.cxx
index 2b686a3e8882..181a2ec42d62 100644
--- a/sd/source/ui/dlg/sdabstdlg.cxx
+++ b/sd/source/ui/dlg/sdabstdlg.cxx
@@ -18,38 +18,19 @@
  */
 
 #include <sdabstdlg.hxx>
-
-#include <osl/module.hxx>
-
-typedef SdAbstractDialogFactory* (*SdFuncPtrCreateDialogFactory)();
-
-#ifndef DISABLE_DYNLOADING
-
-extern "C" {
-static void thisModule() {}
-}
-
-#else
-
-extern "C" SdAbstractDialogFactory* SdCreateDialogFactory();
-
-#endif
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/presentation/CreateDialogFactoryService.hpp>
 
 SdAbstractDialogFactory* SdAbstractDialogFactory::Create()
 {
-    SdFuncPtrCreateDialogFactory fp = nullptr;
-#ifndef DISABLE_DYNLOADING
-    static ::osl::Module aDialogLibrary;
-    static constexpr OUStringLiteral sLibName(u"" SDUI_DLL_NAME);
-    if (aDialogLibrary.is() || aDialogLibrary.loadRelative(&thisModule, 
sLibName))
-        fp = reinterpret_cast<SdAbstractDialogFactory*(SAL_CALL*)()>(
-            aDialogLibrary.getFunctionSymbol("SdCreateDialogFactory"));
-#else
-    fp = SdCreateDialogFactory;
-#endif
-    if (fp)
-        return fp();
-    return nullptr;
+    auto xService = css::presentation::CreateDialogFactoryService::create(
+        comphelper::getProcessComponentContext());
+    assert(xService);
+    // get a factory instance
+    SdAbstractDialogFactory* pFactory
+        = 
reinterpret_cast<SdAbstractDialogFactory*>(xService->getSomething({}));
+    assert(pFactory);
+    return pFactory;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/sduiexp.cxx b/sd/source/ui/dlg/sduiexp.cxx
index 62901c70d0aa..63354ab7ed58 100644
--- a/sd/source/ui/dlg/sduiexp.cxx
+++ b/sd/source/ui/dlg/sduiexp.cxx
@@ -19,14 +19,49 @@
 
 #include "sddlgfact.hxx"
 #include <sal/types.h>
+#include <cppuhelper/supportsservice.hxx>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
 
 class SdAbstractDialogFactory;
 
+/// anonymous implementation namespace
+namespace
+{
+class CreateDialogFactoryService
+    : public ::cppu::WeakImplHelper<css::lang::XServiceInfo, 
css::lang::XUnoTunnel>
+{
+public:
+    // css::lang::XServiceInfo:
+    virtual OUString SAL_CALL getImplementationName() override
+    {
+        return "com.sun.star.presentation.comp.CreateDialogFactoryService";
+    }
+    virtual sal_Bool SAL_CALL supportsService(const OUString& serviceName) 
override
+    {
+        return cppu::supportsService(this, serviceName);
+    }
+    virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() 
override
+    {
+        return { "com.sun.star.presentation.CreateDialogFactoryService" };
+    }
+
+    // XUnoTunnel
+    virtual sal_Int64 SAL_CALL
+    getSomething(const ::css::uno::Sequence<::sal_Int8>& /*aIdentifier*/) 
override
+    {
+        static SdAbstractDialogFactory_Impl aFactory;
+        return 
reinterpret_cast<sal_Int64>(static_cast<SdAbstractDialogFactory*>(&aFactory));
+    }
+};
+
+} // closing anonymous implementation namespace
+
 extern "C" {
-SAL_DLLPUBLIC_EXPORT SdAbstractDialogFactory* SdCreateDialogFactory()
+SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+com_sun_star_presentation_CreateDialogFactoryService_get_implementation(
+    css::uno::XComponentContext*, css::uno::Sequence<css::uno::Any> const&)
 {
-    static SdAbstractDialogFactory_Impl aFactory;
-    return &aFactory;
+    return cppu::acquire(new CreateDialogFactoryService);
 }
 }
 
commit bacb92275c0c474d09146c0409cb547aef6551cf
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Mar 5 13:58:37 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Mar 5 18:31:35 2024 +0100

    add dbu to --enable-mergelibs=more
    
    Change-Id: I04e6516c0bd8d4e0c08c93c59f7c5b0aea88b0ea
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164420
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 26c97fb0af1a..90a08dc91717 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -230,10 +230,11 @@ $(eval $(call repositorymodule_serialize,\
        sc msword \
        $(call gb_Helper_optional,DESKTOP,swui) \
        sw sd \
-       $(call gb_Helper_optional,DBCONNECTIVITY,dbu) \
-       $(if $(MERGELIBS_MORE),,writerfilter cui) \
+       $(if $(MERGELIBS_MORE),, \
+               $(call gb_Helper_optional,DBCONNECTIVITY,dbu) \
+               writerfilter cui) \
        $(if $(MERGELIBS), merged, \
-                $(if $(MERGELIBS_MORE),writerfilter cui,) chartcontroller 
chartcore oox svx svxcore xo sfx fwk svt vcl) \
+               chartcontroller chartcore oox svx svxcore xo sfx fwk svt vcl) \
 ))
 endif
 endif # !$(DISABLE_DYNLOADING)
diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk 
b/solenv/gbuild/extensions/pre_MergedLibsList.mk
index 7b8b8c5f3685..4b207daa9c02 100644
--- a/solenv/gbuild/extensions/pre_MergedLibsList.mk
+++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk
@@ -137,6 +137,7 @@ gb_MERGE_LIBRARY_LIST += \
        dba \
        dbahsql \
        $(call gb_Helper_optional,DBCONNECTIVITY,dbpool2) \
+       $(call gb_Helper_optional,DBCONNECTIVITY,dbu) \
        dlgprov \
        $(if $(ENABLE_EVOAB2),evoab) \
        $(call gb_Helper_optional,DBCONNECTIVITY, \

Reply via email to